summaryrefslogtreecommitdiff
path: root/src/gui/login.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-09 03:34:45 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-09 03:34:45 +0000
commit8bde9095c5840b8d62ebafe11beaed98877d6ac2 (patch)
tree537f717a339d1247cae222eb7a354ea5dbe8babf /src/gui/login.cpp
parenta246c08cef5e4d598fc07a681eb971bfbcf01519 (diff)
downloadmana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.gz
mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.bz2
mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.tar.xz
mana-8bde9095c5840b8d62ebafe11beaed98877d6ac2.zip
* 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.
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r--src/gui/login.cpp64
1 files changed, 35 insertions, 29 deletions
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