UI: Add info to "Restart Required" dialog

This commit is contained in:
Nodir Temirkhodjaev 2024-01-15 11:08:07 +03:00
parent f405c6d1f8
commit 8f8cf6043b
4 changed files with 7 additions and 7 deletions

View File

@ -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()

View File

@ -268,7 +268,7 @@ bool FortManager::installDriver()
if (IoC<FortSettings>()->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<FortSettings>()->isService()) {
qCDebug(LC) << "Restart required:" << info;
IoC<ServiceManager>()->restart();
} else {
IoC<WindowManager>()->processRestartRequired();
IoC<WindowManager>()->processRestartRequired(info);
}
}

View File

@ -27,7 +27,7 @@ public slots:
bool installDriver();
bool removeDriver();
void processRestartRequired();
void processRestartRequired(const QString &info = {});
static void setupPortableResource();
static void setupResources();

View File

@ -56,7 +56,7 @@ void DbErrorManager::checkDriveList()
if (m_driveMask == driveMask) {
// Restart on profile drive mounted
IoC<FortManager>()->processRestartRequired();
IoC<FortManager>()->processRestartRequired(tr("Profile's drive mounted"));
return;
}