diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-07 00:37:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-07 00:37:14 +0300 |
commit | 07e638798767239e4ea5fa39f17e9e8576fb1f14 (patch) | |
tree | 2b52e6ddb5778085f3c343a624cde230dd8c23ad /src/gui/editserverdialog.cpp | |
parent | 671ca11caba0dc80636ff76035f55b6b8fc3893e (diff) | |
download | manaverse-07e638798767239e4ea5fa39f17e9e8576fb1f14.tar.gz manaverse-07e638798767239e4ea5fa39f17e9e8576fb1f14.tar.bz2 manaverse-07e638798767239e4ea5fa39f17e9e8576fb1f14.tar.xz manaverse-07e638798767239e4ea5fa39f17e9e8576fb1f14.zip |
Add connect button to edit server dialog.
Diffstat (limited to 'src/gui/editserverdialog.cpp')
-rw-r--r-- | src/gui/editserverdialog.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/editserverdialog.cpp b/src/gui/editserverdialog.cpp index 0a8c3e816..434a4f827 100644 --- a/src/gui/editserverdialog.cpp +++ b/src/gui/editserverdialog.cpp @@ -86,6 +86,7 @@ EditServerDialog::EditServerDialog(ServerDialog *parent, ServerInfo server, mNameField = new TextField(std::string()); mDescriptionField = new TextField(std::string()); + mConnectButton = new Button(_("Connect"), "connect", this); mOkButton = new Button(_("OK"), "addServer", this); mCancelButton = new Button(_("Cancel"), "cancel", this); @@ -102,6 +103,7 @@ EditServerDialog::EditServerDialog(ServerDialog *parent, ServerInfo server, place(1, 3, mTypeField).setPadding(3); place(0, 4, descriptionLabel); place(1, 4, mDescriptionField, 4).setPadding(3); + place(0, 5, mConnectButton); place(4, 5, mOkButton); place(3, 5, mCancelButton); @@ -182,12 +184,14 @@ void EditServerDialog::logic() void EditServerDialog::action(const gcn::ActionEvent &event) { - if (event.getId() == "ok") + const std::string &eventId = event.getId(); + + if (eventId == "ok") { // Give focus back to the server dialog. mServerAddressField->requestFocus(); } - if (event.getId() == "addServer") + if (eventId == "addServer" || eventId == "connect") { // Check the given information if (mServerAddressField->getText().empty() @@ -249,10 +253,12 @@ void EditServerDialog::action(const gcn::ActionEvent &event) //Add server mServerDialog->updateServer(mServer, mIndex); + if (eventId == "connect") + mServerDialog->connectToSelectedServer(); scheduleDelete(); } } - else if (event.getId() == "cancel") + else if (eventId == "cancel") { scheduleDelete(); } |