diff options
Diffstat (limited to 'src/gui')
-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.")); + } } } |