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()