summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-07 00:42:14 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-07 00:42:14 +0300
commit7c51bd3c7f488de09a56fdd3a7d14af3763b45e2 (patch)
treeec2d66ad62d948519fcd799f9eca59bc253df279 /src/gui/serverdialog.cpp
parent192f5f2f3fa35e2269e6aa243e50e13fd226a3d5 (diff)
downloadplus-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.tar.gz
plus-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.tar.bz2
plus-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.tar.xz
plus-7c51bd3c7f488de09a56fdd3a7d14af3763b45e2.zip
Add close button to servers dialog.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp13
1 files changed, 10 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);
+}