summaryrefslogtreecommitdiff
path: root/src/gui/registerdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/registerdialog.cpp')
-rw-r--r--src/gui/registerdialog.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/registerdialog.cpp b/src/gui/registerdialog.cpp
index d803bd89e..53ce9b3d3 100644
--- a/src/gui/registerdialog.cpp
+++ b/src/gui/registerdialog.cpp
@@ -78,6 +78,8 @@ RegisterDialog::RegisterDialog(LoginData *const data):
mOtherButton(nullptr),
mWrongDataNoticeListener(new WrongDataNoticeListener)
{
+ setCloseButton(true);
+
const int optionalActions = Net::getLoginHandler()->
supportedOptionalActions();
@@ -168,7 +170,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event)
{
if (event.getId() == "cancel")
{
- Client::setState(STATE_LOGIN);
+ close();
}
else if (event.getId() == "register" && canSubmit())
{
@@ -301,3 +303,9 @@ bool RegisterDialog::canSubmit() const
!mConfirmField->getText().empty() &&
Client::getState() == STATE_REGISTER;
}
+
+void RegisterDialog::close()
+{
+ Client::setState(STATE_LOGIN);
+ Window::close();
+}