Send result button added in result dialog.
[speedfreak] / Client / registration.cpp
1 #include "registration.h"
2 #include "ui_registration.h"
3 #include <QMessageBox>
4
5 Registration::Registration(QWidget *parent) :
6     QDialog(parent),
7     ui(new Ui::Registration)
8 {
9     ui->setupUi(this);
10     this->setWindowTitle("Registration for Speed Freak server");
11 }
12
13 Registration::~Registration()
14 {
15     delete ui;
16 }
17
18 void Registration::changeEvent(QEvent *e)
19 {
20     QDialog::changeEvent(e);
21     switch (e->type()) {
22     case QEvent::LanguageChange:
23         ui->retranslateUi(this);
24         break;
25     default:
26         break;
27     }
28 }
29
30 void Registration::on_registratePushButton_clicked()
31 {
32     // Send username, password and email to SpeedFreak server
33     this->username = ui->newUsernameLineEdit->text();
34     this->password = ui->newPasswordLineEdit->text();
35     this->email = ui->eMailLineEdit->text();
36
37     close();
38 }
39
40 void Registration::on_cancelPushButton_clicked()
41 {
42     close();
43 }
44
45 void Registration::setUserName(QString username)
46 {
47     this->username = username;
48 }
49
50 void Registration::setPassword(QString password)
51 {
52     this->password = password;
53 }
54
55 void Registration::setEmail(QString password)
56 {
57     this->email = email;
58 }
59
60 QString Registration::getUserName()
61 {
62     return this->username;
63 }
64
65 QString Registration::getPassword()
66 {
67     return this->password;
68 }
69
70 QString Registration::getEmail()
71 {
72     return this->email;
73 }