diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-10-03 23:06:51 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-10-03 23:06:51 -0600 |
commit | 69217e82e8631bbb2183a1322d0985a495c52f5e (patch) | |
tree | 60ba8d777ddd9d8121a910e864b8d2434c982347 /src/gui/login.cpp | |
parent | 8ef86b6da8e2b5a9c5ff9db6ef22980013e52dd3 (diff) | |
download | mana-69217e82e8631bbb2183a1322d0985a495c52f5e.tar.gz mana-69217e82e8631bbb2183a1322d0985a495c52f5e.tar.bz2 mana-69217e82e8631bbb2183a1322d0985a495c52f5e.tar.xz mana-69217e82e8631bbb2183a1322d0985a495c52f5e.zip |
Polish login procedure and fix some bugs with it
WorldSelectDialog now works correctly. Buttons for several dialogs have more explainatory text and consistant locations.
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r-- | src/gui/login.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 84a6a22c..ad2eb966 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -55,12 +55,12 @@ LoginDialog::LoginDialog(LoginData *loginData): mPassField = new PasswordField(mLoginData->password); mKeepCheck = new CheckBox(_("Remember username"), mLoginData->remember); - mOkButton = new Button(_("OK"), "ok", this); - mCancelButton = new Button(_("Cancel"), "cancel", this); mRegisterButton = new Button(_("Register"), "register", this); + mServerButton = new Button(_("Select Server"), "server", this); + mLoginButton = new Button(_("Login"), "login", this); - mUserField->setActionEventId("ok"); - mPassField->setActionEventId("ok"); + mUserField->setActionEventId("login"); + mPassField->setActionEventId("login"); mUserField->addKeyListener(this); mPassField->addKeyListener(this); @@ -73,8 +73,8 @@ LoginDialog::LoginDialog(LoginData *loginData): place(1, 1, mPassField, 3).setPadding(1); place(0, 5, mKeepCheck, 4); place(0, 6, mRegisterButton).setHAlign(LayoutCell::LEFT); - place(2, 6, mCancelButton); - place(3, 6, mOkButton); + place(2, 6, mServerButton); + place(3, 6, mLoginButton); reflowLayout(250, 0); center(); @@ -85,7 +85,7 @@ LoginDialog::LoginDialog(LoginData *loginData): else mPassField->requestFocus(); - mOkButton->setEnabled(canSubmit()); + mLoginButton->setEnabled(canSubmit()); } LoginDialog::~LoginDialog() @@ -94,18 +94,19 @@ LoginDialog::~LoginDialog() void LoginDialog::action(const gcn::ActionEvent &event) { - if (event.getId() == "ok" && canSubmit()) + if (event.getId() == "login" && canSubmit()) { mLoginData->username = mUserField->getText(); mLoginData->password = mPassField->getText(); mLoginData->remember = mKeepCheck->isSelected(); mLoginData->registerLogin = false; - mOkButton->setEnabled(false); mRegisterButton->setEnabled(false); + mServerButton->setEnabled(false); + mLoginButton->setEnabled(false); state = STATE_LOGIN_ATTEMPT; } - else if (event.getId() == "cancel") + else if (event.getId() == "server") { state = STATE_SWITCH_SERVER; } @@ -120,7 +121,7 @@ void LoginDialog::action(const gcn::ActionEvent &event) void LoginDialog::keyPressed(gcn::KeyEvent &keyEvent) { - mOkButton->setEnabled(canSubmit()); + mLoginButton->setEnabled(canSubmit()); } bool LoginDialog::canSubmit() |