#5629 Change activation failure to a QDialog
This commit is contained in:
parent
c799041ce8
commit
d6bcdcbea7
|
@ -18,7 +18,8 @@ FORMS += res/MainWindowBase.ui \
|
||||||
res/SetupWizardBase.ui \
|
res/SetupWizardBase.ui \
|
||||||
res/AddClientDialogBase.ui \
|
res/AddClientDialogBase.ui \
|
||||||
res/ActivationDialog.ui \
|
res/ActivationDialog.ui \
|
||||||
res/CancelActivationDialog.ui
|
res/CancelActivationDialog.ui \
|
||||||
|
res/FailedLoginDialog.ui
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/MainWindow.cpp \
|
src/MainWindow.cpp \
|
||||||
src/AboutDialog.cpp \
|
src/AboutDialog.cpp \
|
||||||
|
@ -62,7 +63,8 @@ SOURCES += src/main.cpp \
|
||||||
src/SubscriptionManager.cpp \
|
src/SubscriptionManager.cpp \
|
||||||
src/ActivationNotifier.cpp \
|
src/ActivationNotifier.cpp \
|
||||||
src/ActivationDialog.cpp \
|
src/ActivationDialog.cpp \
|
||||||
src/CancelActivationDialog.cpp
|
src/CancelActivationDialog.cpp \
|
||||||
|
src/FailedLoginDialog.cpp
|
||||||
HEADERS += src/MainWindow.h \
|
HEADERS += src/MainWindow.h \
|
||||||
src/AboutDialog.h \
|
src/AboutDialog.h \
|
||||||
src/ServerConfig.h \
|
src/ServerConfig.h \
|
||||||
|
@ -109,7 +111,8 @@ HEADERS += src/MainWindow.h \
|
||||||
src/ActivationNotifier.h \
|
src/ActivationNotifier.h \
|
||||||
src/ElevateMode.h \
|
src/ElevateMode.h \
|
||||||
src/ActivationDialog.h \
|
src/ActivationDialog.h \
|
||||||
src/CancelActivationDialog.h
|
src/CancelActivationDialog.h \
|
||||||
|
src/FailedLoginDialog.h
|
||||||
RESOURCES += res/Synergy.qrc
|
RESOURCES += res/Synergy.qrc
|
||||||
RC_FILE = res/win/Synergy.rc
|
RC_FILE = res/win/Synergy.rc
|
||||||
macx {
|
macx {
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>FailedLoginDialog</class>
|
||||||
|
<widget class="QDialog" name="FailedLoginDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>165</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Activation Error</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>50</x>
|
||||||
|
<y>120</y>
|
||||||
|
<width>341</width>
|
||||||
|
<height>32</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>90</y>
|
||||||
|
<width>382</width>
|
||||||
|
<height>30</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><a href="https://symless.com/account/reset/?source=gui"><span style=" text-decoration: underline; color:#0000ff;">Forgotten your password?</span></a></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="messageLabel">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>382</width>
|
||||||
|
<height>72</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>An error occurred while trying to activate Synergy. The Symless server returned the following error:
|
||||||
|
|
||||||
|
%1</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<zorder>label_2</zorder>
|
||||||
|
<zorder>messageLabel</zorder>
|
||||||
|
<zorder>buttonBox</zorder>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>FailedLoginDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>FailedLoginDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
|
@ -8,6 +8,7 @@
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "QUtility.h"
|
#include "QUtility.h"
|
||||||
#include "SubscriptionManager.h"
|
#include "SubscriptionManager.h"
|
||||||
|
#include "FailedLoginDialog.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
@ -116,9 +117,8 @@ void ActivationDialog::accept()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (!webClient.getEdition (edition, error)) {
|
else if (!webClient.getEdition (edition, error)) {
|
||||||
message.critical (this, "Activation Error",
|
FailedLoginDialog failedLoginDialog (this, error);
|
||||||
tr("An error occurred while trying to activate Synergy. "
|
failedLoginDialog.exec();
|
||||||
"The Symless server returned the following error:\n\n%1").arg(error));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include "FailedLoginDialog.h"
|
||||||
|
#include "ui_FailedLoginDialog.h"
|
||||||
|
|
||||||
|
FailedLoginDialog::FailedLoginDialog(QWidget *parent, QString message):
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::FailedLoginDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
ui->messageLabel->setText(ui->messageLabel->text().arg(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
FailedLoginDialog::~FailedLoginDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
#ifndef FAILEDLOGINDIALOG_H
|
||||||
|
#define FAILEDLOGINDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class FailedLoginDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class FailedLoginDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit FailedLoginDialog(QWidget *parent = 0, QString message = "");
|
||||||
|
~FailedLoginDialog();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::FailedLoginDialog *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FAILEDLOGINDIALOG_H
|
|
@ -46,7 +46,7 @@ WebClient::getEdition (int& edition, QString& errorOut) {
|
||||||
throw std::runtime_error ("Unrecognised server response.");
|
throw std::runtime_error ("Unrecognised server response.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
errorOut = tr("Login failed. Invalid email or password.");
|
errorOut = tr("Login failed. Invalid email address or password.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue