summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-11-02 10:42:39 +0100
committerStefan Dombrowski <stefan@uni-bonn.de>2010-11-02 10:42:39 +0100
commitf97e5ee9c22cccfb27a3634e814ad9b01edc3195 (patch)
tree36b0a35977b5214e746b12f1ebc6fbf347bc5aa3 /src/gui
parent526741f2651990e8a89113f750d2bf274d88f33f (diff)
downloadmana-client-f97e5ee9c22cccfb27a3634e814ad9b01edc3195.tar.gz
mana-client-f97e5ee9c22cccfb27a3634e814ad9b01edc3195.tar.bz2
mana-client-f97e5ee9c22cccfb27a3634e814ad9b01edc3195.tar.xz
mana-client-f97e5ee9c22cccfb27a3634e814ad9b01edc3195.zip
Adding double-click to server dialog and world select dialog
This resolves http://bugs.manasource.org/view.php?id=259 Reviewed-by: Thorbjorn
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/serverdialog.cpp10
-rw-r--r--src/gui/serverdialog.h2
-rw-r--r--src/gui/worldselectdialog.cpp10
-rw-r--r--src/gui/worldselectdialog.h2
4 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index e377042a..d1eece56 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -430,6 +430,16 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &)
mDeleteButton->setEnabled(myServer.save);
}
+void ServerDialog::mouseClicked(gcn::MouseEvent &mouseEvent)
+{
+ if (mouseEvent.getSource() == mServersList &&
+ isDoubleClick(mServersList->getSelected()))
+ {
+ action(gcn::ActionEvent(mConnectButton,
+ mConnectButton->getActionEventId()));
+ }
+}
+
void ServerDialog::logic()
{
{
diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h
index aae8b2e0..1eea6c92 100644
--- a/src/gui/serverdialog.h
+++ b/src/gui/serverdialog.h
@@ -135,6 +135,8 @@ class ServerDialog : public Window,
*/
void valueChanged(const gcn::SelectionEvent &event);
+ void mouseClicked(gcn::MouseEvent &mouseEvent);
+
void logic();
protected:
diff --git a/src/gui/worldselectdialog.cpp b/src/gui/worldselectdialog.cpp
index 3219b83d..3207f394 100644
--- a/src/gui/worldselectdialog.cpp
+++ b/src/gui/worldselectdialog.cpp
@@ -137,3 +137,13 @@ void WorldSelectDialog::keyPressed(gcn::KeyEvent &keyEvent)
action(gcn::ActionEvent(NULL, mChooseWorld->getActionEventId()));
}
}
+
+void WorldSelectDialog::mouseClicked(gcn::MouseEvent &mouseEvent)
+{
+ if (mouseEvent.getSource() == mWorldList &&
+ isDoubleClick(mWorldList->getSelected()))
+ {
+ action(gcn::ActionEvent(mChooseWorld,
+ mChooseWorld->getActionEventId()));
+ }
+}
diff --git a/src/gui/worldselectdialog.h b/src/gui/worldselectdialog.h
index 2d4f0189..b51110b4 100644
--- a/src/gui/worldselectdialog.h
+++ b/src/gui/worldselectdialog.h
@@ -62,6 +62,8 @@ class WorldSelectDialog : public Window, public gcn::ActionListener,
void keyPressed(gcn::KeyEvent &keyEvent);
+ void mouseClicked(gcn::MouseEvent &mouseEvent);
+
private:
WorldListModel *mWorldListModel;
gcn::ListBox *mWorldList;