diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-20 02:51:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-20 02:51:09 +0300 |
commit | 7432e8857d5e58953326e49e24f79a1fcdbeaef2 (patch) | |
tree | 53f22a63c5238e1ed7bf3ffb4dfedc8b44262d85 /src | |
parent | 02cc5a6d5ec50d44d3593e1557cce18c2a0c201b (diff) | |
download | manaverse-7432e8857d5e58953326e49e24f79a1fcdbeaef2.tar.gz manaverse-7432e8857d5e58953326e49e24f79a1fcdbeaef2.tar.bz2 manaverse-7432e8857d5e58953326e49e24f79a1fcdbeaef2.tar.xz manaverse-7432e8857d5e58953326e49e24f79a1fcdbeaef2.zip |
Add additional keys handling to servers dialog.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/serverdialog.cpp | 27 |
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 &) |