|
|
@@ -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);
|
|
|
- }
|
|
|
-}
|
0 comments on commit
088ac82