refactor: Gui control if the server first shown message is shown with its own setting
This commit is contained in:
parent
8e8ab25fd0
commit
df78f0757e
3 changed files with 9 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue