Permalink
Browse files
#5629 Show activation dialog only after main window
- Loading branch information...
|
|
@@ -152,14 +152,15 @@ void ActivationDialog::accept() |
|
|
}
|
|
|
|
|
|
m_appConfig->setEdition(edition);
|
|
|
+ m_appConfig->activationHasRun(true);
|
|
|
m_appConfig->saveSettings();
|
|
|
|
|
|
message.information (this, "Activated!",
|
|
|
tr("Thanks for activating %1!").arg (getEditionName (edition)));
|
|
|
MainWindow& mainWindow = dynamic_cast<MainWindow&>(*this->parent());
|
|
|
mainWindow.setEdition(edition);
|
|
|
mainWindow.updateLocalFingerprint();
|
|
|
- mainWindow.settings().sync();
|
|
|
+ mainWindow.saveSettings();
|
|
|
|
|
|
QDialog::accept();
|
|
|
}
|
|
|
@@ -139,19 +139,20 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) : |
|
|
|
|
|
m_pLabelPadlock->hide();
|
|
|
|
|
|
- if (!appConfig.activationHasRun() && (appConfig.edition() == Unregistered)) {
|
|
|
- ActivationDialog activationDialog (this, appConfig);
|
|
|
- activationDialog.exec();
|
|
|
- appConfig.activationHasRun(true);
|
|
|
- }
|
|
|
-
|
|
|
if (appConfig.getCryptoEnabled()) {
|
|
|
m_pSslCertificate = new SslCertificate(this);
|
|
|
m_pSslCertificate->generateCertificate();
|
|
|
}
|
|
|
|
|
|
updateLocalFingerprint();
|
|
|
- appConfig.saveSettings();
|
|
|
+}
|
|
|
+
|
|
|
+void
|
|
|
+MainWindow::showEvent(QShowEvent*) {
|
|
|
+ if (!m_AppConfig.activationHasRun() && (m_AppConfig.edition() == Unregistered)) {
|
|
|
+ ActivationDialog activationDialog (this, m_AppConfig);
|
|
|
+ activationDialog.exec();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
|
|
@@ -66,6 +66,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase |
|
|
friend class QSynergyApplication;
|
|
|
friend class SetupWizard;
|
|
|
friend class ActivationDialog;
|
|
|
+ friend class SettingsDialog;
|
|
|
|
|
|
public:
|
|
|
enum qSynergyState
|
|
|
@@ -181,6 +182,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase |
|
|
void restartSynergy();
|
|
|
void proofreadInfo();
|
|
|
|
|
|
+ void showEvent(QShowEvent *event);
|
|
|
private:
|
|
|
QSettings& m_Settings;
|
|
|
AppConfig& m_AppConfig;
|
|
|
|
|
|
@@ -151,5 +151,6 @@ void SettingsDialog::on_m_pCheckBoxEnableCrypto_toggled(bool checked) |
|
|
sslCertificate.generateCertificate();
|
|
|
MainWindow& mainWindow = dynamic_cast<MainWindow&> (*this->parent());
|
|
|
mainWindow.updateLocalFingerprint();
|
|
|
+ mainWindow.saveSettings();
|
|
|
}
|
|
|
}
|
0 comments on commit
15a6a27