summaryrefslogtreecommitdiff
path: root/src/gui/editserverdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-07 00:37:14 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-07 00:37:14 +0300
commit07e638798767239e4ea5fa39f17e9e8576fb1f14 (patch)
tree2b52e6ddb5778085f3c343a624cde230dd8c23ad /src/gui/editserverdialog.cpp
parent671ca11caba0dc80636ff76035f55b6b8fc3893e (diff)
downloadplus-07e638798767239e4ea5fa39f17e9e8576fb1f14.tar.gz
plus-07e638798767239e4ea5fa39f17e9e8576fb1f14.tar.bz2
plus-07e638798767239e4ea5fa39f17e9e8576fb1f14.tar.xz
plus-07e638798767239e4ea5fa39f17e9e8576fb1f14.zip
Add connect button to edit server dialog.
Diffstat (limited to 'src/gui/editserverdialog.cpp')
-rw-r--r--src/gui/editserverdialog.cpp12
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();
}