diff options
author | Stefan Dombrowski <stefan@uni-bonn.de> | 2010-10-10 22:33:24 +0200 |
---|---|---|
committer | Stefan Dombrowski <stefan@uni-bonn.de> | 2010-10-10 22:33:24 +0200 |
commit | 2fb1520540598a5e6201f722979dada6b3283d0d (patch) | |
tree | 8d50293c24b263e9435019ff1b028389b05fd86b /src/gui/login.cpp | |
parent | cf32b575fd98c29ae5f20b58736acbd5bf4248ef (diff) | |
download | mana-2fb1520540598a5e6201f722979dada6b3283d0d.tar.gz mana-2fb1520540598a5e6201f722979dada6b3283d0d.tar.bz2 mana-2fb1520540598a5e6201f722979dada6b3283d0d.tar.xz mana-2fb1520540598a5e6201f722979dada6b3283d0d.zip |
Adding Okdialog if registration is disabled
Reviewed-by: Jaxad0127
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r-- | src/gui/login.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp index b243fd04..b12e6a5d 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -91,8 +91,6 @@ LoginDialog::LoginDialog(LoginData *loginData): mPassField->requestFocus(); mLoginButton->setEnabled(canSubmit()); - mRegisterButton->setEnabled(Net::getLoginHandler() - ->isRegistrationEnabled()); } LoginDialog::~LoginDialog() @@ -120,10 +118,17 @@ void LoginDialog::action(const gcn::ActionEvent &event) } else if (event.getId() == "register") { - mLoginData->username = mUserField->getText(); - mLoginData->password = mPassField->getText(); - - Client::setState(STATE_REGISTER_PREP); + if (Net::getLoginHandler()->isRegistrationEnabled()) + { + mLoginData->username = mUserField->getText(); + mLoginData->password = mPassField->getText(); + Client::setState(STATE_REGISTER_PREP); + } + else + { + new OkDialog(_("Registration disabled"), _("You need to use the " + "website to register an account for this server.")); + } } } |