From bcf2d5de0d97e4f053176ab63ab7dd84d2d413d9 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 30 Sep 2016 16:04:49 +0100 Subject: [PATCH] #5629 Trigger activation dialog if previously unseen --- src/gui/src/AppConfig.cpp | 13 +++++++++++++ src/gui/src/AppConfig.h | 4 ++++ src/gui/src/MainWindow.cpp | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp index 6347c6cf..60481930 100644 --- a/src/gui/src/AppConfig.cpp +++ b/src/gui/src/AppConfig.cpp @@ -163,6 +163,7 @@ void AppConfig::loadSettings() m_AutoHide = settings().value("autoHide", false).toBool(); m_Serialkey = settings().value("serialKey", "").toString(); m_LastExpiringWarningTime = settings().value("lastExpiringWarningTime", 0).toInt(); + m_ActivationHasRun = settings().value("activationHasRun", false).toBool(); } void AppConfig::saveSettings() @@ -188,6 +189,18 @@ void AppConfig::saveSettings() settings().setValue("autoHide", m_AutoHide); settings().setValue("serialKey", m_Serialkey); settings().setValue("lastExpiringWarningTime", m_LastExpiringWarningTime); + settings().setValue("activationHasRun", m_ActivationHasRun); +} + +bool AppConfig::activationHasRun() const +{ + return m_ActivationHasRun; +} + +AppConfig& AppConfig::activationHasRun(bool value) +{ + m_ActivationHasRun = value; + return *this; } QSettings &AppConfig::settings() { return *m_pSettings; } diff --git a/src/gui/src/AppConfig.h b/src/gui/src/AppConfig.h index df391bfb..a3dd0a11 100644 --- a/src/gui/src/AppConfig.h +++ b/src/gui/src/AppConfig.h @@ -100,6 +100,9 @@ class AppConfig void saveSettings(); + bool activationHasRun() const; + AppConfig& activationHasRun(bool value); + protected: QSettings& settings(); void setScreenName(const QString& s); @@ -136,6 +139,7 @@ class AppConfig bool m_AutoHide; QString m_Serialkey; int m_LastExpiringWarningTime; + bool m_ActivationHasRun; static const char m_SynergysName[]; static const char m_SynergycName[]; diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 15c20d12..f27777a1 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -139,6 +139,12 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : m_pLabelPadlock->hide(); updateLocalFingerprint(); + + if (!appConfig.activationHasRun() && (appConfig.edition() == Unregistered)) { + ActivationDialog activationDialog (this, appConfig); + activationDialog.exec(); + appConfig.activationHasRun(true); + } } MainWindow::~MainWindow()