diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-19 00:08:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-19 00:08:05 +0300 |
commit | e57e189fa59d3c2fef7d6fe82203016cf98de7cc (patch) | |
tree | 6f2565e73a43291decfe673b7db24353ebb4f38d /src/gui | |
parent | d63a8fd1db07b0cd0128165edb429418c3b5c393 (diff) | |
download | manaverse-e57e189fa59d3c2fef7d6fe82203016cf98de7cc.tar.gz manaverse-e57e189fa59d3c2fef7d6fe82203016cf98de7cc.tar.bz2 manaverse-e57e189fa59d3c2fef7d6fe82203016cf98de7cc.tar.xz manaverse-e57e189fa59d3c2fef7d6fe82203016cf98de7cc.zip |
improve registerdialog class.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/registerdialog.cpp | 9 | ||||
-rw-r--r-- | src/gui/registerdialog.h | 5 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/gui/registerdialog.cpp b/src/gui/registerdialog.cpp index e9f381444..a4ec0983a 100644 --- a/src/gui/registerdialog.cpp +++ b/src/gui/registerdialog.cpp @@ -147,11 +147,6 @@ RegisterDialog::RegisterDialog(LoginData *const data) : mPasswordField->addKeyListener(this); mConfirmField->addKeyListener(this); - /* TODO: - * This is a quick and dirty way to respond to the ENTER key, regardless of - * which text field is selected. There may be a better way now with the new - * input system of Guichan 0.6.0. See also the login dialog. - */ mUserField->setActionEventId("register"); mPasswordField->setActionEventId("register"); mConfirmField->setActionEventId("register"); @@ -208,7 +203,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) minUser); error = 1; } - else if (user.length() > maxUser - 1 ) + else if (user.length() > maxUser - 1) { // Name too long errorMsg = strprintf @@ -254,7 +249,6 @@ void RegisterDialog::action(const gcn::ActionEvent &event) // Reset password confirmation mPasswordField->setText(""); mConfirmField->setText(""); - mWrongDataNoticeListener->setTarget(this->mPasswordField); } @@ -267,7 +261,6 @@ void RegisterDialog::action(const gcn::ActionEvent &event) { // No errors detected, register the new user. mRegisterButton->setEnabled(false); - mLoginData->username = mUserField->getText(); mLoginData->password = mPasswordField->getText(); if (mFemaleButton && mFemaleButton->isSelected()) diff --git a/src/gui/registerdialog.h b/src/gui/registerdialog.h index 34bb0bac8..548c720a8 100644 --- a/src/gui/registerdialog.h +++ b/src/gui/registerdialog.h @@ -60,7 +60,8 @@ class WrongDataNoticeListener final : public gcn::ActionListener * * \ingroup Interface */ -class RegisterDialog final : public Window, public gcn::ActionListener, +class RegisterDialog final : public Window, + public gcn::ActionListener, public gcn::KeyListener { public: @@ -99,7 +100,6 @@ class RegisterDialog final : public Window, public gcn::ActionListener, bool canSubmit() const; LoginData *mLoginData; - TextField *mUserField; TextField *mPasswordField; TextField *mConfirmField; @@ -109,7 +109,6 @@ class RegisterDialog final : public Window, public gcn::ActionListener, RadioButton *mMaleButton; RadioButton *mFemaleButton; RadioButton *mOtherButton; - WrongDataNoticeListener *mWrongDataNoticeListener; }; |