From 11c8b2365e086d4df216a12e3ef2f17c55ec478e Mon Sep 17 00:00:00 2001 From: Olavi Pulkkinen Date: Wed, 3 Mar 2010 13:30:36 +0200 Subject: [PATCH] Added registration dialog --- Client/registration.cpp | 42 +++++++++++++++ Client/registration.h | 28 ++++++++++ Client/registration.ui | 130 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 Client/registration.cpp create mode 100644 Client/registration.h create mode 100644 Client/registration.ui diff --git a/Client/registration.cpp b/Client/registration.cpp new file mode 100644 index 0000000..10c610c --- /dev/null +++ b/Client/registration.cpp @@ -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 index 0000000..6a7df95 --- /dev/null +++ b/Client/registration.h @@ -0,0 +1,28 @@ +#ifndef REGISTRATION_H +#define REGISTRATION_H + +#include + +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 index 0000000..a7480bf --- /dev/null +++ b/Client/registration.ui @@ -0,0 +1,130 @@ + + + Registration + + + + 0 + 0 + 600 + 400 + + + + Registration + + + + + 40 + 20 + 381 + 16 + + + + Give your new username (max. 12 characters) and password for registration. + + + + + + 40 + 40 + 181 + 16 + + + + Give also your valid email address. + + + + + + 60 + 180 + 75 + 23 + + + + Registrate + + + + + + 160 + 180 + 75 + 23 + + + + Cancel + + + + + + 40 + 80 + 239 + 74 + + + + + + + Your new username: + + + + + + + 12 + + + + + + + Your new password: + + + + + + + 255 + + + QLineEdit::Password + + + + + + + Your Emai:l + + + + + + + 255 + + + + + + + + + + + -- 1.7.9.5