#5707 Store and update last version uses in settings
This commit is contained in:
parent
b7e0473cb4
commit
906fd15b4a
|
@ -162,6 +162,7 @@ void AppConfig::loadSettings()
|
|||
m_CryptoEnabled = settings().value("cryptoEnabled", true).toBool();
|
||||
m_AutoHide = settings().value("autoHide", false).toBool();
|
||||
m_Serialkey = settings().value("serialKey", "").toString();
|
||||
m_lastVersion = settings().value("lastVersion", "Unknown").toString();
|
||||
m_LastExpiringWarningTime = settings().value("lastExpiringWarningTime", 0).toInt();
|
||||
m_ActivationHasRun = settings().value("activationHasRun", false).toBool();
|
||||
}
|
||||
|
@ -187,6 +188,7 @@ void AppConfig::saveSettings()
|
|||
settings().setValue("cryptoEnabled", m_CryptoEnabled);
|
||||
settings().setValue("autoHide", m_AutoHide);
|
||||
settings().setValue("serialKey", m_Serialkey);
|
||||
settings().setValue("lastVersion", m_lastVersion);
|
||||
settings().setValue("lastExpiringWarningTime", m_LastExpiringWarningTime);
|
||||
settings().setValue("activationHasRun", m_ActivationHasRun);
|
||||
settings().sync();
|
||||
|
@ -203,6 +205,15 @@ AppConfig& AppConfig::activationHasRun(bool value)
|
|||
return *this;
|
||||
}
|
||||
|
||||
QString AppConfig::lastVersion() const
|
||||
{
|
||||
return m_lastVersion;
|
||||
}
|
||||
|
||||
void AppConfig::setLastVersion(QString version) {
|
||||
m_lastVersion = version;
|
||||
}
|
||||
|
||||
QSettings &AppConfig::settings() { return *m_pSettings; }
|
||||
|
||||
void AppConfig::setScreenName(const QString &s) { m_ScreenName = s; }
|
||||
|
|
|
@ -104,7 +104,11 @@ class AppConfig: public QObject
|
|||
bool activationHasRun() const;
|
||||
AppConfig& activationHasRun(bool value);
|
||||
|
||||
void saveSettings();;
|
||||
QString lastVersion() const;
|
||||
|
||||
void saveSettings();
|
||||
void setLastVersion(QString version);
|
||||
|
||||
protected:
|
||||
QSettings& settings();
|
||||
void setScreenName(const QString& s);
|
||||
|
@ -139,6 +143,7 @@ protected:
|
|||
bool m_CryptoEnabled;
|
||||
bool m_AutoHide;
|
||||
QString m_Serialkey;
|
||||
QString m_lastVersion;
|
||||
int m_LastExpiringWarningTime;
|
||||
bool m_ActivationHasRun;
|
||||
|
||||
|
|
|
@ -156,6 +156,11 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig,
|
|||
|
||||
setWindowTitle (m_LicenseManager->activeEditionName());
|
||||
m_LicenseManager->refresh();
|
||||
|
||||
QString currentVersion = m_VersionChecker.getVersion();
|
||||
if (m_AppConfig->lastVersion() != currentVersion) {
|
||||
m_AppConfig->setLastVersion (currentVersion);
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
|
Loading…
Reference in New Issue