Added registration dialog
authorOlavi Pulkkinen <olavi.pulkkinen@webinfo.fi>
Wed, 3 Mar 2010 11:30:36 +0000 (13:30 +0200)
committerOlavi Pulkkinen <olavi.pulkkinen@webinfo.fi>
Wed, 3 Mar 2010 11:30:36 +0000 (13:30 +0200)
Client/registration.cpp [new file with mode: 0644]
Client/registration.h [new file with mode: 0644]
Client/registration.ui [new file with mode: 0644]

diff --git a/Client/registration.cpp b/Client/registration.cpp
new file mode 100644 (file)
index 0000000..10c610c
--- /dev/null
@@ -0,0 +1,42 @@
+#include "registration.h"
+#include "ui_registration.h"
+
+Registration::Registration(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::Registration)
+{
+    ui->setupUi(this);
+    this->setWindowTitle("Registration for Speed Freak server");
+}
+
+Registration::~Registration()
+{
+    delete ui;
+}
+
+void Registration::changeEvent(QEvent *e)
+{
+    QDialog::changeEvent(e);
+    switch (e->type()) {
+    case QEvent::LanguageChange:
+        ui->retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
+
+void Registration::on_registratePushButton_clicked()
+{
+    // Send username, password and email to SpeedFreak server
+    close();  // Needs some new signal/slot to go forward or ???
+    //registrateToServer(ui->newUsernameLineEdit->text(),
+    //                   ui->newPasswordLineEdit->text(),
+    //                   ui->eMailLineEdit->text());
+}
+
+void Registration::on_cancelPushButton_clicked()
+{
+    close();
+}
+
diff --git a/Client/registration.h b/Client/registration.h
new file mode 100644 (file)
index 0000000..6a7df95
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef REGISTRATION_H
+#define REGISTRATION_H
+
+#include <QDialog>
+
+namespace Ui {
+    class Registration;
+}
+
+class Registration : public QDialog {
+    Q_OBJECT
+public:
+    Registration(QWidget *parent = 0);
+    ~Registration();
+
+protected:
+    void changeEvent(QEvent *e);
+
+private:
+    Ui::Registration *ui;
+
+private slots:
+    void on_cancelPushButton_clicked();
+    void on_registratePushButton_clicked();
+};
+
+#endif // REGISTRATION_H
+
diff --git a/Client/registration.ui b/Client/registration.ui
new file mode 100644 (file)
index 0000000..a7480bf
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Registration</class>
+ <widget class="QDialog" name="Registration">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Registration</string>
+  </property>
+  <widget class="QLabel" name="infoLabel">
+   <property name="geometry">
+    <rect>
+     <x>40</x>
+     <y>20</y>
+     <width>381</width>
+     <height>16</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Give your new username (max. 12 characters) and password  for registration.</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="infoLabel_2">
+   <property name="geometry">
+    <rect>
+     <x>40</x>
+     <y>40</y>
+     <width>181</width>
+     <height>16</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Give also your valid email address.</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="registratePushButton">
+   <property name="geometry">
+    <rect>
+     <x>60</x>
+     <y>180</y>
+     <width>75</width>
+     <height>23</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Registrate</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="cancelPushButton">
+   <property name="geometry">
+    <rect>
+     <x>160</x>
+     <y>180</y>
+     <width>75</width>
+     <height>23</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Cancel</string>
+   </property>
+  </widget>
+  <widget class="QWidget" name="">
+   <property name="geometry">
+    <rect>
+     <x>40</x>
+     <y>80</y>
+     <width>239</width>
+     <height>74</height>
+    </rect>
+   </property>
+   <layout class="QFormLayout" name="formLayout">
+    <item row="0" column="0">
+     <widget class="QLabel" name="newUserNameLabel">
+      <property name="text">
+       <string>Your new username:</string>
+      </property>
+     </widget>
+    </item>
+    <item row="0" column="1">
+     <widget class="QLineEdit" name="newUsernameLineEdit">
+      <property name="maxLength">
+       <number>12</number>
+      </property>
+     </widget>
+    </item>
+    <item row="1" column="0">
+     <widget class="QLabel" name="newPasswordLabel">
+      <property name="text">
+       <string>Your new password:</string>
+      </property>
+     </widget>
+    </item>
+    <item row="1" column="1">
+     <widget class="QLineEdit" name="newPasswordLineEdit">
+      <property name="maxLength">
+       <number>255</number>
+      </property>
+      <property name="echoMode">
+       <enum>QLineEdit::Password</enum>
+      </property>
+     </widget>
+    </item>
+    <item row="2" column="0">
+     <widget class="QLabel" name="eMailLabel">
+      <property name="text">
+       <string>Your Emai:l</string>
+      </property>
+     </widget>
+    </item>
+    <item row="2" column="1">
+     <widget class="QLineEdit" name="eMailLineEdit">
+      <property name="maxLength">
+       <number>255</number>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
+