Updated Set user & Registration
[speedfreak] / Client / loginwindow.cpp
1 #include "loginwindow.h"
2 #include "ui_loginwindow.h"
3 #include <QMessageBox>
4
5 LoginWindow::LoginWindow(QWidget *parent) :
6     QDialog(parent),
7     ui(new Ui::LoginWindow)
8 {
9     ui->setupUi(this);
10     this->setWindowTitle("Login to Speed Freak server");
11 }
12
13 LoginWindow::~LoginWindow()
14 {
15     delete ui;
16 }
17
18 void LoginWindow::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 LoginWindow::on_cancelPushButton_clicked()
31 {
32     close();
33 }
34
35 void setUser(QString uN, QString pW);
36
37 void LoginWindow::on_loginPushButton_clicked()
38 {
39     this->username = ui->userNameLineEdit->text();
40     this->password = ui->passwordLineEdit->text();
41     close();
42 }
43
44 void LoginWindow::setUserName(QString username)
45 {
46     this->username = username;
47 }
48
49 void LoginWindow::setPassword(QString password)
50 {
51     this->password = password;
52 }
53
54 QString LoginWindow::getUserName()
55 {
56     return this->username;
57 }
58
59 QString LoginWindow::getPassword()
60 {
61     return this->password;
62 }
63
64
65
66
67