#5657 Raise activation dialog when trial expires
This commit is contained in:
parent
02c23905d6
commit
47913e57b8
|
@ -153,7 +153,7 @@ void AppConfig::loadSettings()
|
|||
QVariant elevateMode = settings().value("elevateModeEnum");
|
||||
if (!elevateMode.isValid()) {
|
||||
elevateMode = settings().value ("elevateMode",
|
||||
QVariant(static_cast<int>(defaultElevateMode)));
|
||||
QVariant(static_cast<int>(defaultElevateMode)));
|
||||
}
|
||||
m_ElevateMode = static_cast<ElevateMode>(elevateMode.toInt());
|
||||
m_AutoConfigPrompted = settings().value("autoConfigPrompted", false).toBool();
|
||||
|
@ -178,8 +178,8 @@ void AppConfig::saveSettings()
|
|||
settings().setValue("language", m_Language);
|
||||
settings().setValue("startedBefore", m_StartedBefore);
|
||||
settings().setValue("autoConfig", m_AutoConfig);
|
||||
// Refer to enum ElevateMode declaration for insight in to why this
|
||||
// flag is mapped this way
|
||||
// Refer to enum ElevateMode declaration for insight in to why this
|
||||
// flag is mapped this way
|
||||
settings().setValue("elevateMode", m_ElevateMode == ElevateAlways);
|
||||
settings().setValue("elevateModeEnum", static_cast<int>(m_ElevateMode));
|
||||
settings().setValue("autoConfigPrompted", m_AutoConfigPrompted);
|
||||
|
|
|
@ -104,9 +104,8 @@ class AppConfig: public QObject
|
|||
bool activationHasRun() const;
|
||||
AppConfig& activationHasRun(bool value);
|
||||
|
||||
void saveSettings();
|
||||
|
||||
protected:
|
||||
void saveSettings();;
|
||||
protected:
|
||||
QSettings& settings();
|
||||
void setScreenName(const QString& s);
|
||||
void setPort(int i);
|
||||
|
|
|
@ -448,7 +448,7 @@ void MainWindow::checkConnected(const QString& line)
|
|||
void MainWindow::checkLicense(const QString &line)
|
||||
{
|
||||
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_trialWidget->show();
|
||||
stopSynergy();
|
||||
m_AppConfig->activationHasRun(false);
|
||||
} else {
|
||||
this->m_trialWidget->hide();
|
||||
}
|
||||
|
@ -1440,7 +1442,10 @@ void MainWindow::bonjourInstallFinished()
|
|||
|
||||
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.exec();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue