summaryrefslogtreecommitdiff
path: root/src/gui/serverselectdialog.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-05-04 00:02:10 -0600
committerJared Adams <jaxad0127@gmail.com>2009-05-04 00:02:10 -0600
commitcd89ede064c63cb43da0fb4bfa16ff1599a96d32 (patch)
tree8d4efd373e3e31f8584e7f33c7a4a6e60f23eb15 /src/gui/serverselectdialog.cpp
parentca40dfd64338d5608e7836928b2eaa1648ae7caf (diff)
downloadmana-cd89ede064c63cb43da0fb4bfa16ff1599a96d32.tar.gz
mana-cd89ede064c63cb43da0fb4bfa16ff1599a96d32.tar.bz2
mana-cd89ede064c63cb43da0fb4bfa16ff1599a96d32.tar.xz
mana-cd89ede064c63cb43da0fb4bfa16ff1599a96d32.zip
Fix char-server default selection to be first
Also send a different version to the login-server to tell it to send the main char-server first.
Diffstat (limited to 'src/gui/serverselectdialog.cpp')
-rw-r--r--src/gui/serverselectdialog.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/gui/serverselectdialog.cpp b/src/gui/serverselectdialog.cpp
index bcc756b7..be4baead 100644
--- a/src/gui/serverselectdialog.cpp
+++ b/src/gui/serverselectdialog.cpp
@@ -42,8 +42,16 @@ class ServerListModel : public gcn::ListModel
public:
virtual ~ServerListModel() {}
- int getNumberOfElements();
- std::string getElementAt(int i);
+ int getNumberOfElements()
+ {
+ return n_server;
+ }
+
+ std::string getElementAt(int i)
+ {
+ const SERVER_INFO *si = server_info[i];
+ return si->name + " (" + toString(si->online_users) + ")";
+ }
};
ServerSelectDialog::ServerSelectDialog(LoginData *loginData, int nextState):
@@ -84,7 +92,7 @@ ServerSelectDialog::ServerSelectDialog(LoginData *loginData, int nextState):
mOkButton->setEnabled(false);
else
// Select first server
- mServerList->setSelected(1);
+ mServerList->setSelected(0);
center();
setVisible(true);
@@ -110,14 +118,3 @@ void ServerSelectDialog::action(const gcn::ActionEvent &event)
else if (event.getId() == "cancel")
state = STATE_LOGIN;
}
-
-int ServerListModel::getNumberOfElements()
-{
- return n_server;
-}
-
-std::string ServerListModel::getElementAt(int i)
-{
- const SERVER_INFO *si = server_info[i];
- return si->name + " (" + toString(si->online_users) + ")";
-}