diff --git a/src/gui/res/SetupWizardBase.ui b/src/gui/res/SetupWizardBase.ui index 6788a3d5..8c089886 100644 --- a/src/gui/res/SetupWizardBase.ui +++ b/src/gui/res/SetupWizardBase.ui @@ -120,214 +120,6 @@ - - - Activate - - - - - - Enable your <a href="http://symless.com/pricing?source=gui">Synergy Pro</a> and Synergy Basic features. - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - 75 - true - - - - &Account login - - - true - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - 20 - - - 10 - - - - - Email: - - - - - - - - 0 - 0 - - - - - 200 - 20 - - - - QLineEdit::Normal - - - - - - - Password: - - - - - - - - 0 - 0 - - - - - 200 - 20 - - - - QLineEdit::Password - - - - - - - <a href="https://symless.com/account/reset/?source=gui">Forgot password</a> - - - true - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - 75 - true - - - - &Serial key - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - S&kip activation - - - - - - - color: rgb(100, 100, 100); - - - You will see UNREGISTERED in the window title (not recommended). - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 500 - - - - - - diff --git a/src/gui/src/SetupWizard.cpp b/src/gui/src/SetupWizard.cpp index 6a28c2f8..a9dab840 100644 --- a/src/gui/src/SetupWizard.cpp +++ b/src/gui/src/SetupWizard.cpp @@ -57,13 +57,6 @@ SetupWizard::SetupWizard(MainWindow& mainWindow, bool startMain) : m_Locale.fillLanguageComboBox(m_pComboLanguage); setIndexFromItemData(m_pComboLanguage, m_MainWindow.appConfig().language()); - AppConfig& appConfig = m_MainWindow.appConfig(); - - m_pLineEditEmail->setText(appConfig.activateEmail()); - m_pTextEditSerialKey->setText(appConfig.serialKey()); - - m_pTextEditSerialKey->setEnabled(false); - } SetupWizard::~SetupWizard() @@ -76,67 +69,6 @@ bool SetupWizard::validateCurrentPage() message.setWindowTitle(tr("Setup Synergy")); message.setIcon(QMessageBox::Information); - /*if (currentPage() == m_pActivatePage) - { - if (m_pRadioButtonActivate->isChecked()) { - if (m_pLineEditEmail->text().isEmpty() || - m_pLineEditPassword->text().isEmpty()) { - message.setText(tr("Please enter your email address and password.")); - message.exec(); - return false; - } - else { - WebClient webClient; - m_Edition = webClient.getEdition( - m_pLineEditEmail->text(), - m_pLineEditPassword->text(), - message, - 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 your serial key instead?"), - QMessageBox::Yes | QMessageBox::No); - - if (reply == QMessageBox::Yes) { - m_pRadioButtonSubscription->setChecked(true); - } - } - - return false; - } - else { - return true; - } - } - } - else if (m_pRadioButtonSubscription->isChecked()) { - if (m_pTextEditSerialKey->toPlainText().isEmpty()) { - message.setText(tr("Please enter your subscription serial key.")); - message.exec(); - return false; - } - else { - // create subscription file in profile directory - SubscriptionManager subscriptionManager(this, m_MainWindow.appConfig(), m_Edition); - if (!subscriptionManager.activateSerial(m_pTextEditSerialKey->toPlainText())) { - return false; - } - - return true; - } - } - else { - return true; - } - } - else */ if (currentPage() == m_pNodePage) { bool result = m_pClientRadioButton->isChecked() || @@ -194,31 +126,6 @@ void SetupWizard::accept() settings.setValue("groupServerChecked", false); } - if (m_pRadioButtonActivate->isChecked()) { - appConfig.setActivateEmail(m_pLineEditEmail->text()); - - notifyActivation("login:" + m_pLineEditEmail->text()); - } - - if (m_pRadioButtonSubscription->isChecked()) - { - //appConfig.setSerialKey(m_pTextEditSerialKey->toPlainText()); - - notifyActivation("serial:" + m_pTextEditSerialKey->toPlainText()); - } - - if (m_pRadioButtonSkip->isChecked()) - { - notifyActivation("skip:unknown"); - } - - appConfig.setEdition(m_Edition); - m_MainWindow.setEdition(m_Edition); - m_MainWindow.updateLocalFingerprint(); - - appConfig.saveSettings(); - settings.sync(); - QWizard::accept(); if (m_StartMain) @@ -238,56 +145,11 @@ void SetupWizard::reject() m_MainWindow.open(); } - // treat cancel as skip - notifyActivation("skip:unknown"); - QWizard::reject(); } -void SetupWizard::notifyActivation(QString identity) -{ - ActivationNotifier* notifier = new ActivationNotifier(); - notifier->setIdentity(identity); - QThread* thread = new QThread; - connect(notifier, SIGNAL(finished()), thread, SLOT(quit())); - connect(notifier, SIGNAL(finished()), notifier, SLOT(deleteLater())); - connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); - - notifier->moveToThread(thread); - thread->start(); - - QMetaObject::invokeMethod(notifier, "notify", Qt::QueuedConnection); -} - void SetupWizard::on_m_pComboLanguage_currentIndexChanged(int index) { QString ietfCode = m_pComboLanguage->itemData(index).toString(); QSynergyApplication::getInstance()->switchTranslator(ietfCode); } - -void SetupWizard::on_m_pRadioButtonSkip_toggled(bool checked) -{ - if (checked) { - m_pLineEditEmail->setEnabled(false); - m_pLineEditPassword->setEnabled(false); - m_pTextEditSerialKey->setEnabled(false); - } -} - -void SetupWizard::on_m_pRadioButtonActivate_toggled(bool checked) -{ - if (checked) { - m_pLineEditEmail->setEnabled(true); - m_pLineEditPassword->setEnabled(true); - m_pTextEditSerialKey->setEnabled(false); - } -} - -void SetupWizard::on_m_pRadioButtonSubscription_toggled(bool checked) -{ - if (checked) { - m_pLineEditEmail->setEnabled(false); - m_pLineEditPassword->setEnabled(false); - m_pTextEditSerialKey->setEnabled(true); - } -} diff --git a/src/gui/src/SetupWizard.h b/src/gui/src/SetupWizard.h index fd6dcd14..a1fde149 100644 --- a/src/gui/src/SetupWizard.h +++ b/src/gui/src/SetupWizard.h @@ -42,7 +42,6 @@ protected: void changeEvent(QEvent* event); void accept(); void reject(); - void notifyActivation(QString identity); private: MainWindow& m_MainWindow; @@ -52,8 +51,5 @@ private: int m_LoginAttemps; private slots: - void on_m_pRadioButtonSubscription_toggled(bool checked); - void on_m_pRadioButtonActivate_toggled(bool checked); - void on_m_pRadioButtonSkip_toggled(bool checked); void on_m_pComboLanguage_currentIndexChanged(int index); };