diff options
-rw-r--r-- | src/gui/serverdialog.cpp | 13 | ||||
-rw-r--r-- | src/gui/serverdialog.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 778166d3b..e07a222e2 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -270,6 +270,8 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, setWindowName("ServerDialog"); + setCloseButton(true); + mPersistentIPCheckBox = new CheckBox(this, _("Use same ip for game sub servers"), config.getBoolValue("usePersistentIP"), @@ -391,9 +393,7 @@ void ServerDialog::action(const gcn::ActionEvent &event) } else if (eventId == "quit") { - if (mDownload) - mDownload->cancel(); - Client::setState(STATE_FORCE_QUIT); + close(); } else if (eventId == "load") { @@ -824,3 +824,10 @@ bool ServerDialog::needUpdateServers() const return false; } + +void ServerDialog::close() +{ + if (mDownload) + mDownload->cancel(); + Client::setState(STATE_FORCE_QUIT); +} diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index 253bfd365..3eebff6c7 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -132,6 +132,8 @@ class ServerDialog : public Window, void connectToSelectedServer(); + void close() override; + protected: friend class ServersListModel; |