Fixed lost updating of progressbar of GUI

This commit is contained in:
Gerhard Hoffmann 2023-11-07 11:43:26 +01:00
parent 903d0206a5
commit c1cfca79d2

View File

@ -320,6 +320,7 @@ void Worker::privateUpdate() {
}
}
CONSOLE() << UPDATE_STEP::CHECK_REPOSITORY_SUCCESS;
setProgress(_CHECKOUT_REPOSITORY_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -342,6 +343,7 @@ void Worker::privateUpdate() {
return;
}
GUI() << (ISMAS() << (CONSOLE() << UPDATE_STEP::CHECK_ISMAS_TRIGGER_SUCCESS));
setProgress(_CHECK_ISMAS_TRIGGER_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -353,6 +355,7 @@ void Worker::privateUpdate() {
return;
}
CONSOLE() << UPDATE_STEP::CHECKOUT_BRANCH_SUCCESS;
setProgress(_CHECKOUT_BRANCH_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -364,6 +367,7 @@ void Worker::privateUpdate() {
return;
}
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_REPOSITORY_SUCCESS));
setProgress(_UPDATE_REPOSITORY_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -375,6 +379,7 @@ void Worker::privateUpdate() {
return;
}
GUI() << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_SUCCESS);
setProgress(_EXEC_OPKG_COMMAND_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -386,6 +391,7 @@ void Worker::privateUpdate() {
return;
}
GUI() << (CONSOLE() << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE_SUCCESS);
setProgress(_DOWNLOAD_FILES_TO_PSA_HARDWARE_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -397,6 +403,7 @@ void Worker::privateUpdate() {
return;
}
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY_SUCCESS));
setProgress(_SYNC_CUSTOMER_REPOSITORY_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -408,6 +415,7 @@ void Worker::privateUpdate() {
return;
}
// ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::SAVE_LOGS_SUCCESS));
setProgress(_SAVE_LOGS_SUCCESS);
////////////////////////////////////////////////////////////////////////////
@ -416,8 +424,13 @@ void Worker::privateUpdate() {
//
////////////////////////////////////////////////////////////////////////////
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_SUCCEEDED));
setProgress(_UPDATE_SUCCEEDED);
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_ACTIVATED));
setProgress(_UPDATE_ACTIVATED);
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::FINISHED));
setProgress(_FINISHED);
////////////////////////////////////////////////////////////////////////////
@ -632,6 +645,7 @@ bool Worker::filesToUpdate() {
}
m_filesToUpdate.removeDuplicates();
GUI(m_filesToUpdate) << (CONSOLE(m_filesToUpdate) << UPDATE_STEP::FILES_TO_UPDATE);
setProgress(_FILES_TO_UPDATE);
} else {
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::UPDATE_REPOSITORY_FAILURE));
return false;
@ -693,33 +707,43 @@ bool Worker::execOpkgCommands() {
switch(m_opkgCommands.size()) {
case 1:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_1));
setProgress(_EXEC_OPKG_COMMAND_1);
break;
case 2:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_2));
setProgress(_EXEC_OPKG_COMMAND_2);
break;
case 3:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_3));
setProgress(_EXEC_OPKG_COMMAND_3);
break;
case 4:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_4));
setProgress(_EXEC_OPKG_COMMAND_4);
break;
case 5:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_5));
setProgress(_EXEC_OPKG_COMMAND_5);
break;
case 6:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_6));
setProgress(_EXEC_OPKG_COMMAND_6);
break;
case 7:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_7));
setProgress(_EXEC_OPKG_COMMAND_7);
break;
case 8:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_8));
setProgress(_EXEC_OPKG_COMMAND_8);
break;
case 9:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_9));
setProgress(_EXEC_OPKG_COMMAND_9);
break;
default:
ISMAS(opkgLst) << (GUI(cmdLst) << (CONSOLE() << UPDATE_STEP::EXEC_OPKG_COMMAND_LAST));
setProgress(_EXEC_OPKG_COMMAND_LAST);
}
}
}
@ -729,10 +753,12 @@ bool Worker::execOpkgCommands() {
if (m_opkgCommands.size() > 0) {
m_displayIndex = 1;
GUI() << UPDATE_STEP::EXEC_OPKG_COMMAND_SUCCESS;
setProgress(_EXEC_OPKG_COMMAND_SUCCESS);
}
} else {
m_displayIndex = 1;
GUI() << UPDATE_STEP::EXEC_OPKG_COMMAND_FAILURE;
setProgress(_EXEC_OPKG_COMMAND_FAILURE);
return false;
}
}
@ -747,6 +773,7 @@ bool Worker::downloadFilesToPSAHardware() {
m_displayIndex = 0;
GUI(m_filesToUpdate) << (CONSOLE(m_filesToUpdate) << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE);
setProgress(_DOWNLOAD_FILES_TO_PSA_HARDWARE);
if (m_noUpdatePsaHardware == false) {
if (computeFilesToDownload()) {
@ -763,6 +790,7 @@ bool Worker::downloadFilesToPSAHardware() {
return update.doUpdate(m_displayIndex, m_filesToDownload);
} else {
CONSOLE(QStringList("NO FILES TO DOWNLOAD TO PSA-HW")) << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE_FAILURE;
setProgress(_DOWNLOAD_FILES_TO_PSA_HARDWARE_FAILURE);
}
}
@ -843,12 +871,14 @@ bool Worker::syncCustomerRepositoryAndFS() {
QDir dir2("/etc/psa_tariff");
if (Utils::sameFilesInDirs(dir1, dir2)) {
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY_SUCCESS));
setProgress(_SYNC_CUSTOMER_REPOSITORY_SUCCESS);
return true;
}
}
}
}
ISMAS() << (GUI() << (CONSOLE() << UPDATE_STEP::SYNC_CUSTOMER_REPOSITORY_FAILURE));
setProgress(_SYNC_CUSTOMER_REPOSITORY_FAILURE);
return false;
}