Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/dcc-update-plugin/operation/updatework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,13 @@ void UpdateWorker::setDownloadJob(const QString& jobPath)

void UpdateWorker::doUpgrade(int updateTypes, bool doBackup)
{
if (!m_model->batterIsOK()) {
notifyInfo(tr("Update"), tr("Please plug in and then install updates."));
return;
}

emit startDoUpgrade();

qCInfo(DCC_UPDATE_WORKER) << "Do upgrade, update types:" << updateTypes << ", whether do backup:" << doBackup;
cleanLaStoreJob(m_distUpgradeJob);
cleanLaStoreJob(m_backupJob);
Expand Down Expand Up @@ -700,6 +707,11 @@ void UpdateWorker::reStart()

void UpdateWorker::modalUpgrade(bool rebootAfterUpgrade)
{
if (!m_model->batterIsOK()) {
notifyInfo(tr("Update"), tr("Please plug in and then install updates."));
return;
}

qCInfo(DCC_UPDATE_WORKER) << "request modal upgrade, reboot after upgrade:" << rebootAfterUpgrade;
if (rebootAfterUpgrade) {
m_updateInter->UpdateAndReboot();
Expand Down
1 change: 1 addition & 0 deletions src/dcc-update-plugin/operation/updatework.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public Q_SLOTS:
Q_SIGNALS:
void systemActivationChanged(bool systemActivation);
void requestCloseTestingChannel();
void startDoUpgrade();

private:
Dtk::Core::DConfig *m_lastoreDConfig;
Expand Down
8 changes: 7 additions & 1 deletion src/dcc-update-plugin/qml/updateMain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ DccObject {
visible: false
onSilentBtnClicked: {
dccData.work().doUpgrade(updateType, true)
close()
}
onUpgradeRebootBtnClicked: {
dccData.work().modalUpgrade(true)
Expand All @@ -302,6 +301,13 @@ DccObject {
dccData.work().modalUpgrade(false)
}
}

Connections {
target: dccData.work()
function onStartDoUpgrade() {
updateSelectDialog.close()
}
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_az.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_bo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
10 changes: 8 additions & 2 deletions src/dcc-update-plugin/translations/update_ca.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ca">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ca">
<context>
<name>CheckUpdate</name>
<message>
Expand Down Expand Up @@ -410,6 +412,10 @@
<source>Update</source>
<translation>Actualitza</translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down Expand Up @@ -525,4 +531,4 @@
<translation>La capacitat de la bateria és inferior al 60%. Per obtenir actualitzacions correctes, endolleu el dispositiu.</translation>
</message>
</context>
</TS>
</TS>
38 changes: 22 additions & 16 deletions src/dcc-update-plugin/translations/update_de_DE.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="de_DE">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<context>
<name>CheckUpdate</name>
<message>
Expand All @@ -25,7 +27,7 @@
<name>UpdateControl</name>
<message>
<source>View Update Log</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -75,22 +77,22 @@
</message>
<message>
<source>Version:</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateLogDialog</name>
<message>
<source>Update Log</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>Export to desktop</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -247,26 +249,26 @@
</message>
<message>
<source>The system has enabled auto recovery function and does not support updates. If you have any questions, please contact the enterprise administrator</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateSelectDialog</name>
<message>
<source>The updates have been already downloaded. What do you want to do?</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>Silent Installation</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>Update and Reboot</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>Update and Shut Down</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -369,11 +371,11 @@
</message>
<message>
<source>Collapse</source>
<translation type="unfinished"/>
<translation type="unfinished">Einfahren</translation>
</message>
<message>
<source>Only numbers between 1-99999 are allowed</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand All @@ -400,16 +402,20 @@
</message>
<message>
<source>Log export failed, please try again</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>The log has been exported to the desktop</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>Update</source>
<translation>Aktualisieren</translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down Expand Up @@ -525,4 +531,4 @@
<translation>Der Akku ist unter 60%. Um die Aktualisierung erfolgreich durchführen zu können schließen Sie bitte den Rechner ans Stromnetz an.</translation>
</message>
</context>
</TS>
</TS>
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
10 changes: 8 additions & 2 deletions src/dcc-update-plugin/translations/update_es.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="es">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="es">
<context>
<name>CheckUpdate</name>
<message>
Expand Down Expand Up @@ -410,6 +412,10 @@
<source>Update</source>
<translation>Actualizar</translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down Expand Up @@ -525,4 +531,4 @@
<translation>La capacidad de la batería es inferior al 60%. Para obtener actualizaciones exitosas, conéctese.</translation>
</message>
</context>
</TS>
</TS>
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
10 changes: 8 additions & 2 deletions src/dcc-update-plugin/translations/update_fi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="fi">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fi">
<context>
<name>CheckUpdate</name>
<message>
Expand Down Expand Up @@ -410,6 +412,10 @@
<source>Update</source>
<translation>Päivitä</translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down Expand Up @@ -525,4 +531,4 @@
<translation>Akun kapasiteetti on alle 60%. Liitä kone sähköverkkoon päivityksen ajaksi.</translation>
</message>
</context>
</TS>
</TS>
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_gl_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_hu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
4 changes: 4 additions & 0 deletions src/dcc-update-plugin/translations/update_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@
<source>Update</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down
10 changes: 8 additions & 2 deletions src/dcc-update-plugin/translations/update_ja.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ja">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja">
<context>
<name>CheckUpdate</name>
<message>
Expand Down Expand Up @@ -410,6 +412,10 @@
<source>Update</source>
<translation>アップデート</translation>
</message>
<message>
<source>Please plug in and then install updates.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>update</name>
Expand Down Expand Up @@ -525,4 +531,4 @@
<translation>バッテリー残量が60%以下です。正常にアップデートを実行するため、電源に接続してください。</translation>
</message>
</context>
</TS>
</TS>
Loading