diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-01-14 16:45:13 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-01-14 16:45:13 +0000 |
commit | d1395845cdc678db2a71326f2e6f20253ed14cac (patch) | |
tree | 9a75fe0591fc7bd74f828aa048aa027f59a4ae66 /src/gui/serverdialog.cpp | |
parent | 6c3a2550813c14290307f2ad91e1d76eea3e6a02 (diff) | |
download | mana-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.gz mana-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.bz2 mana-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.xz mana-d1395845cdc678db2a71326f2e6f20253ed14cac.zip |
Merged 0.0 changes from revision 2988 to 3035 to trunk.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r-- | src/gui/serverdialog.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index bd17bff7..bf29f0d3 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -44,9 +44,9 @@ const short MAX_SERVERLIST = 5; void -DropDownListener::action(const std::string &eventId, gcn::Widget *widget) +DropDownListener::action(const gcn::ActionEvent &event) { - if (eventId == "ok") + if (event.getId() == "ok") { // Reset the text fields and give back the server dialog. mServerNameField->setText(""); @@ -56,13 +56,14 @@ DropDownListener::action(const std::string &eventId, gcn::Widget *widget) mServerNameField->requestFocus(); } - else if (eventId == "changeSelection") + else if (event.getId() == "changeSelection") { // Change the textField Values according to new selection if (currentSelectedIndex != mServersListBox->getSelected()) { Server myServer; - myServer = mServersListModel->getServer(mServersListBox->getSelected()); + myServer = mServersListModel->getServer( + mServersListBox->getSelected()); mServerNameField->setText(myServer.serverName); mServerPortField->setText(toString(myServer.port)); currentSelectedIndex = mServersListBox->getSelected(); @@ -131,7 +132,7 @@ ServerDialog::ServerDialog(LoginData *loginData): mMostUsedServersScrollArea, mMostUsedServersListBox); mDropDownListener = new DropDownListener(mServerNameField, mPortField, - mMostUsedServersListModel, mMostUsedServersListBox); + mMostUsedServersListModel, mMostUsedServersListBox); mOkButton = new Button("OK", "ok", this); mCancelButton = new Button("Cancel", "cancel", this); @@ -157,9 +158,9 @@ ServerDialog::ServerDialog(LoginData *loginData): mCancelButton->getX() - mOkButton->getWidth() - 5, 100 - mOkButton->getHeight() - 5); - mServerNameField->setEventId("ok"); - mPortField->setEventId("ok"); - mMostUsedServersDropDown->setEventId("changeSelection"); + mServerNameField->setActionEventId("ok"); + mPortField->setActionEventId("ok"); + mMostUsedServersDropDown->setActionEventId("changeSelection"); mServerNameField->addActionListener(this); mPortField->addActionListener(this); @@ -193,9 +194,9 @@ ServerDialog::~ServerDialog() } void -ServerDialog::action(const std::string &eventId, gcn::Widget *widget) +ServerDialog::action(const gcn::ActionEvent &event) { - if (eventId == "ok") + if (event.getId() == "ok") { // Check login if (mServerNameField->getText().empty() || mPortField->getText().empty()) @@ -240,7 +241,7 @@ ServerDialog::action(const std::string &eventId, gcn::Widget *widget) state = STATE_CONNECT_ACCOUNT; } } - else if (eventId == "cancel") + else if (event.getId() == "cancel") { state = STATE_EXIT; } |