+
+//
+// Registrate
+//
+void SettingsDialog::on_registratePushButton_clicked()
+{
+ // Send username, password and email to SpeedFreak server
+ this->regUsername = ui->regUserNameLineEdit->text();
+ this->regPassword = ui->regPasswordLineEdit->text();
+ this->regEmail = ui->regEMailLineEdit->text();
+
+ emit sendregistration();
+
+ close();
+}
+
+// Next 6 functions can be removed if Settingsdialog is implemented without
+// own copy of username, password & email
+void SettingsDialog::setRegUserName(QString username)
+{
+ this->regUsername = username;
+}
+
+void SettingsDialog::setRegPassword(QString password)
+{
+ this->regPassword = password;
+}
+
+void SettingsDialog::setRegEmail(QString email)
+{
+ this->regEmail = email;
+}
+
+QString SettingsDialog::getRegUserName()
+{
+ return this->regUsername;
+}
+
+QString SettingsDialog::getRegPassword()
+{
+ return this->regPassword;
+}
+
+QString SettingsDialog::getRegEmail()
+{
+ return this->regEmail;
+}
+
+//
+// Set / Change user
+//
+void SettingsDialog::on_setUserPushButton_clicked()
+{
+ this->username = ui->setUserUsernameLineEdit->text();
+ this->password = ui->setUserPasswordLineEdit->text();
+
+ // Save these also to usersettings
+ saveLogin( this->username, this->password);
+
+ // Set "Set/Change User" button text
+ if (this->username.length() > 0)
+ {
+ ui->setUserPushButton->setText("Change user");
+ }
+ else
+ { // Username "cleared"
+ ui->setUserPushButton->setText("Set user");
+ }
+
+ emit userNameChanged();
+ close();
+}
+
+// Next 4 functions can be removed if Settingsdialog is implemented without
+// own copy of username & password
+void SettingsDialog::setUserName(QString username)
+{
+ this->username = username;
+}
+
+void SettingsDialog::setPassword(QString password)
+{
+ this->password = password;
+}
+
+QString SettingsDialog::getUserName()
+{
+ return this->username;
+}
+
+QString SettingsDialog::getPassword()
+{
+ return this->password;
+}
+