diff options
Diffstat (limited to 'src/gui/serverdialog.cpp')
-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 &) |