From bc768cbca3b17715465d241b415860b0535dc389 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 22 Oct 2015 16:31:46 -0700 Subject: [PATCH] Add serial key in app settings #4715 --- src/gui/src/AppConfig.cpp | 2 ++ src/gui/src/AppConfig.h | 3 +++ src/gui/src/SetupWizard.cpp | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp index f663a859..6bbf7323 100644 --- a/src/gui/src/AppConfig.cpp +++ b/src/gui/src/AppConfig.cpp @@ -132,6 +132,7 @@ void AppConfig::loadSettings() m_UserToken = settings().value("userToken", "").toString(); m_CryptoEnabled = settings().value("cryptoEnabled", false).toBool(); m_AutoHide = settings().value("autoHide", false).toBool(); + m_Serialkey = settings().value("serialKey", "").toString(); } void AppConfig::saveSettings() @@ -153,6 +154,7 @@ void AppConfig::saveSettings() settings().setValue("userToken", m_UserToken); settings().setValue("cryptoEnabled", m_CryptoEnabled); settings().setValue("autoHide", m_AutoHide); + settings().setValue("serialKey", m_Serialkey); } void AppConfig::setAutoConfig(bool autoConfig) diff --git a/src/gui/src/AppConfig.h b/src/gui/src/AppConfig.h index 9bdd2265..80de53f6 100644 --- a/src/gui/src/AppConfig.h +++ b/src/gui/src/AppConfig.h @@ -78,6 +78,8 @@ class AppConfig QString activateEmail() { return m_ActivateEmail; } void setUserToken(QString t) { m_UserToken = t; } QString userToken() { return m_UserToken; } + void setSerialKey(QString serial) { m_Serialkey = serial; } + QString serialKey() { return m_Serialkey; } QString synergysName() const { return m_SynergysName; } QString synergycName() const { return m_SynergycName; } @@ -129,6 +131,7 @@ class AppConfig QString m_UserToken; bool m_CryptoEnabled; bool m_AutoHide; + QString m_Serialkey; static const char m_SynergysName[]; static const char m_SynergycName[]; diff --git a/src/gui/src/SetupWizard.cpp b/src/gui/src/SetupWizard.cpp index 010290fd..365b16ac 100644 --- a/src/gui/src/SetupWizard.cpp +++ b/src/gui/src/SetupWizard.cpp @@ -60,6 +60,7 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) : AppConfig& appConfig = m_MainWindow.appConfig(); m_pLineEditEmail->setText(appConfig.activateEmail()); + m_pLineEditSerialKey->setText(appConfig.serialKey()); m_pLineEditSerialKey->setEnabled(false); @@ -108,7 +109,6 @@ bool SetupWizard::validateCurrentPage() return false; } else { - // plugin page no longer requires email and password // create subscription file in profile directory SubscriptionManager subscriptionManager; bool r = subscriptionManager.activateSerial(m_pLineEditSerialKey->text()); @@ -196,6 +196,11 @@ void SetupWizard::accept() appConfig.setEdition(m_Edition); } + if (m_pRadioButtonSubscription->isChecked()) + { + appConfig.setSerialKey(m_pLineEditSerialKey->text()); + } + m_MainWindow.setEdition(m_Edition); m_MainWindow.updateLocalFingerprint();