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
}
ui->setUserPushButton->setText("Log in");
ui->setUserUsernameLineEdit->clear();
ui->setUserPasswordLineEdit->clear();
+ this->username = ui->setUserUsernameLineEdit->text();
+ this->password = ui->setUserPasswordLineEdit->text();
+ saveLogin( this->username, this->password);
}
}