diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-07 00:42:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-07 00:42:14 +0300 |
commit | 7c51bd3c7f488de09a56fdd3a7d14af3763b45e2 (patch) | |
tree | ec2d66ad62d948519fcd799f9eca59bc253df279 /src | |
parent | 192f5f2f3fa35e2269e6aa243e50e13fd226a3d5 (diff) | |
download | manaverse-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.tar.gz manaverse-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.tar.bz2 manaverse-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.tar.xz manaverse-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.zip |
Add close button to servers dialog.
Diffstat (limited to 'src')
-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; |