From 8bde9095c5840b8d62ebafe11beaed98877d6ac2 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 9 Oct 2005 03:34:45 +0000 Subject: * Made Sprite into an interface implemented by both FloorItem and Being, which hook themselves into the map on construction. The improved fringe layer is working as expected now. * Made sure TMW compiles without warnings even when using "-Wconversion -Wshadow -Wcast-qual -Wwrite-strings -ansi -pedantic", lots of cleanups. * Added two new small tilesets that contain the desert tiles that are twice and three times the height of a normal tile. One well in new_3-1 has been converted to use the new double tiles for testing purposes. --- src/gui/login.cpp | 64 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 29 deletions(-) (limited to 'src/gui/login.cpp') diff --git a/src/gui/login.cpp b/src/gui/login.cpp index aea77768..6d1c896d 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -60,11 +60,14 @@ WrongPasswordNoticeListener::setLoginDialog(LoginDialog *loginDialog) void WrongPasswordNoticeListener::action(const std::string &eventId) { - // Reset the password and put the caret ready to retype it. - mLoginDialog->passField->setText(""); - mLoginDialog->passField->setCaretPosition(0); - mLoginDialog->passField->requestFocus(); - wrongLoginNotice = NULL; + if (eventId == "ok") + { + // Reset the password and put the caret ready to retype it. + mLoginDialog->passField->setText(""); + mLoginDialog->passField->setCaretPosition(0); + mLoginDialog->passField->requestFocus(); + wrongLoginNotice = NULL; + } } void @@ -76,10 +79,13 @@ WrongUsernameNoticeListener::setLoginDialog(LoginDialog *loginDialog) void WrongUsernameNoticeListener::action(const std::string &eventId) { - // Set the focus on the username Field - mLoginDialog->userField->setCaretPosition(LEN_MAX_USERNAME - 1); - mLoginDialog->userField->requestFocus(); - wrongLoginNotice = NULL; + if (eventId == "ok") + { + // Set the focus on the username Field + mLoginDialog->userField->setCaretPosition(LEN_MAX_USERNAME - 1); + mLoginDialog->userField->requestFocus(); + wrongLoginNotice = NULL; + } } LoginDialog::LoginDialog(): @@ -269,41 +275,41 @@ LoginDialog::action(const std::string& eventId) else if (user.length() < LEN_MIN_USERNAME) { // Name too short - std::stringstream errorMessage; - errorMessage << "The username needs to be at least " - << LEN_MIN_USERNAME - << " characters long."; - wrongLoginNotice = new OkDialog("Error", errorMessage.str(), + std::stringstream errorMsg; + errorMsg << "The username needs to be at least " + << LEN_MIN_USERNAME + << " characters long."; + wrongLoginNotice = new OkDialog("Error", errorMsg.str(), &wrongUsernameNoticeListener); } else if (user.length() > LEN_MAX_USERNAME - 1 ) { // Name too long - std::stringstream errorMessage; - errorMessage << "The username needs to be less than " - << LEN_MAX_USERNAME - << " characters long."; - wrongLoginNotice = new OkDialog("Error", errorMessage.str(), + std::stringstream errorMsg; + errorMsg << "The username needs to be less than " + << LEN_MAX_USERNAME + << " characters long."; + wrongLoginNotice = new OkDialog("Error", errorMsg.str(), &wrongUsernameNoticeListener); } else if (passField->getText().length() < LEN_MIN_PASSWORD) { // Pass too short - std::stringstream errorMessage; - errorMessage << "The password needs to be at least " - << LEN_MIN_PASSWORD - << " characters long."; - wrongLoginNotice = new OkDialog("Error", errorMessage.str(), + std::stringstream errorMsg; + errorMsg << "The password needs to be at least " + << LEN_MIN_PASSWORD + << " characters long."; + wrongLoginNotice = new OkDialog("Error", errorMsg.str(), &wrongPasswordNoticeListener); } else if (passField->getText().length() > LEN_MAX_PASSWORD - 1 ) { // Pass too long - std::stringstream errorMessage; - errorMessage << "The password needs to be less than " - << LEN_MAX_PASSWORD - << " characters long."; - wrongLoginNotice = new OkDialog("Error", errorMessage.str(), + std::stringstream errorMsg; + errorMsg << "The password needs to be less than " + << LEN_MAX_PASSWORD + << " characters long."; + wrongLoginNotice = new OkDialog("Error", errorMsg.str(), &wrongPasswordNoticeListener); } else -- cgit v1.2.3-70-g09d2