diff --git a/src/common/commondefine.h b/src/common/commondefine.h index 5c14ebfbe..8497b4ee2 100644 --- a/src/common/commondefine.h +++ b/src/common/commondefine.h @@ -36,5 +36,10 @@ const static QString LockService = QStringLiteral("org.deepin.dde.LockService1") const static QString LockPath = QStringLiteral("/org/deepin/dde/LockService1"); const static QString LockInterface = QStringLiteral("org.deepin.dde.LockService1"); +// shutdownFront1 +const static QString ShutdownFront1Service = QStringLiteral("org.deepin.dde.ShutdownFront1"); +const static QString ShutdownFront1Path = QStringLiteral("/org/deepin/dde/ShutdownFront1"); +const static QString ShutdownFront1Interface = QStringLiteral("org.deepin.dde.ShutdownFront1"); + const static QString PropertiesInterface = QStringLiteral("org.freedesktop.DBus.Properties"); const static QString PropertiesChanged = QStringLiteral("PropertiesChanged"); diff --git a/src/common/dbus/updatedbusproxy.cpp b/src/common/dbus/updatedbusproxy.cpp index c129ed169..bd06b0744 100644 --- a/src/common/dbus/updatedbusproxy.cpp +++ b/src/common/dbus/updatedbusproxy.cpp @@ -33,6 +33,8 @@ UpdateDBusProxy::UpdateDBusProxy(QObject *parent) this)) , m_lockServiceInter(new DDBusInterface( LockService, LockPath, LockInterface, QDBusConnection::systemBus(), this)) + , m_shutdownFrontInter(new DDBusInterface( + ShutdownFront1Service, ShutdownFront1Path, ShutdownFront1Interface, QDBusConnection::sessionBus(), this)) , m_interWatcher(new QDBusServiceWatcher(UpdaterService, QDBusConnection::systemBus())) { @@ -416,4 +418,17 @@ void UpdateDBusProxy::SetEnable(bool enable) QString UpdateDBusProxy::CurrentUser() { return QDBusPendingReply(m_lockServiceInter->asyncCall(QStringLiteral("CurrentUser"))); +} + +void UpdateDBusProxy::Restart() +{ + m_shutdownFrontInter->asyncCall(QStringLiteral("Restart")); +} +void UpdateDBusProxy::UpdateAndReboot() +{ + m_shutdownFrontInter->asyncCall(QStringLiteral("UpdateAndReboot")); +} +void UpdateDBusProxy::UpdateAndShutdown() +{ + m_shutdownFrontInter->asyncCall(QStringLiteral("UpdateAndShutdown")); } \ No newline at end of file diff --git a/src/common/dbus/updatedbusproxy.h b/src/common/dbus/updatedbusproxy.h index ef75c1b53..6372ba9d3 100644 --- a/src/common/dbus/updatedbusproxy.h +++ b/src/common/dbus/updatedbusproxy.h @@ -121,6 +121,11 @@ class UpdateDBusProxy : public QObject // lockService QString CurrentUser(); + + // shutdownFront + void Restart(); + void UpdateAndReboot(); + void UpdateAndShutdown(); signals: // updater void UpdateNotifyChanged(bool value) const; @@ -156,6 +161,7 @@ class UpdateDBusProxy : public QObject DDBusInterface *m_smartMirrorInter; DDBusInterface *m_login1Inter; DDBusInterface *m_lockServiceInter; + DDBusInterface *m_shutdownFrontInter; QDBusServiceWatcher *m_interWatcher; }; diff --git a/src/dcc-update-plugin/operation/updatework.cpp b/src/dcc-update-plugin/operation/updatework.cpp index 34250f1ff..f1b835d17 100644 --- a/src/dcc-update-plugin/operation/updatework.cpp +++ b/src/dcc-update-plugin/operation/updatework.cpp @@ -682,12 +682,18 @@ void UpdateWorker::doUpgrade(int updateTypes, bool doBackup) void UpdateWorker::reStart() { - DDBusSender() - .service("com.deepin.dde.shutdownFront") - .interface("com.deepin.dde.shutdownFront") - .path("/com/deepin/dde/shutdownFront") - .method("Restart") - .call(); + qCInfo(DCC_UPDATE_WORKER) << "request restart"; + m_updateInter->Restart(); +} + +void UpdateWorker::modalUpgrade(bool rebootAfterUpgrade) +{ + qCInfo(DCC_UPDATE_WORKER) << "request modal upgrade, reboot after upgrade:" << rebootAfterUpgrade; + if (rebootAfterUpgrade) { + m_updateInter->UpdateAndReboot(); + } else { + m_updateInter->UpdateAndShutdown(); + } } void UpdateWorker::setBackupJob(const QString& jobPath) @@ -1404,7 +1410,7 @@ void UpdateWorker::onBackupStatusChanged(const QString &value) m_model->setLastError(BackupFailed, analyzeJobErrorMessage(description, BackupFailed)); m_model->setBackupFailedTips(m_model->errorToText(m_model->lastError(BackupFailed))); } else if (value == "end") { - deleteJob(m_downloadJob); + deleteJob(m_backupJob); } } diff --git a/src/dcc-update-plugin/operation/updatework.h b/src/dcc-update-plugin/operation/updatework.h index 7260fcb54..c8a8eec0b 100644 --- a/src/dcc-update-plugin/operation/updatework.h +++ b/src/dcc-update-plugin/operation/updatework.h @@ -52,6 +52,7 @@ class UpdateWorker : public QObject // 备份并安装更新 Q_INVOKABLE void doUpgrade(int updateTypes, bool doBackup); Q_INVOKABLE void reStart(); + Q_INVOKABLE void modalUpgrade(bool rebootAfterUpgrade = true); void setBackupJob(const QString& jobPath); void setDistUpgradeJob(const QString& jobPath); void updateSystemVersion(); diff --git a/src/dcc-update-plugin/qml/UpdateSelectDialog.qml b/src/dcc-update-plugin/qml/UpdateSelectDialog.qml new file mode 100644 index 000000000..f57b0a470 --- /dev/null +++ b/src/dcc-update-plugin/qml/UpdateSelectDialog.qml @@ -0,0 +1,70 @@ +// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import QtQuick.Controls 2.5 + +import org.deepin.dtk 1.0 as D +import org.deepin.dtk.style as DS +import org.deepin.dcc 1.0 + +D.DialogWindow { + id: root + width: 360 + height: 130 + icon: "preferences-system" + modality: Qt.WindowModal + + signal silentBtnClicked() + signal upgradeRebootBtnClicked() + signal upgradeShutdownBtnClicked() + + ColumnLayout { + anchors.fill: parent + Label { + Layout.alignment: Qt.AlignHCenter + wrapMode: Text.WordWrap + text: qsTr("The updates have been already downloaded. What do you want to do?") + } + + Item { + Layout.fillHeight: true + } + + RowLayout { + Layout.fillWidth: true + Layout.bottomMargin: 0 + spacing: 10 + + D.Button { + text: qsTr("Silent Installation") + Layout.fillWidth: true + onClicked: { + root.silentBtnClicked() + } + } + + D.Button { + text: qsTr("Update and Reboot") + Layout.fillWidth: true + onClicked: { + root.upgradeRebootBtnClicked() + } + } + + D.Button { + text: qsTr("Update and Shut Down") + textColor: D.Palette { + normal { + common: D.DTK.makeColor(D.Color.Highlight) + } + normalDark: normal + } + Layout.fillWidth: true + onClicked: { + root.upgradeShutdownBtnClicked() + } + } + } + } +} diff --git a/src/dcc-update-plugin/qml/updateMain.qml b/src/dcc-update-plugin/qml/updateMain.qml index f1eae6588..d4c875d98 100644 --- a/src/dcc-update-plugin/qml/updateMain.qml +++ b/src/dcc-update-plugin/qml/updateMain.qml @@ -238,7 +238,25 @@ DccObject { updateListEnable: !dccData.model().upgradeWaiting onBtnClicked: function(index, updateType) { - dccData.work().doUpgrade(updateType, true) + updateSelectDialog.updateType = updateType + updateSelectDialog.show() + } + + UpdateSelectDialog { + id: updateSelectDialog + property var updateType: 0 + palette: parent.palette + visible: false + onSilentBtnClicked: { + dccData.work().doUpgrade(updateType, true) + close() + } + onUpgradeRebootBtnClicked: { + dccData.work().modalUpgrade(true) + } + onUpgradeShutdownBtnClicked: { + dccData.work().modalUpgrade(false) + } } } } diff --git a/src/dcc-update-plugin/translations/update_ar.ts b/src/dcc-update-plugin/translations/update_ar.ts index 35dea7d0a..7a3c5dbe3 100644 --- a/src/dcc-update-plugin/translations/update_ar.ts +++ b/src/dcc-update-plugin/translations/update_ar.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + قم بطي ذلك + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_az.ts b/src/dcc-update-plugin/translations/update_az.ts index 99b3e7567..9f70c747c 100644 --- a/src/dcc-update-plugin/translations/update_az.ts +++ b/src/dcc-update-plugin/translations/update_az.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_bo.ts b/src/dcc-update-plugin/translations/update_bo.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_bo.ts +++ b/src/dcc-update-plugin/translations/update_bo.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_ca.ts b/src/dcc-update-plugin/translations/update_ca.ts index 25411c2eb..ae82b659a 100644 --- a/src/dcc-update-plugin/translations/update_ca.ts +++ b/src/dcc-update-plugin/translations/update_ca.ts @@ -226,6 +226,25 @@ Les actualitzacions del sistema estan desactivades. Poseu-vos en contacte amb l'administrador per obtenir ajuda. + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. Els usuaris del fòrum de nivell 2 o superior poden unir-se a la prova beta per rebre les últimes actualitzacions. + + Collapse + Replega + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_de_DE.ts b/src/dcc-update-plugin/translations/update_de_DE.ts index 69cc9958d..f56b58113 100644 --- a/src/dcc-update-plugin/translations/update_de_DE.ts +++ b/src/dcc-update-plugin/translations/update_de_DE.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Einfahren + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_en.ts b/src/dcc-update-plugin/translations/update_en.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_en.ts +++ b/src/dcc-update-plugin/translations/update_en.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_en_US.ts b/src/dcc-update-plugin/translations/update_en_US.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_en_US.ts +++ b/src/dcc-update-plugin/translations/update_en_US.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_es.ts b/src/dcc-update-plugin/translations/update_es.ts index fd9fa4232..44a0111a5 100644 --- a/src/dcc-update-plugin/translations/update_es.ts +++ b/src/dcc-update-plugin/translations/update_es.ts @@ -226,6 +226,25 @@ Las actualizaciones del sistema están desactivadas. Póngase en contacto con su administrador para obtener ayuda. + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Contraer + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_et.ts b/src/dcc-update-plugin/translations/update_et.ts index 3e8bda546..7f18e55c7 100644 --- a/src/dcc-update-plugin/translations/update_et.ts +++ b/src/dcc-update-plugin/translations/update_et.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Puske + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_fi.ts b/src/dcc-update-plugin/translations/update_fi.ts index 74118f868..1eb89d142 100644 --- a/src/dcc-update-plugin/translations/update_fi.ts +++ b/src/dcc-update-plugin/translations/update_fi.ts @@ -226,6 +226,25 @@ Päivitykset ovat poistettu käytöstä. Pyydä apua järjestelmänvalvojaltasi. + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Tiivistetty + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_fr.ts b/src/dcc-update-plugin/translations/update_fr.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_fr.ts +++ b/src/dcc-update-plugin/translations/update_fr.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_gl_ES.ts b/src/dcc-update-plugin/translations/update_gl_ES.ts index e903bc166..43428390a 100644 --- a/src/dcc-update-plugin/translations/update_gl_ES.ts +++ b/src/dcc-update-plugin/translations/update_gl_ES.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -325,6 +344,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Colapsar + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_hu.ts b/src/dcc-update-plugin/translations/update_hu.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_hu.ts +++ b/src/dcc-update-plugin/translations/update_hu.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_it.ts b/src/dcc-update-plugin/translations/update_it.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_it.ts +++ b/src/dcc-update-plugin/translations/update_it.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_ja.ts b/src/dcc-update-plugin/translations/update_ja.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_ja.ts +++ b/src/dcc-update-plugin/translations/update_ja.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_kk.ts b/src/dcc-update-plugin/translations/update_kk.ts index 5b872298a..b06503cfd 100644 --- a/src/dcc-update-plugin/translations/update_kk.ts +++ b/src/dcc-update-plugin/translations/update_kk.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Жыртық + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_ko.ts b/src/dcc-update-plugin/translations/update_ko.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_ko.ts +++ b/src/dcc-update-plugin/translations/update_ko.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_lt.ts b/src/dcc-update-plugin/translations/update_lt.ts index bc3fc0a39..e59c3fc5f 100644 --- a/src/dcc-update-plugin/translations/update_lt.ts +++ b/src/dcc-update-plugin/translations/update_lt.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_nb_NO.ts b/src/dcc-update-plugin/translations/update_nb_NO.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_nb_NO.ts +++ b/src/dcc-update-plugin/translations/update_nb_NO.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_ne.ts b/src/dcc-update-plugin/translations/update_ne.ts index 80bac1e72..c4fe3ca3b 100644 --- a/src/dcc-update-plugin/translations/update_ne.ts +++ b/src/dcc-update-plugin/translations/update_ne.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + कुप्लेस + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_nl.ts b/src/dcc-update-plugin/translations/update_nl.ts index 97e022bba..795b28927 100644 --- a/src/dcc-update-plugin/translations/update_nl.ts +++ b/src/dcc-update-plugin/translations/update_nl.ts @@ -226,6 +226,25 @@ Systeemupdates zijn uitgeschakeld. Neem contact op met je systeembeheerder. + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Inklappen + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_pl.ts b/src/dcc-update-plugin/translations/update_pl.ts index 94f4cf0a4..cc1141c75 100644 --- a/src/dcc-update-plugin/translations/update_pl.ts +++ b/src/dcc-update-plugin/translations/update_pl.ts @@ -226,6 +226,25 @@ Aktualizacje systemowe są wyłączone. Skontaktuj się z administratorem, aby uzyskać pomoc + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Zwiń + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_pt_BR.ts b/src/dcc-update-plugin/translations/update_pt_BR.ts index f1ceca179..dc8f4b915 100644 --- a/src/dcc-update-plugin/translations/update_pt_BR.ts +++ b/src/dcc-update-plugin/translations/update_pt_BR.ts @@ -226,6 +226,25 @@ As atualizações do sistema estão desativadas. Por favor, entre em contato com o administrador para obter ajuda. + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. Os usuários com nível 2 ou superior no fórum podem participar do programa beta para testar as últimas atualizações. + + Collapse + Recolher + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_ru.ts b/src/dcc-update-plugin/translations/update_ru.ts index cb9f1ecfc..b29daafaa 100644 --- a/src/dcc-update-plugin/translations/update_ru.ts +++ b/src/dcc-update-plugin/translations/update_ru.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_sq.ts b/src/dcc-update-plugin/translations/update_sq.ts index f92959cbb..e3c8e83e8 100644 --- a/src/dcc-update-plugin/translations/update_sq.ts +++ b/src/dcc-update-plugin/translations/update_sq.ts @@ -226,6 +226,25 @@ Përditësimet e sistemit janë të çaktivizuara. Ju lutemi, për ndihmë, lidhuni me përgjegjësin tuaj + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. Përdorues forumi të nivelit 2 e më sipër mund të bëhen pjesë e testimeve beta, që të marrin përditësimet më të reja. + + Collapse + Palose + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_tr.ts b/src/dcc-update-plugin/translations/update_tr.ts index 2ece33675..306b0110f 100644 --- a/src/dcc-update-plugin/translations/update_tr.ts +++ b/src/dcc-update-plugin/translations/update_tr.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Daralt + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_uk.ts b/src/dcc-update-plugin/translations/update_uk.ts index 8d4ddfbfa..f304bc631 100644 --- a/src/dcc-update-plugin/translations/update_uk.ts +++ b/src/dcc-update-plugin/translations/update_uk.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Згорнути + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_vi.ts b/src/dcc-update-plugin/translations/update_vi.ts index 2d153b896..6a7658c72 100644 --- a/src/dcc-update-plugin/translations/update_vi.ts +++ b/src/dcc-update-plugin/translations/update_vi.ts @@ -226,6 +226,25 @@ + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. + + Collapse + Thu gọn + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_zh_CN.ts b/src/dcc-update-plugin/translations/update_zh_CN.ts index f1656b0bb..d0cbb377b 100644 --- a/src/dcc-update-plugin/translations/update_zh_CN.ts +++ b/src/dcc-update-plugin/translations/update_zh_CN.ts @@ -226,6 +226,25 @@ 系统已被禁止更新,请联系管理员! + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + 更新包已下载完毕,请选择您要执行的操作 + + + Silent Installation + 后台静默安装 + + + Update and Reboot + 更新并重启 + + + Update and Shut Down + 更新并关机 + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. 论坛2级及以上用户可加入内测,获取最新更新 + + Collapse + 收起 + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_zh_HK.ts b/src/dcc-update-plugin/translations/update_zh_HK.ts index 7e26d00d1..c6db0e09e 100644 --- a/src/dcc-update-plugin/translations/update_zh_HK.ts +++ b/src/dcc-update-plugin/translations/update_zh_HK.ts @@ -226,6 +226,25 @@ 系統已被禁止更新,請聯繫管理員! + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. 論壇2級及以上用户可加入內測,獲取最新更新 + + Collapse + 收起 + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dcc-update-plugin/translations/update_zh_TW.ts b/src/dcc-update-plugin/translations/update_zh_TW.ts index d796e3262..1a9284c9c 100644 --- a/src/dcc-update-plugin/translations/update_zh_TW.ts +++ b/src/dcc-update-plugin/translations/update_zh_TW.ts @@ -226,6 +226,25 @@ 系統已被禁止更新,請聯絡管理員! + + UpdateSelectDialog + + The updates have been already downloaded. What do you want to do? + + + + Silent Installation + + + + Update and Reboot + + + + Update and Shut Down + + + UpdateSetting @@ -324,6 +343,14 @@ Forum users at level 2 and above can join the beta test to receive the latest updates. 論壇2級及以上使用者可加入內測,獲取最新更新 + + Collapse + 收起 + + + Only numbers between 1-99999 are allowed + + UpdateWorker diff --git a/src/dde-update/img/deepin_logo.svg b/src/dde-update/img/deepin_logo.svg index 94a580f3f..89ce6d218 100644 --- a/src/dde-update/img/deepin_logo.svg +++ b/src/dde-update/img/deepin_logo.svg @@ -1,12 +1,10 @@ - - 编组 - - - - - - + + 画板 + + + + \ No newline at end of file diff --git a/src/dde-update/updatemodel.h b/src/dde-update/updatemodel.h index 672e669e5..b7beb11d4 100644 --- a/src/dde-update/updatemodel.h +++ b/src/dde-update/updatemodel.h @@ -112,6 +112,9 @@ enum CheckSystemStage { void setCheckSystemStage(CheckSystemStage stage) { m_checkSystemStage = stage; } CheckSystemStage checkSystemStage() const { return m_checkSystemStage; } + bool hasBackup() const { return m_hasBackup; } + void setHasBackup(bool hasBackup) { m_hasBackup = hasBackup; } + private: explicit UpdateModel(QObject *parent = nullptr); @@ -132,6 +135,7 @@ enum CheckSystemStage { bool m_isReboot; // true 更新并重启 false 更新并关机 int m_updateMode; // 更新类型 bool m_doUpgrade; // 是否进行更新操作 + bool m_hasBackup = false; // 是否有备份 CheckStatus m_checkStatus; CheckSystemStage m_checkSystemStage; diff --git a/src/dde-update/updatewidget.cpp b/src/dde-update/updatewidget.cpp index d31d7564c..ddeb3d2bf 100644 --- a/src/dde-update/updatewidget.cpp +++ b/src/dde-update/updatewidget.cpp @@ -22,7 +22,7 @@ DCORE_USE_NAMESPACE DWIDGET_USE_NAMESPACE -const int BACKUP_BEGIN_PROGRESS = 20; +const int BACKUP_BEGIN_PROGRESS = 0; const int BACKUP_END_PROGRESS = 50; UpdateLogWidget::UpdateLogWidget(QWidget *parent) @@ -115,7 +115,6 @@ UpdateProgressWidget::UpdateProgressWidget(QWidget *parent) , m_waitingView(new DPictureSequenceView(this)) , m_progressBar(new DProgressBar(this)) , m_progressText(new QLabel(this)) - , m_installBeginValue(0) { m_logo->setFixedSize(286, 57); if (DSysInfo::uosEditionType() == DSysInfo::UosCommunity) @@ -183,27 +182,13 @@ bool UpdateProgressWidget::event(QEvent *e) return false; } -void UpdateProgressWidget::setValue(double value) +void UpdateProgressWidget::setValue(int value) { - double tmpValue = value * (100 - m_installBeginValue); - // 在备份完成后,如果m_installBeginValue=50,那么value需要大于等于2进度条才会增加,等待时间过长,体验不好. - if (m_installBeginValue > 0 && tmpValue < 1 && tmpValue > 0) - tmpValue = 1.0; - - int iProgress = m_installBeginValue + static_cast(tmpValue); // 进度条不能大于100,不能小于0,不能回退 - if (iProgress > 100 || iProgress < 0 || iProgress <= m_progressBar->value()) + if (value > 100 || value < 0 || value <= m_progressBar->value()) return; qInfo() << "Update progress value: " << value; - m_progressBar->setValue(iProgress); - m_progressText->setText(QString::number(iProgress) + "%"); -} - -void UpdateProgressWidget::setInstallBeginValue(int value) -{ - m_installBeginValue = value; - m_progressBar->setValue(value); m_progressText->setText(QString::number(value) + "%"); } @@ -454,11 +439,9 @@ void UpdateWidget::onUpdateStatusChanged(UpdateModel::UpdateStatus status) break; case UpdateModel::UpdateStatus::BackingUp: m_stackedWidget->setCurrentWidget(m_progressWidget); - m_progressWidget->setInstallBeginValue(BACKUP_BEGIN_PROGRESS); break; case UpdateModel::UpdateStatus::BackupSuccess: m_stackedWidget->setCurrentWidget(m_progressWidget); - m_progressWidget->setInstallBeginValue(BACKUP_END_PROGRESS); break; case UpdateModel::UpdateStatus::Installing: setMouseCursorVisible(false); @@ -505,7 +488,7 @@ void UpdateWidget::initUi() void UpdateWidget::initConnections() { - connect(UpdateModel::instance(), &UpdateModel::JobProgressChanged, m_progressWidget, &UpdateProgressWidget::setValue); + connect(UpdateModel::instance(), &UpdateModel::JobProgressChanged, this, &UpdateWidget::onJobProgressChanged); connect(UpdateModel::instance(), &UpdateModel::updateStatusChanged, this, &UpdateWidget::onUpdateStatusChanged); connect(m_updateCompleteWidget, &UpdateCompleteWidget::requestShowLogWidget, this, &UpdateWidget::showLogWidget); connect(m_logWidget, &UpdateLogWidget::requestHideLogWidget, this, &UpdateWidget::hideLogWidget); @@ -559,3 +542,29 @@ void UpdateWidget::keyPressEvent(QKeyEvent *e) Q_UNUSED(e) // 屏蔽esc键,设置event的accept无效,暂时不处理 } + +void UpdateWidget::onJobProgressChanged(double value) +{ + qInfo() << "Job progress changed: " << value << "hasBackup: " << UpdateModel::instance()->hasBackup() << "updateStatus: " << UpdateModel::instance()->updateStatus(); + int progress = 0; + bool hasBackup = UpdateModel::instance()->hasBackup(); + if (hasBackup) { + if (UpdateModel::instance()->updateStatus() == UpdateModel::UpdateStatus::BackingUp) { + progress = BACKUP_BEGIN_PROGRESS + static_cast(value * (BACKUP_END_PROGRESS - BACKUP_BEGIN_PROGRESS)); + } else if (UpdateModel::instance()->updateStatus() == UpdateModel::UpdateStatus::BackupSuccess) { + progress = BACKUP_END_PROGRESS; + } else if (UpdateModel::instance()->updateStatus() == UpdateModel::UpdateStatus::Installing) { + progress = BACKUP_END_PROGRESS + static_cast(value * (100 - BACKUP_END_PROGRESS)); + } else if (UpdateModel::instance()->updateStatus() == UpdateModel::UpdateStatus::InstallSuccess) { + progress = 100; + } + } else { + if (UpdateModel::instance()->updateStatus() == UpdateModel::UpdateStatus::Installing) { + progress = value * 100; + } else if (UpdateModel::instance()->updateStatus() == UpdateModel::UpdateStatus::InstallSuccess) { + progress = 100; + } + } + + m_progressWidget->setValue(progress); +} diff --git a/src/dde-update/updatewidget.h b/src/dde-update/updatewidget.h index 4d8e576a5..06bef4373 100644 --- a/src/dde-update/updatewidget.h +++ b/src/dde-update/updatewidget.h @@ -61,8 +61,7 @@ class UpdateProgressWidget : public QFrame Q_OBJECT public: explicit UpdateProgressWidget(QWidget *parent = nullptr); - void setValue(double value); - void setInstallBeginValue(int value); + void setValue(int value); protected: bool event(QEvent *e) override; @@ -73,7 +72,6 @@ class UpdateProgressWidget : public QFrame Dtk::Widget::DPictureSequenceView *m_waitingView; Dtk::Widget::DProgressBar *m_progressBar; QLabel *m_progressText; - int m_installBeginValue; }; class UpdateCompleteWidget : public QFrame @@ -125,6 +123,7 @@ private slots: void onUpdateStatusChanged(UpdateModel::UpdateStatus status); void showLogWidget(); void hideLogWidget(); + void onJobProgressChanged(double value); private: explicit UpdateWidget(QWidget *parent = nullptr); diff --git a/src/dde-update/updateworker.cpp b/src/dde-update/updateworker.cpp index 0b68a565a..be0cf69f0 100644 --- a/src/dde-update/updateworker.cpp +++ b/src/dde-update/updateworker.cpp @@ -23,6 +23,8 @@ #include +Q_LOGGING_CATEGORY(DDE_UPDATE_WORKER, "dde-update-worker") + static const QList CAN_BE_FIXED_ERRORS = { UpdateModel::DpkgInterrupted }; UpdateWorker::UpdateWorker(QObject *parent) @@ -61,45 +63,6 @@ void UpdateWorker::init() } } }); -#if 0 // TODO - connect(m_abRecoveryInter, &RecoveryInter::JobEnd, this, [](const QString &kind, bool success, const QString &errMsg) { - qInfo() << "Backup job end, kind: " << kind << ", success: " << success << ", error message: " << errMsg; - if ("backup" != kind) { - qWarning() << "Kind error: " << kind; - return; - } - - if (success) { - UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::BackupSuccess); - } else { - UpdateModel::instance()->setLastErrorLog(errMsg); - UpdateModel::instance()->setUpdateError(UpdateModel::UpdateError::BackupFailedUnknownReason); - UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::BackupFailed); - } - }); - connect(m_abRecoveryInter, &RecoveryInter::BackingUpChanged, this, [](bool value) { - qInfo() << "Backing up changed: " << value; - if (value) { - UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::BackingUp); - } - }); - connect(m_abRecoveryInter, &RecoveryInter::ConfigValidChanged, this, [](bool value) { - qInfo() << "Backup config valid changed: " << value; - UpdateModel::instance()->setBackupConfigValidation(value); - }); - connect(m_abRecoveryInter, &RecoveryInter::serviceValidChanged, this, [](bool valid) { - if (!valid) { - const auto status = UpdateModel::instance()->updateStatus(); - qWarning() << "AB recovery service was invalid, current status: " << status; - if (status != UpdateModel::BackingUp) - return; - - UpdateModel::instance()->setLastErrorLog("AB recovery service was invalid."); - UpdateModel::instance()->setUpdateError(UpdateModel::UpdateError::BackupInterfaceError); - UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::BackupFailed); - } - }); -#endif getUpdateOption(); onJobListChanged(m_dbusProxy->jobList()); @@ -120,7 +83,7 @@ void UpdateWorker::doDistUpgrade(bool doBackup) { qInfo() << "Do dist upgrade, do backup: " << doBackup; if (!m_dbusProxy->managerInterIsValid()) { - UpdateModel::instance()->setLastErrorLog("com.deepin.lastore.Manager interface is invalid."); + UpdateModel::instance()->setLastErrorLog("org.deepin.dde.Lastore1.Manager interface is invalid."); UpdateModel::instance()->setUpdateError(UpdateModel::UpdateError::UpdateInterfaceError); UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::InstallFailed); return; @@ -132,13 +95,21 @@ void UpdateWorker::doDistUpgrade(bool doBackup) } cleanLaStoreJob(m_distUpgradeJob); + cleanLaStoreJob(m_backupJob); + UpdateModel::instance()->setHasBackup(doBackup); QDBusPendingReply reply = m_dbusProxy->DistUpgradePartly(UpdateModel::instance()->updateMode(), doBackup); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); - connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, reply, watcher] { + connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, reply, watcher, doBackup] { watcher->deleteLater(); if (reply.isValid()) { - UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::Installing); - createDistUpgradeJob(reply.value().path()); + if (doBackup) { + UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::BackingUp); + createBackupJob(reply.value().path()); + } else { + UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::Installing); + createDistUpgradeJob(reply.value().path()); + } + } else { const QString &errorMessage = watcher->error().message(); qWarning() << "Do dist upgrade failed:" << watcher->error().message(); @@ -170,6 +141,9 @@ void UpdateWorker::onJobListChanged(const QList &jobs) } else if (id == "check_system" && m_checkSystemJob == nullptr) { qInfo() << "Create check system job"; createCheckSystemJob(jobPath); + } else if (id == "backup" && m_backupJob == nullptr) { + qInfo() << "Create backup job"; + createBackupJob(jobPath); } } } @@ -219,6 +193,26 @@ void UpdateWorker::createCheckSystemJob(const QString& jobPath) onCheckSystemStatusChanged(m_checkSystemJob->status()); } +void UpdateWorker::createBackupJob(const QString& jobPath) +{ + qCInfo(DDE_UPDATE_WORKER) << "Create backup upgrade job, path:" << jobPath; + if (m_backupJob || jobPath.isEmpty()) { + qCInfo(DDE_UPDATE_WORKER) << "Job is not null or job path is empty"; + return; + } + + m_backupJob = new UpdateJobDBusProxy(jobPath, this); + connect(m_backupJob, &UpdateJobDBusProxy::ProgressChanged, UpdateModel::instance(), &UpdateModel::setJobProgress); + connect(m_backupJob, &UpdateJobDBusProxy::StatusChanged, this, &UpdateWorker::onBackupStatusChanged); + connect(m_backupJob, &UpdateJobDBusProxy::DescriptionChanged, this, [this](const QString &description) { + if (m_backupJob->status() == "failed") { + UpdateModel::instance()->setLastErrorLog(description); + } + }); + UpdateModel::instance()->setJobProgress(m_backupJob->progress()); + onBackupStatusChanged(m_backupJob->status()); +} + void UpdateWorker::onDistUpgradeStatusChanged(const QString &status) { // 无需处理ready状态 @@ -295,6 +289,17 @@ void UpdateWorker::onCheckSystemStatusChanged(const QString &status) } } +void UpdateWorker::onBackupStatusChanged(const QString &value) +{ + qCInfo(DDE_UPDATE_WORKER) << "backup status changed: " << value; + if (value == "failed") { + const auto& description = m_backupJob->description(); + UpdateModel::instance()->setLastErrorLog(description); + } else if (value == "end") { + cleanLaStoreJob(m_backupJob); + } +} + UpdateModel::UpdateError UpdateWorker::analyzeJobErrorMessage(QString jobDescription) { qInfo() << "Analyze job error message: " << jobDescription; @@ -323,39 +328,20 @@ UpdateModel::UpdateError UpdateWorker::analyzeJobErrorMessage(QString jobDescrip void UpdateWorker::doDistUpgradeIfCanBackup() { -#if 0 // TODO +// TODO 进入更新的接口 qInfo() << "Prepare to do backup"; - QDBusPendingCall call = m_abRecoveryInter->CanBackup(); - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this); - connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, call] { - if (!call.isError()) { - QDBusReply reply = call.reply(); - const bool value = reply.value(); - if (value) { - m_abRecoveryInter->setSync(true); - const bool hasBackedUp = m_abRecoveryInter->hasBackedUp(); - m_abRecoveryInter->setSync(false); - qInfo() << "Has backed up:" << hasBackedUp; - if (hasBackedUp) { - UpdateModel::instance()->setUpdateStatus(UpdateModel::BackupSuccess); - } else { - UpdateModel::instance()->setUpdateStatus(UpdateModel::BackingUp); - } - doDistUpgrade(true); - } else { - qWarning() << "Can not backup"; - UpdateModel::instance()->setLastErrorLog(reply.error().message()); - UpdateModel::instance()->setUpdateError(UpdateModel::CanNotBackup); - UpdateModel::instance()->setUpdateStatus(UpdateModel::BackupFailed); - } - } else { - qWarning() << "Call `CanBackup` failed"; - UpdateModel::instance()->setLastErrorLog("Call `CanBackup` method in dbus interface - com.deepin.ABRecovery failed"); - UpdateModel::instance()->setUpdateError(UpdateModel::UpdateInterfaceError); - UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::BackupFailed); - } - }); -#endif + // TODO: 暂未支持选择是否备份,之后会在社区版支持,现在默认备份 + bool needBackup = true; + // TODO: 磐石暂未实现当前能否备份的接口,当前默认支持 + bool canBackup = true; + if(canBackup) { + doDistUpgrade(needBackup); + } else { + qWarning() << "Can not backup"; + UpdateModel::instance()->setLastErrorLog(""); + UpdateModel::instance()->setUpdateError(UpdateModel::UpdateError::CanNotBackup); + UpdateModel::instance()->setUpdateStatus(UpdateModel::UpdateStatus::InstallFailed); + } } void UpdateWorker::doCheckSystem(int updateMode, UpdateModel::CheckSystemStage stage) diff --git a/src/dde-update/updateworker.h b/src/dde-update/updateworker.h index 1efc363a1..26415327b 100644 --- a/src/dde-update/updateworker.h +++ b/src/dde-update/updateworker.h @@ -58,6 +58,7 @@ class UpdateWorker : public QObject bool syncStartService(const QString &serviceName); void createDistUpgradeJob(const QString& jobPath); void createCheckSystemJob(const QString& jobPath); + void createBackupJob(const QString& jobPath); void cleanLaStoreJob(QPointer dbusJob); void getUpdateOption(); @@ -65,9 +66,11 @@ private slots: void onJobListChanged(const QList &jobs); void onDistUpgradeStatusChanged(const QString &status); void onCheckSystemStatusChanged(const QString &status); + void onBackupStatusChanged(const QString& value); private: QPointer m_distUpgradeJob; // 更新job + QPointer m_backupJob; // 备份job QPointer m_fixErrorJob; // 修复错误job QPointer m_checkSystemJob; // 修复错误job UpdateDBusProxy *m_dbusProxy;