Added "New account" button when connectiong to the official server
authorvitiv <nikita.utiu@gmail.com>
Tue, 08 Jan 2013 21:27:35 +0200
changeset 8364 fbc9bcc6c39d
parent 8362 89a6b7cc6f95
child 8367 2506ed09f4be
Added "New account" button when connectiong to the official server
QTfrontend/hwform.cpp
QTfrontend/hwform.h
QTfrontend/ui/dialog/input_password.cpp
QTfrontend/ui/dialog/input_password.h
--- a/QTfrontend/hwform.cpp	Fri Jan 04 19:42:49 2013 +0400
+++ b/QTfrontend/hwform.cpp	Tue Jan 08 21:27:35 2013 +0200
@@ -1340,6 +1340,8 @@
         {
         //open dialog
             HWPasswordDialog * pwDialog = new HWPasswordDialog(this);
+            // make the "new account" button dialog open a browser with the registration page
+            connect(pwDialog->pbNewAccount, SIGNAL(clicked()), this, SLOT(openRegistrationPage()));
             pwDialog->cbSave->setChecked(config->value("net/savepassword", true).toBool());
 
         //if nickname is present, put it into the field
@@ -1927,6 +1929,11 @@
         ShowErrorMessage(QMessageBox::tr("File association failed."));
 }
 
+void HWForm::openRegistrationPage() 
+{
+    QDesktopServices::openUrl(QUrl("http://www.hedgewars.org/user/register"));
+}    
+
 void HWForm::saveDemoWithCustomName()
 {
     if(!m_lastDemo.isEmpty())
--- a/QTfrontend/hwform.h	Fri Jan 04 19:42:49 2013 +0400
+++ b/QTfrontend/hwform.h	Tue Jan 08 21:27:35 2013 +0200
@@ -140,6 +140,7 @@
         void selectFirstNetScheme();
 
         void saveDemoWithCustomName();
+        void openRegistrationPage();
 
     private:
         void _NetConnect(const QString & hostName, quint16 port, QString nick);
--- a/QTfrontend/ui/dialog/input_password.cpp	Fri Jan 04 19:42:49 2013 +0400
+++ b/QTfrontend/ui/dialog/input_password.cpp	Tue Jan 08 21:27:35 2013 +0200
@@ -60,6 +60,7 @@
     layout->addWidget(cbSave, 5, 0);
 
     QDialogButtonBox* dbbButtons = new QDialogButtonBox(this);
+    pbNewAccount = dbbButtons->addButton(QString("New Account"), QDialogButtonBox::ActionRole);
     QPushButton * pbOK = dbbButtons->addButton(QDialogButtonBox::Ok);
     QPushButton * pbCancel = dbbButtons->addButton(QDialogButtonBox::Cancel);
     layout->addWidget(dbbButtons, 6, 0);
--- a/QTfrontend/ui/dialog/input_password.h	Fri Jan 04 19:42:49 2013 +0400
+++ b/QTfrontend/ui/dialog/input_password.h	Tue Jan 08 21:27:35 2013 +0200
@@ -23,6 +23,7 @@
 
 class QLineEdit;
 class QCheckBox;
+class QPushButton;
 
 class HWPasswordDialog : public QDialog
 {
@@ -33,6 +34,7 @@
         QLineEdit* lePassword;
         QLineEdit* leNickname;
         QCheckBox* cbSave;
+        QPushButton * pbNewAccount;
 };