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()->processRestartRequired(tr("Windows Service installation changed"));
fortManager(), &FortManager::processRestartRequired, Qt::QueuedConnection);
} }
void OptionsPage::onRetranslateUi() void OptionsPage::onRetranslateUi()

View File

@ -268,7 +268,7 @@ bool FortManager::installDriver()
if (IoC<FortSettings>()->hasService()) { if (IoC<FortSettings>()->hasService()) {
// Re-install the service and app restart required to continue // Re-install the service and app restart required to continue
StartupUtil::setServiceInstalled(true); StartupUtil::setServiceInstalled(true);
processRestartRequired(); processRestartRequired(tr("Driver reinstalled"));
} else { } else {
// Re-open the driver device and initialize it // Re-open the driver device and initialize it
if (setupDriver()) { if (setupDriver()) {
@ -403,12 +403,13 @@ void FortManager::setupServiceInfoManager()
&ConfManager::updateDriverServices); &ConfManager::updateDriverServices);
} }
void FortManager::processRestartRequired() void FortManager::processRestartRequired(const QString &info)
{ {
if (IoC<FortSettings>()->isService()) { if (IoC<FortSettings>()->isService()) {
qCDebug(LC) << "Restart required:" << info;
IoC<ServiceManager>()->restart(); IoC<ServiceManager>()->restart();
} else { } else {
IoC<WindowManager>()->processRestartRequired(); IoC<WindowManager>()->processRestartRequired(info);
} }
} }

View File

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

View File

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