diff --git a/src/ui/form/opt/pages/optionspage.cpp b/src/ui/form/opt/pages/optionspage.cpp index a2de3a62..a6a51488 100644 --- a/src/ui/form/opt/pages/optionspage.cpp +++ b/src/ui/form/opt/pages/optionspage.cpp @@ -125,8 +125,7 @@ void OptionsPage::saveService(bool isService) }); } - QMetaObject::invokeMethod( - fortManager(), &FortManager::processRestartRequired, Qt::QueuedConnection); + fortManager()->processRestartRequired(tr("Windows Service installation changed")); } void OptionsPage::onRetranslateUi() diff --git a/src/ui/fortmanager.cpp b/src/ui/fortmanager.cpp index d6fc055d..0af199dc 100644 --- a/src/ui/fortmanager.cpp +++ b/src/ui/fortmanager.cpp @@ -268,7 +268,7 @@ bool FortManager::installDriver() if (IoC()->hasService()) { // Re-install the service and app restart required to continue StartupUtil::setServiceInstalled(true); - processRestartRequired(); + processRestartRequired(tr("Driver reinstalled")); } else { // Re-open the driver device and initialize it if (setupDriver()) { @@ -403,12 +403,13 @@ void FortManager::setupServiceInfoManager() &ConfManager::updateDriverServices); } -void FortManager::processRestartRequired() +void FortManager::processRestartRequired(const QString &info) { if (IoC()->isService()) { + qCDebug(LC) << "Restart required:" << info; IoC()->restart(); } else { - IoC()->processRestartRequired(); + IoC()->processRestartRequired(info); } } diff --git a/src/ui/fortmanager.h b/src/ui/fortmanager.h index dd8e674b..775f11b1 100644 --- a/src/ui/fortmanager.h +++ b/src/ui/fortmanager.h @@ -27,7 +27,7 @@ public slots: bool installDriver(); bool removeDriver(); - void processRestartRequired(); + void processRestartRequired(const QString &info = {}); static void setupPortableResource(); static void setupResources(); diff --git a/src/ui/manager/dberrormanager.cpp b/src/ui/manager/dberrormanager.cpp index 7b5ef04c..ef158d58 100644 --- a/src/ui/manager/dberrormanager.cpp +++ b/src/ui/manager/dberrormanager.cpp @@ -56,7 +56,7 @@ void DbErrorManager::checkDriveList() if (m_driveMask == driveMask) { // Restart on profile drive mounted - IoC()->processRestartRequired(); + IoC()->processRestartRequired(tr("Profile's drive mounted")); return; }