#5629 Remove activation from the wizard

This commit is contained in:
Andrew Nelless 2016-09-30 15:35:04 +01:00 committed by Andrew Nelless
parent 6033f0c946
commit 088ac82e18
3 changed files with 0 additions and 350 deletions

View File

@ -120,214 +120,6 @@
</item>
</layout>
</widget>
<widget class="QWizardPage" name="m_pActivatePage">
<property name="title">
<string>Activate</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Enable your &lt;a href=&quot;http://symless.com/pricing?source=gui&quot;&gt;Synergy Pro&lt;/a&gt; and Synergy Basic features.</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioButtonActivate">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&amp;Account login</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>20</number>
</property>
<property name="verticalSpacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="m_pLabelEmail">
<property name="text">
<string>Email:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_pLineEditEmail">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
<property name="echoMode">
<enum>QLineEdit::Normal</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_pLineEditPassword">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;a href=&quot;https://symless.com/account/reset/?source=gui&quot;&gt;Forgot password&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioButtonSubscription">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&amp;Serial key</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="m_pTextEditSerialKey"/>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="m_pRadioButtonSkip">
<property name="text">
<string>S&amp;kip activation</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="styleSheet">
<string notr="true">color: rgb(100, 100, 100);</string>
</property>
<property name="text">
<string>You will see UNREGISTERED in the window title (not recommended).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>500</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="m_pNodePage">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">

View File

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

View File

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