this->username = uName;
this->password = pWord;
+ // Set line edit
ui->setUserPasswordLineEdit->setText(this->password);
ui->setUserUsernameLineEdit->setText(this->username);
+ ui->setUserPasswordLineEdit->setDisabled(1); // Disable because user logged
+ ui->setUserUsernameLineEdit->setDisabled(1); // Disable because user logged
// Already someone as user - change button text to "Change"
ui->setUserPushButton->setText("Log out");
this->regPassword = ui->regPasswordLineEdit->text();
this->regEmail = ui->regEMailLineEdit->text();
- emit sendregistration();
+ if (this->regUsername.compare("") && this->regPassword.compare("") && this->regEmail.compare("") && this->regEmail.compare("@"))
+ {
+ emit sendregistration();
+
+ }
+ else
+ {
+ QMessageBox::about(this, "One or more of the fields is empty", "Set username (3-12 characters), password (at least 6 characters) and valid email address");
+ }
//close(); //using close() hides popup-window which reports error from server
}