Recommend using serial key when online activation fails #5020

This commit is contained in:
Jerry (Xinyu Hou) 2015-10-23 12:13:16 -07:00
parent 98385c06e9
commit 75adb5aa8d
2 changed files with 23 additions and 1 deletions

View File

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

View File

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