#5629 Show activation dialog only after main window

This commit is contained in:
Andrew Nelless 2016-10-03 17:23:10 +01:00 committed by Andrew Nelless
parent 176d7e4725
commit 15a6a27dc6
4 changed files with 13 additions and 8 deletions

View File

@ -152,6 +152,7 @@ void ActivationDialog::accept()
}
m_appConfig->setEdition(edition);
m_appConfig->activationHasRun(true);
m_appConfig->saveSettings();
message.information (this, "Activated!",
@ -159,7 +160,7 @@ void ActivationDialog::accept()
MainWindow& mainWindow = dynamic_cast<MainWindow&>(*this->parent());
mainWindow.setEdition(edition);
mainWindow.updateLocalFingerprint();
mainWindow.settings().sync();
mainWindow.saveSettings();
QDialog::accept();
}

View File

@ -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()

View File

@ -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;

View File

@ -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();
}
}