diff options
author | Ira Rice <irarice@gmail.com> | 2008-09-29 23:03:41 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-09-29 23:03:41 +0000 |
commit | 7aa0b5cadf9f37c7d9395aa44e0c461e2b539763 (patch) | |
tree | ea85dcc9415c031d3f2a28e74b8f4ec38f2b1747 /src/gui | |
parent | 9ae618b143023609a1f085162ca935167677e1ca (diff) | |
download | mana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.tar.gz mana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.tar.bz2 mana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.tar.xz mana-7aa0b5cadf9f37c7d9395aa44e0c461e2b539763.zip |
Modified the client so that it displays both servers as server choices,
as well as changing the default server to point to www.aethyra.org
instead of Slinker's IP address now.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/login.cpp | 26 | ||||
-rw-r--r-- | src/gui/login.h | 4 |
2 files changed, 17 insertions, 13 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 6a4cfeb7..c553d56e 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -24,6 +24,7 @@ #include "login.h" #include <string> +#include <vector> #include <guichan/widgets/label.hpp> @@ -50,9 +51,13 @@ LoginDialog::LoginDialog(LoginData *loginData): gcn::Label *passLabel = new gcn::Label("Password:"); gcn::Label *serverLabel = new gcn::Label("Server:"); gcn::Label *portLabel = new gcn::Label("Port:"); - mServerList = new DropDownList("MostRecent00", - "209.168.213.109", - "21001", + std::vector<std::string> dfltServer; + dfltServer.push_back("www.aethyra.org"); + dfltServer.push_back("www.aethyra.org"); + std::vector<std::string> dfltPort; + dfltPort.push_back("22001"); + dfltPort.push_back("21001"); + mServerList = new DropDownList("MostRecent00", dfltServer, dfltPort, MAX_SERVER_LIST_SIZE); mServerListBox = new gcn::ListBox(mServerList); mServerScrollArea = new ScrollArea(); @@ -193,8 +198,8 @@ LoginDialog::action(const gcn::ActionEvent &event) } else { - mLoginData->port = 6901; - } + mLoginData->port = 6901; + } mLoginData->username = mUserField->getText(); mLoginData->password = mPassField->getText(); @@ -271,8 +276,8 @@ LoginDialog::DropDownList::saveEntry(const std::string &server, } LoginDialog::DropDownList::DropDownList(std::string prefix, - std::string dflt, - std::string dfltPort, + std::vector<std::string> dflt, + std::vector<std::string> dfltPort, int maxEntries) : mConfigPrefix(prefix), mMaxEntries(maxEntries) @@ -287,7 +292,7 @@ LoginDialog::DropDownList::DropDownList(std::string prefix, toString(i), ""); } std::string port = config.getValue(mConfigPrefix + "Port" + - toString(i), dfltPort); + toString(i), dfltPort.front()); if (server != "") { @@ -297,10 +302,9 @@ LoginDialog::DropDownList::DropDownList(std::string prefix, } if (mServers.size() == 0) { - mServers.push_back(dflt); - mPorts.push_back(dfltPort); + mServers.assign(dflt.begin(), dflt.end()); + mPorts.assign(dfltPort.begin(), dfltPort.end()); } - } void diff --git a/src/gui/login.h b/src/gui/login.h index 8a228b5f..3550d82b 100644 --- a/src/gui/login.h +++ b/src/gui/login.h @@ -124,8 +124,8 @@ class LoginDialog : public Window, public gcn::ActionListener, const std::string &port, int &saved); public: DropDownList(std::string prefix, - std::string dfltServer, - std::string dfltPort, + std::vector<std::string> dfltServer, + std::vector<std::string> dfltPort, int maxEntries); void save(const std::string &server, const std::string &port); int getNumberOfElements(); |