summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-20 02:51:09 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-20 02:51:09 +0300
commit7432e8857d5e58953326e49e24f79a1fcdbeaef2 (patch)
tree53f22a63c5238e1ed7bf3ffb4dfedc8b44262d85 /src/gui
parent02cc5a6d5ec50d44d3593e1557cce18c2a0c201b (diff)
downloadmv-7432e8857d5e58953326e49e24f79a1fcdbeaef2.tar.gz
mv-7432e8857d5e58953326e49e24f79a1fcdbeaef2.tar.bz2
mv-7432e8857d5e58953326e49e24f79a1fcdbeaef2.tar.xz
mv-7432e8857d5e58953326e49e24f79a1fcdbeaef2.zip
Add additional keys handling to servers dialog.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/serverdialog.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 56ff99228..d86d93f61 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -413,10 +413,35 @@ void ServerDialog::keyPressed(gcn::KeyEvent &keyEvent)
mConnectButton->getActionEventId()));
return;
+ case Input::KEY_GUI_INSERT:
+ new EditServerDialog(this, ServerInfo(), -1);
+ return;
+
+ case Input::KEY_GUI_DELETE:
+ {
+ int index = mServersList->getSelected();
+ if (index >= 0)
+ {
+ mServersList->setSelected(0);
+ mServers.erase(mServers.begin() + index);
+ saveCustomServers();
+ }
+ return;
+ }
+
+ case Input::KEY_GUI_BACKSPACE:
+ {
+ int index = mServersList->getSelected();
+ if (index >= 0)
+ new EditServerDialog(this, mServers.at(index), index);
+ return;
+ }
+
default:
break;
}
- mServersList->keyPressed(keyEvent);
+ if (!keyEvent.isConsumed())
+ mServersList->keyPressed(keyEvent);
}
void ServerDialog::valueChanged(const gcn::SelectionEvent &)