Skip to content

Commit 586150d

Browse files
committed
fix: V25 version private update - fix six issues
1. After the server issues a forced update - update policy during shutdown/restart, the tray icon tooltip does not prompt after the terminal downloads the update resources 2. After the client update fails, the control center should not display the continue update button 3. After the client update fails, there is no prompt in system messages or the taskbar tray icon 4. After the client completes the update, the taskbar icon tooltip display does not meet requirements 5. After the client downloads the update patch, clicking update should not display "Update after shutdown" 6. After the client system upgrade succeeds, the control center - system update interface does not display the private update version number Log: Resolve the above issues Bug: https://pms.uniontech.com/bug-view-355377.html https://pms.uniontech.com/bug-view-354737.html https://pms.uniontech.com/bug-view-354735.html https://pms.uniontech.com/bug-view-354293.html https://pms.uniontech.com/bug-view-354243.html https://pms.uniontech.com/bug-view-354241.html Influence: Affects the interface display of control center private updates and the private update tray display fix: V25版本私有化更新-修复六个问题 1.服务端下发强制更新-关机重启时更新策略,终端下载完更新资源后,托盘图标tips没有提示 2.客户端更新失败后,控制中心不应该展示继续更新按钮 3.客户端更新失败后,系统消息和任务栏托盘图标没有提示 4.客户端完成更新,任务栏图标tips显示与需求不符 5.客户端下载完成更新补丁,点击更新,不应该展示“关机后更新” 6.客户端系统升级成功,控制中心-系统更新界面未展示私有化更新版本号 Log: 解决上述问题 Bug: https://pms.uniontech.com/bug-view-355377.html https://pms.uniontech.com/bug-view-354737.html https://pms.uniontech.com/bug-view-354735.html https://pms.uniontech.com/bug-view-354293.html https://pms.uniontech.com/bug-view-354243.html https://pms.uniontech.com/bug-view-354241.html Influence: 影响控制中心私有化更新的界面展示和私有化托盘的展示
1 parent f6e3868 commit 586150d

12 files changed

Lines changed: 133 additions & 4 deletions

File tree

src/dcc-update-plugin/operation/updatemodel.cpp

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// SPDX-License-Identifier: LGPL-3.0-or-later
44

5+
#include "common/common/dconfig_helper.h"
56
#include "updatemodel.h"
67
#include "updatehistorymodel.h"
78
#include "operation/common.h"
@@ -63,6 +64,7 @@ UpdateModel::UpdateModel(QObject* parent)
6364
, m_downloadWaiting(false)
6465
, m_downloadPaused(false)
6566
, m_upgradeWaiting(false)
67+
, m_scheduledUpgradeTime("")
6668
, m_downloadProgress(0.0)
6769
, m_distUpgradeProgress(0.0)
6870
, m_backupProgress(0.0)
@@ -215,6 +217,24 @@ void UpdateModel::setBatterIsOK(bool ok)
215217
Q_EMIT batterIsOKChanged(ok);
216218
}
217219

220+
void UpdateModel::setScheduledUpgradeTime()
221+
{
222+
QString updateTime = DConfigHelper::instance()->getConfig("org.deepin.dde.lastore", "org.deepin.dde.lastore", "","update-time", "").toString();
223+
if (!updateTime.isEmpty()) {
224+
QDateTime dateTime = QDateTime::fromString(updateTime, Qt::ISODate);
225+
if (dateTime.isValid()) {
226+
QString formattedDateTime = dateTime.toString("HH:mm:ss");
227+
qCDebug(logDccUpdatePlugin) << "Set scheduled upgrade time:" << formattedDateTime;
228+
if (m_scheduledUpgradeTime == formattedDateTime) {
229+
return;
230+
}
231+
232+
m_scheduledUpgradeTime = formattedDateTime;
233+
Q_EMIT scheduledUpgradeTimeChanged();
234+
}
235+
}
236+
}
237+
218238
void UpdateModel::setLastStatus(const UpdatesStatus& status, int line, int types)
219239
{
220240
qCInfo(logDccUpdatePlugin) << "Status: " << status << ", types:" << types << ", line:" << line;
@@ -301,19 +321,36 @@ void UpdateModel::updateCheckUpdateUi()
301321
setCheckBtnText(tr("Check Again"));
302322
break;
303323
case Updated:
304-
case UpdatesAvailable:
324+
case UpdatesAvailable: {
305325
qCDebug(logDccUpdatePlugin) << "Setting UI for Updated status";
306326
setCheckBtnText(tr("Check Again"));
307327
setCheckUpdateErrTips(tr("Your system is up to date"));
308328
setCheckUpdateIcon("update_abreast_of_time");
329+
QString versionInfo = tr("Current Edition") + ": " + m_systemVersionInfo;
330+
if (!m_baseline.isEmpty()) {
331+
versionInfo = versionInfo + "\n" + tr("Baseline") + ": " + m_baseline;
332+
}
333+
setVersionInfo(versionInfo);
309334
break;
335+
}
310336
default:
311337
qCDebug(logDccUpdatePlugin) << "Unknown status in switch, clearing text";
312338
setCheckBtnText(tr(""));
313339
return;
314340
}
315341
}
316342

343+
void UpdateModel::setVersionInfo(const QString &versionInfo)
344+
{
345+
qCDebug(logDccUpdatePlugin) << "Setting version info:" << versionInfo;
346+
if (m_versionInfo == versionInfo) {
347+
return;
348+
}
349+
350+
m_versionInfo = versionInfo;
351+
emit versionInfoChanged();
352+
}
353+
317354
void UpdateModel::setCheckUpdateErrTips(const QString &newCheckUpdateErrTips)
318355
{
319356
qCDebug(logDccUpdatePlugin) << "Setting check update error tips:" << newCheckUpdateErrTips;

src/dcc-update-plugin/operation/updatemodel.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class UpdateModel : public QObject
3636
Q_PROPERTY(QString checkUpdateIcon READ checkUpdateIcon NOTIFY checkUpdateIconChanged FINAL)
3737
Q_PROPERTY(double checkUpdateProgress READ checkUpdateProgress NOTIFY checkUpdateProgressChanged FINAL)
3838
Q_PROPERTY(UpdatesStatus checkUpdateStatus READ checkUpdateStatus NOTIFY checkUpdateStatusChanged FINAL)
39+
Q_PROPERTY(QString versionInfo READ versionInfo NOTIFY versionInfoChanged FINAL)
3940
Q_PROPERTY(QString checkUpdateErrTips READ checkUpdateErrTips NOTIFY checkUpdateErrTipsChanged FINAL)
4041
Q_PROPERTY(QString checkBtnText READ checkBtnText NOTIFY checkBtnTextChanged FINAL)
4142
Q_PROPERTY(QString lastCheckUpdateTime READ lastCheckUpdateTime NOTIFY lastCheckUpdateTimeChanged FINAL)
@@ -54,6 +55,7 @@ class UpdateModel : public QObject
5455
Q_PROPERTY(bool downloadWaiting READ downloadWaiting NOTIFY downloadWaitingChanged FINAL)
5556
Q_PROPERTY(bool downloadPaused READ downloadPaused NOTIFY downloadPausedChanged FINAL)
5657
Q_PROPERTY(bool upgradeWaiting READ upgradeWaiting NOTIFY upgradeWaitingChanged FINAL)
58+
Q_PROPERTY(QString scheduledUpgradeTime READ scheduledUpgradeTime NOTIFY scheduledUpgradeTimeChanged FINAL)
5759

5860
Q_PROPERTY(double downloadProgress READ downloadProgress NOTIFY downloadProgressChanged FINAL)
5961
Q_PROPERTY(double backupProgress READ backupProgress NOTIFY backupProgressChanged FINAL)
@@ -141,6 +143,9 @@ class UpdateModel : public QObject
141143
void setCheckUpdateStatus(UpdatesStatus newCheckUpdateStatus);
142144
void updateCheckUpdateUi();
143145

146+
QString versionInfo() const { return m_versionInfo; }
147+
void setVersionInfo(const QString &newCheckUpdateErrTips);
148+
144149
QString checkUpdateErrTips() const { return m_checkUpdateErrTips; }
145150
void setCheckUpdateErrTips(const QString &newCheckUpdateErrTips);
146151

@@ -191,6 +196,9 @@ class UpdateModel : public QObject
191196
bool upgradeWaiting() const { return m_upgradeWaiting; }
192197
void setUpgradeWaiting(bool waiting);
193198

199+
QString scheduledUpgradeTime() const { return m_scheduledUpgradeTime; }
200+
void setScheduledUpgradeTime();
201+
194202
double downloadProgress() const { return m_downloadProgress; }
195203
void setDownloadProgress(double downloadProgress);
196204

@@ -366,6 +374,7 @@ public slots:
366374
void checkUpdateIconChanged();
367375
void checkUpdateProgressChanged();
368376
void checkUpdateStatusChanged();
377+
void versionInfoChanged();
369378
void checkUpdateErrTipsChanged();
370379
void checkBtnTextChanged();
371380
void lastCheckUpdateTimeChanged();
@@ -385,6 +394,7 @@ public slots:
385394
void downloadWaitingChanged(bool waiting);
386395
void downloadPausedChanged(bool paused);
387396
void upgradeWaitingChanged(bool waiting);
397+
void scheduledUpgradeTimeChanged();
388398

389399
void downloadProgressChanged(const double &progress);
390400
void backupProgressChanged(double progress);
@@ -444,6 +454,7 @@ public slots:
444454
QString m_checkUpdateIcon;
445455
double m_checkUpdateProgress;
446456
UpdatesStatus m_checkUpdateStatus;
457+
QString m_versionInfo;
447458
QString m_checkUpdateErrTips;
448459
QString m_checkBtnText;
449460
QString m_lastCheckUpdateTime;
@@ -462,6 +473,7 @@ public slots:
462473
bool m_downloadWaiting;
463474
bool m_downloadPaused;
464475
bool m_upgradeWaiting;
476+
QString m_scheduledUpgradeTime;
465477
double m_downloadProgress;
466478
double m_distUpgradeProgress;
467479
double m_backupProgress;

src/dcc-update-plugin/operation/updatework.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ void UpdateWorker::initConfig()
294294
qCDebug(logDccUpdatePlugin) << "Initialize lastore daemon configuration";
295295
if (m_lastoreDConfig && m_lastoreDConfig->isValid()) {
296296
m_model->setLastoreDaemonStatus(m_lastoreDConfig->value("lastore-daemon-status").toInt());
297+
m_model->setScheduledUpgradeTime();
297298
connect(m_lastoreDConfig, &DConfig::valueChanged, this, [this](const QString& key) {
298299
if ("lastore-daemon-status" == key) {
299300
bool ok;

src/dcc-update-plugin/qml/CheckUpdate.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ ColumnLayout {
2323
width: parent.width
2424
spacing: 10
2525

26+
D.Label {
27+
Layout.alignment: Qt.AlignHCenter
28+
width: implicitWidth
29+
visible: dccData.model().isPrivateUpdate
30+
text: dccData.model().versionInfo
31+
font: D.DTK.fontManager.t8
32+
}
33+
2634
D.DciIcon {
2735
id: checkUpdateIcon
2836
Layout.alignment: Qt.AlignHCenter

src/dcc-update-plugin/qml/UpdateControl.qml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ ColumnLayout {
1515
property string updateStateIcon: ""
1616
property string updateTitle : ""
1717
property string updateTips: ""
18+
property string secondaryUpdateTips: ""
1819
property var btnActions: []
20+
property bool showActionButtons: true
1921
property string processTitle: ""
2022
property double processValue: 0
2123
property bool processState: false
@@ -89,6 +91,14 @@ ColumnLayout {
8991
}
9092
}
9193

94+
D.Label {
95+
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
96+
visible: secondaryUpdateTips.length !== 0
97+
text: secondaryUpdateTips
98+
font: D.DTK.fontManager.t8
99+
Layout.fillWidth: true
100+
}
101+
92102
D.Button {
93103
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
94104
visible: showLogButton
@@ -122,7 +132,7 @@ ColumnLayout {
122132
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
123133
text: modelData
124134
font: D.DTK.fontManager.t6
125-
visible: modelData.length !== 0 && !initAnimation.visible
135+
visible: rootLayout.showActionButtons && modelData.length !== 0 && !initAnimation.visible
126136
enabled: updatelistModel.model.isUpdateEnable
127137
onClicked: {
128138
rootLayout.btnClicked(index, updateListModels.getAllUpdateType())

src/dcc-update-plugin/qml/UpdateMain.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ DccObject {
233233
return dccData.model().installFailedTips
234234
}
235235
btnActions: [ qsTr("Continue Update") ]
236-
236+
showActionButtons: !dccData.model().isPrivateUpdate
237237
onBtnClicked: function(index, updateType) {
238238
dccData.work().onRequestRetry(Common.CPT_UpgradeFailed, updateType)
239239
}
@@ -301,6 +301,9 @@ DccObject {
301301
}
302302
return qsTr("Update size: ") + dccData.model().preInstallListModel.downloadSize
303303
}
304+
secondaryUpdateTips: dccData.model().scheduledUpgradeTime.length !== 0
305+
? qsTr("will upgrade at %1").arg(dccData.model().scheduledUpgradeTime)
306+
: ""
304307
busyState: dccData.model().upgradeWaiting
305308
updateListEnable: !dccData.model().upgradeWaiting
306309

src/dcc-update-plugin/translations/update_zh_CN.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@
197197
<source>Update size: </source>
198198
<translation>更新大小:</translation>
199199
</message>
200+
<message>
201+
<source>will upgrade at %1</source>
202+
<translation>将于%1开始系统更新</translation>
203+
</message>
200204
<message>
201205
<source>Downloading</source>
202206
<translation>下载中</translation>
@@ -284,6 +288,14 @@
284288
</context>
285289
<context>
286290
<name>UpdateModel</name>
291+
<message>
292+
<source>Current Edition</source>
293+
<translation>私有化更新版本号</translation>
294+
</message>
295+
<message>
296+
<source>Baseline</source>
297+
<translation>补丁版本号</translation>
298+
</message>
287299
<message>
288300
<source>Checking for updates, please wait…</source>
289301
<translation>正在检查更新,请等待…</translation>

src/dcc-update-plugin/translations/update_zh_HK.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@
197197
<source>Update size: </source>
198198
<translation>更新大小:</translation>
199199
</message>
200+
<message>
201+
<source>will upgrade at %1</source>
202+
<translation>將於%1開始系統更新</translation>
203+
</message>
200204
<message>
201205
<source>Downloading</source>
202206
<translation>下載中</translation>
@@ -284,6 +288,14 @@
284288
</context>
285289
<context>
286290
<name>UpdateModel</name>
291+
<message>
292+
<source>Current Edition</source>
293+
<translation>私有化更新版本號</translation>
294+
</message>
295+
<message>
296+
<source>Baseline</source>
297+
<translation>補丁版本號</translation>
298+
</message>
287299
<message>
288300
<source>Checking for updates, please wait…</source>
289301
<translation>正在檢查更新,請等待…</translation>

src/dcc-update-plugin/translations/update_zh_TW.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@
197197
<source>Update size: </source>
198198
<translation>更新大小:</translation>
199199
</message>
200+
<message>
201+
<source>will upgrade at %1</source>
202+
<translation>將於%1開始系統更新</translation>
203+
</message>
200204
<message>
201205
<source>Downloading</source>
202206
<translation>下載中</translation>
@@ -284,6 +288,14 @@
284288
</context>
285289
<context>
286290
<name>UpdateModel</name>
291+
<message>
292+
<source>Current Edition</source>
293+
<translation>私有化更新版本號</translation>
294+
</message>
295+
<message>
296+
<source>Baseline</source>
297+
<translation>補丁版本號</translation>
298+
</message>
287299
<message>
288300
<source>Checking for updates, please wait…</source>
289301
<translation>正在檢查更新,請等待…</translation>

src/private-lastore-tray/tipswidget.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,13 @@ void TipsWidget::refreshContent()
136136
if (checkRegularlyUpdate()) return;
137137
//检查是否有可更新内容
138138
QString systemUpgradeStatus = checkHasSystemUpdate(m_managerInter->updateStatus());
139-
if (systemUpgradeStatus == "downloaded") {
139+
if (systemUpgradeStatus == "backupFailed" || systemUpgradeStatus == "upgradeFailed") {
140+
m_textList.append(tr("Upgrade failed.Please go to check."));
141+
return;
142+
} else if (systemUpgradeStatus == "needReboot") {
143+
m_textList.append(tr("Upgrade conplete.Please reboot"));
144+
return;
145+
} else if (systemUpgradeStatus == "downloaded") {
140146
m_textList.append(tr("Download complete.Please go to control-center to check."));
141147
} else if (systemUpgradeStatus == "notDownload" || systemUpgradeStatus == "isDownloading"||
142148
systemUpgradeStatus == "downloadPause" || systemUpgradeStatus == "upgradeReady"

0 commit comments

Comments
 (0)