mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:57:57 +00:00
UI: Refactor restart requesting
This commit is contained in:
parent
4878582b61
commit
26b67801c2
@ -425,12 +425,9 @@ void FortManager::processRestartRequired()
|
||||
auto settings = IoC<FortSettings>();
|
||||
|
||||
if (settings->isService()) {
|
||||
IoC<ServiceManager>()->restart();
|
||||
IoC<ServiceManager>()->processRestartRequired();
|
||||
} else {
|
||||
auto windowManager = IoC<WindowManager>();
|
||||
|
||||
windowManager->showConfirmBox(
|
||||
[=] { windowManager->restart(); }, tr("Restart Now?"), tr("Restart Required"));
|
||||
IoC<WindowManager>()->processRestartRequired();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,9 +129,11 @@ void ServiceManager::processControl(quint32 code, quint32 eventType)
|
||||
reportStatus(state);
|
||||
}
|
||||
|
||||
void ServiceManager::restart()
|
||||
void ServiceManager::processRestartRequired()
|
||||
{
|
||||
qCDebug(LC) << "Quit due required restart";
|
||||
|
||||
QCoreApplication::quit();
|
||||
|
||||
reportStatus(SERVICE_STOP_PENDING);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
|
||||
void processControl(quint32 code, quint32 eventType) override;
|
||||
|
||||
void restart();
|
||||
void processRestartRequired();
|
||||
|
||||
signals:
|
||||
void pauseRequested();
|
||||
|
@ -501,6 +501,11 @@ void WindowManager::restart()
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
|
||||
void WindowManager::processRestartRequired()
|
||||
{
|
||||
showConfirmBox([&] { restart(); }, tr("Restart Now?"), tr("Restart Required"));
|
||||
}
|
||||
|
||||
bool WindowManager::checkWindowPassword(WindowCode code)
|
||||
{
|
||||
return (WindowPasswordProtected & code) == 0 || checkPassword();
|
||||
|
@ -105,6 +105,7 @@ public slots:
|
||||
|
||||
void quit();
|
||||
void restart();
|
||||
void processRestartRequired();
|
||||
|
||||
bool checkWindowPassword(WindowCode code);
|
||||
bool checkPassword();
|
||||
|
Loading…
Reference in New Issue
Block a user