#5657 Stop service and refresh license when trial expires
This commit is contained in:
parent
b66043e000
commit
492df1f3fd
|
@ -89,10 +89,13 @@ LicenseManager::serialKey() const
|
|||
return m_serialKey;
|
||||
}
|
||||
|
||||
void LicenseManager::refresh(bool acceptExpired)
|
||||
void LicenseManager::refresh()
|
||||
{
|
||||
if (!m_AppConfig->serialKey().isEmpty()) {
|
||||
setSerialKey(m_AppConfig->serialKey(), acceptExpired);
|
||||
setSerialKey(m_AppConfig->serialKey(), true);
|
||||
}
|
||||
if (m_serialKey.isExpired(::time(0))) {
|
||||
emit endTrial(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class LicenseManager: public QObject
|
|||
public:
|
||||
LicenseManager(AppConfig* appConfig);
|
||||
std::pair<bool, QString> setSerialKey(QString serialKey, bool acceptExpired = false);
|
||||
void refresh(bool acceptExpired = false);
|
||||
void refresh();
|
||||
Edition activeEdition() const;
|
||||
QString activeEditionName() const;
|
||||
SerialKey serialKey() const;
|
||||
|
|
|
@ -156,7 +156,7 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig,
|
|||
this, SLOT(sslToggled(bool)), Qt::QueuedConnection);
|
||||
|
||||
setWindowTitle (m_LicenseManager->activeEditionName());
|
||||
m_LicenseManager->refresh(true);
|
||||
m_LicenseManager->refresh();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -451,6 +451,7 @@ void MainWindow::checkConnected(const QString& line)
|
|||
void MainWindow::checkLicense(const QString &line)
|
||||
{
|
||||
if (line.contains("trial has expired")) {
|
||||
licenseManager().refresh();
|
||||
raiseActivationDialog();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue