diff --git a/doc/user/configuration.md b/doc/user/configuration.md index c13580648..6350eb2f1 100644 --- a/doc/user/configuration.md +++ b/doc/user/configuration.md @@ -105,6 +105,7 @@ This section contains options used by the GUI it will begin with `[gui]` | windowGeometry | QRect | Geometry of the window used to restore the window geometry after exiting the app | | showGenericClientFailureDialog | `true` or `false` | When `true` client connection errors will not show popup error messages [default: true] | | shownFirstConnectedMessage | `true` or `false` | When `true` GUI has shown the user the message for connecting the first time [default: false] | +| shownServerFirstStartMessage | `true` or `false` | When `true` GUI has shown the user the Deskflow server is now running message [default: false] | ### Log diff --git a/src/lib/common/Settings.h b/src/lib/common/Settings.h index 33235afcd..4cfe8e601 100644 --- a/src/lib/common/Settings.h +++ b/src/lib/common/Settings.h @@ -74,6 +74,7 @@ public: inline static const auto WindowGeometry = QStringLiteral("gui/windowGeometry"); inline static const auto ShowGenericClientFailureDialog = QStringLiteral("gui/showGenericClientFailureDialog"); inline static const auto ShownFirstConnectedMessage = QStringLiteral("gui/shownFirstConnectedMessage"); + inline static const auto ShownServerFirstStartMessage = QStringLiteral("gui/shownServerFirstStartMessage"); }; struct Log { @@ -213,6 +214,7 @@ private: , Settings::Gui::WindowGeometry , Settings::Gui::ShowGenericClientFailureDialog , Settings::Gui::ShownFirstConnectedMessage + , Settings::Gui::ShownServerFirstStartMessage , Settings::Security::Certificate , Settings::Security::CheckPeers , Settings::Security::KeySize @@ -225,6 +227,7 @@ private: inline static const QStringList m_defaultFalseValues = { Settings::Gui::Autohide , Settings::Gui::ShownFirstConnectedMessage + , Settings::Gui::ShownServerFirstStartMessage , Settings::Core::StartedBefore , Settings::Core::PreventSleep , Settings::Core::UseWlClipboard diff --git a/src/lib/gui/MainWindow.cpp b/src/lib/gui/MainWindow.cpp index 90d7515c4..3bbfeab0d 100644 --- a/src/lib/gui/MainWindow.cpp +++ b/src/lib/gui/MainWindow.cpp @@ -532,7 +532,6 @@ void MainWindow::updateModeControls(bool serverMode) // unrecognized client tries to connect. const auto startedBefore = Settings::value(Settings::Core::StartedBefore).toBool(); if (!startedBefore && !m_coreProcess.isStarted()) { - qDebug() << "auto-starting core server for first time"; m_coreProcess.start(); } } @@ -957,11 +956,14 @@ void MainWindow::coreProcessStateChanged(CoreProcessState state) { updateStatus(); - if (state == CoreProcessState::Started && !Settings::value(Settings::Core::StartedBefore).toBool()) { + if (state == CoreProcessState::Started) { qDebug() << "recording that core has started"; Settings::setValue(Settings::Core::StartedBefore, true); - if (m_coreProcess.mode() == CoreMode::Server) { + if (m_coreProcess.mode() == CoreMode::Server && + !Settings::value(Settings::Gui::ShownServerFirstStartMessage).toBool()) { + qDebug() << "starting core server for first time"; messages::showFirstServerStartMessage(this); + Settings::setValue(Settings::Gui::ShownServerFirstStartMessage, true); } }