#5657 Raise activation dialog when trial expires

This commit is contained in:
Andrew Nelless 2016-10-18 18:45:15 +01:00
parent 02c23905d6
commit 47913e57b8
3 changed files with 17 additions and 13 deletions

View File

@ -104,8 +104,7 @@ class AppConfig: public QObject
bool activationHasRun() const; bool activationHasRun() const;
AppConfig& activationHasRun(bool value); AppConfig& activationHasRun(bool value);
void saveSettings(); void saveSettings();;
protected: protected:
QSettings& settings(); QSettings& settings();
void setScreenName(const QString& s); void setScreenName(const QString& s);

View File

@ -448,7 +448,7 @@ void MainWindow::checkConnected(const QString& line)
void MainWindow::checkLicense(const QString &line) void MainWindow::checkLicense(const QString &line)
{ {
if (line.contains("trial has expired")) { if (line.contains("trial has expired")) {
m_LicenseManager->refresh(); m_LicenseManager->refresh(true);
} }
} }
@ -1096,6 +1096,8 @@ void MainWindow::endTrial(bool isExpired)
this->m_trialLabel->setText(expiredNotice); this->m_trialLabel->setText(expiredNotice);
this->m_trialWidget->show(); this->m_trialWidget->show();
stopSynergy();
m_AppConfig->activationHasRun(false);
} else { } else {
this->m_trialWidget->hide(); this->m_trialWidget->hide();
} }
@ -1440,7 +1442,10 @@ void MainWindow::bonjourInstallFinished()
void MainWindow::on_windowShown() void MainWindow::on_windowShown()
{ {
if (!m_AppConfig->activationHasRun() && (m_AppConfig->edition() == kUnregistered)) { time_t currentTime = ::time(0);
if (!m_AppConfig->activationHasRun()
&& ((m_AppConfig->edition() == kUnregistered) ||
(m_LicenseManager->serialKey().isExpired(currentTime)))) {
ActivationDialog activationDialog (this, appConfig(), licenseManager()); ActivationDialog activationDialog (this, appConfig(), licenseManager());
activationDialog.exec(); activationDialog.exec();
} }