diff --git a/src/gui/src/SetupWizard.cpp b/src/gui/src/SetupWizard.cpp index 365b16ac..fd3d7172 100644 --- a/src/gui/src/SetupWizard.cpp +++ b/src/gui/src/SetupWizard.cpp @@ -28,7 +28,8 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) : m_MainWindow(mainWindow), m_StartMain(startMain), - m_Edition(Unknown) + m_Edition(Unknown), + m_LoginAttemps(0) { setupUi(this); m_pPluginPage = new PluginWizardPage(mainWindow); @@ -94,6 +95,21 @@ bool SetupWizard::validateCurrentPage() this); if (m_Edition == Unknown) { + m_LoginAttemps++; + if (m_LoginAttemps == kMaximiumLoginAttemps) { + m_LoginAttemps = 0; + + QMessageBox::StandardButton reply = + QMessageBox::information( + this, tr("Setup Synergy"), + tr("Would you like to use serial key to activate?"), + QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::Yes) { + m_pRadioButtonSubscription->setChecked(true); + } + } + return false; } else { diff --git a/src/gui/src/SetupWizard.h b/src/gui/src/SetupWizard.h index 9a4151bf..253ac97f 100644 --- a/src/gui/src/SetupWizard.h +++ b/src/gui/src/SetupWizard.h @@ -29,6 +29,11 @@ class MainWindow; class SetupWizard : public QWizard, public Ui::SetupWizardBase { Q_OBJECT +public: + enum { + kMaximiumLoginAttemps = 3 + }; + public: SetupWizard(MainWindow& mainWindow, bool startMain); virtual ~SetupWizard(); @@ -45,6 +50,7 @@ private: SynergyLocale m_Locale; int m_Edition; PluginWizardPage* m_pPluginPage; + int m_LoginAttemps; private slots: void on_m_pRadioButtonSubscription_toggled(bool checked);