1 #include "settingsdialog.h"
2 #include "ui_settingsdialog.h"
4 SettingsDialog::SettingsDialog(QWidget *parent) :
6 ui(new Ui::SettingsDialog)
9 this->setWindowTitle("Settings");
10 this->ui->regEMailLineEdit->setText("@");
11 instructionsDialog = new InstructionsDialog;
14 SettingsDialog::~SettingsDialog()
19 void SettingsDialog::changeEvent(QEvent *e)
21 QDialog::changeEvent(e);
23 case QEvent::LanguageChange:
24 ui->retranslateUi(this);
34 void SettingsDialog::on_pushButtonHelp_clicked()
36 instructionsDialog->show();
42 void SettingsDialog::on_registratePushButton_clicked()
44 // Send username, password and email to SpeedFreak server
45 this->regUsername = ui->regUserNameLineEdit->text();
46 this->regPassword = ui->regPasswordLineEdit->text();
47 this->regEmail = ui->regEMailLineEdit->text();
49 emit sendregistration();
51 //close(); //using close() hides popup-window which reports error from server
54 // Next 6 functions can be removed if Settingsdialog is implemented without
55 // own copy of username, password & email
56 void SettingsDialog::setRegUserName(QString username)
58 this->regUsername = username;
61 void SettingsDialog::setRegPassword(QString password)
63 this->regPassword = password;
66 void SettingsDialog::setRegEmail(QString email)
68 this->regEmail = email;
71 QString SettingsDialog::getRegUserName()
73 return this->regUsername;
76 QString SettingsDialog::getRegPassword()
78 return this->regPassword;
81 QString SettingsDialog::getRegEmail()
83 return this->regEmail;
89 void SettingsDialog::on_setUserPushButton_clicked()
91 this->username = ui->setUserUsernameLineEdit->text();
92 this->password = ui->setUserPasswordLineEdit->text();
94 emit userNameChanged();
96 //close(); //using close() hides popup-window which reports error from server
99 // Next 4 functions can be removed if Settingsdialog is implemented without
100 // own copy of username & password
101 void SettingsDialog::setUserName(QString username)
103 this->username = username;
106 void SettingsDialog::setPassword(QString password)
108 this->password = password;
111 QString SettingsDialog::getUserName()
113 return this->username;
116 QString SettingsDialog::getPassword()
118 return this->password;
121 void SettingsDialog::setLabelInfoToUser(QString infoText)
123 this->ui->labelInfoToUser->setText(infoText);