GODT-1837: Fix restart.

GOTD-1837: added wait flag.
GODT-1837: strip --wait flag from launcher command-line.
GODT-1837: hide main window before restart.
This commit is contained in:
Xavier Michelon
2022-08-30 11:56:13 +02:00
parent 2780dc6a67
commit 8bb2a399cc
15 changed files with 237 additions and 67 deletions

View File

@ -229,6 +229,10 @@ void QMLBackend::restart()
app().grpc().quit();
}
//****************************************************************************************************************************************************
/// \param[in] launcher The path to the launcher.
//****************************************************************************************************************************************************
void QMLBackend::forceLauncher(QString launcher)
{
app().grpc().forceLauncher(launcher);
@ -270,8 +274,9 @@ void QMLBackend::changeColorScheme(QString const &scheme)
//****************************************************************************************************************************************************
void QMLBackend::toggleUseSSLforSMTP(bool makeItActive)
{
if (app().grpc().setUseSSLForSMTP(makeItActive).ok())
emit useSSLforSMTPChanged(makeItActive);
// if call succeed, app will restart. No need to emit a value change signal, because it will trigger a read-back via gRPC that will fail.
emit hideMainWindow();
app().grpc().setUseSSLForSMTP(makeItActive);
}
@ -281,11 +286,21 @@ void QMLBackend::toggleUseSSLforSMTP(bool makeItActive)
//****************************************************************************************************************************************************
void QMLBackend::changePorts(int imapPort, int smtpPort)
{
if (app().grpc().changePorts(imapPort, smtpPort).ok())
{
emit portIMAPChanged(imapPort);
emit portSMTPChanged(smtpPort);
}
// if call succeed, app will restart. No need to emit a value change signal, because it will trigger a read-back via gRPC that will fail.
emit hideMainWindow();
app().grpc().changePorts(imapPort, smtpPort);
}
//****************************************************************************************************************************************************
/// \param[in] enable Is cache enabled?
/// \param[in] path The path of the cache.
//****************************************************************************************************************************************************
void QMLBackend::changeLocalCache(bool enable, QUrl const &path)
{
// if call succeed, app will restart. No need to emit a value change signal, because it will trigger a read-back via gRPC that will fail.
emit hideMainWindow();
app().grpc().changeLocalCache(enable, path);
}
@ -353,3 +368,5 @@ void QMLBackend::onResetFinished()
emit resetFinished();
this->restart();
}