summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index da95b6a1..44998bcc 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -169,6 +169,8 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir):
mServersListModel = new ServersListModel(&mServers, this);
mServersList = new ListBox(mServersListModel);
+ mServersList->addMouseListener(this);
+
ScrollArea *usedScroll = new ScrollArea(mServersList);
usedScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
@@ -371,20 +373,30 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &)
mPortField->setText(toString(myServer.port));
switch (myServer.type)
{
- case ServerInfo::UNKNOWN:
- mTypeField->setSelected(2);
- break;
case ServerInfo::EATHENA:
mTypeField->setSelected(0);
break;
case ServerInfo::MANASERV:
mTypeField->setSelected(1);
+ default:
+ mTypeField->setSelected(2);
+ break;
}
setFieldsReadOnly(true);
mDeleteButton->setEnabled(myServer.save);
}
+void ServerDialog::mouseClicked(gcn::MouseEvent &mouseEvent)
+{
+ if (mouseEvent.getClickCount() == 2 &&
+ mouseEvent.getSource() == mServersList)
+ {
+ action(gcn::ActionEvent(mConnectButton,
+ mConnectButton->getActionEventId()));
+ }
+}
+
void ServerDialog::logic()
{
{