diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-11-01 22:39:35 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-11-02 19:35:27 +0100 |
commit | 671a465fa2c9469bde36b78c49e84bd0325c4cf1 (patch) | |
tree | fb97aa51e768cad72c7a162e87db0f52410e371f /src/gui/serverdialog.cpp | |
parent | aa529734e30e3fc9542f95780b0d5346ddd29eaf (diff) | |
download | mana-671a465fa2c9469bde36b78c49e84bd0325c4cf1.tar.gz mana-671a465fa2c9469bde36b78c49e84bd0325c4cf1.tar.bz2 mana-671a465fa2c9469bde36b78c49e84bd0325c4cf1.tar.xz mana-671a465fa2c9469bde36b78c49e84bd0325c4cf1.zip |
Re-Enable the support of manaserv servers.
Reviewed-by: CodyMartin.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r-- | src/gui/serverdialog.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index d1eece56..ca8da9b4 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -199,18 +199,13 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): mDownloadStatus(DOWNLOADING_PREPARING), mDownloadProgress(-1.0f), mServers(ServerInfos()), -#ifndef MANASERV_SUPPORT - mManaservServers(ServerInfos()), -#endif mServerInfo(serverInfo) { setWindowName("ServerDialog"); Label *serverLabel = new Label(_("Server:")); Label *portLabel = new Label(_("Port:")); -#ifdef MANASERV_SUPPORT Label *typeLabel = new Label(_("Server type:")); -#endif mServerNameField = new TextField(mServerInfo->hostname); mPortField = new TextField(toString(mServerInfo->port)); @@ -248,7 +243,6 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): place(1, 0, mServerNameField, 4).setPadding(3); place(0, 1, portLabel); place(1, 1, mPortField, 4).setPadding(3); -#ifdef MANASERV_SUPPORT place(0, 2, typeLabel); place(1, 2, mTypeField, 4).setPadding(3); place(0, 3, usedScroll, 5, 5).setPadding(3); @@ -257,14 +251,6 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): place(1, 9, mDeleteButton); place(3, 9, mQuitButton); place(4, 9, mConnectButton); -#else - place(0, 2, usedScroll, 5, 5).setPadding(3); - place(0, 7, mDescription, 5); - place(0, 8, mManualEntryButton); - place(1, 8, mDeleteButton); - place(3, 8, mQuitButton); - place(4, 8, mConnectButton); -#endif // Make sure the list has enough height getLayout().setRowHeight(3, 80); @@ -481,12 +467,7 @@ void ServerDialog::setFieldsReadOnly(bool readOnly) mServersList->setSelected(-1); mServerNameField->setText(std::string()); -#ifdef MANASERV_SUPPORT mPortField->setText(std::string()); -#else - mPortField->setText(std::string("6901")); -#endif - mServerNameField->requestFocus(); } @@ -607,11 +588,7 @@ void ServerDialog::loadServers() } } -#ifdef MANASERV_SUPPORT if (!found) -#else - if (!found && server.type != ServerInfo::MANASERV) -#endif mServers.push_back(server); } } @@ -638,14 +615,7 @@ void ServerDialog::loadCustomServers() server.save = true; -#ifdef MANASERV_SUPPORT mServers.push_back(server); -#else - if (server.type == ServerInfo::MANASERV) - mManaservServers.push_back(server); - else - mServers.push_back(server); -#endif } } @@ -688,27 +658,6 @@ void ServerDialog::saveCustomServers(const ServerInfo ¤tServer) ++savedServerCount; } -#ifndef MANASERV_SUPPORT - for (unsigned i = 0; - i < mManaservServers.size() && savedServerCount < MAX_SERVERLIST; ++i) - { - const ServerInfo &server = mManaservServers.at(i); - - // Only save servers that were loaded from settings - if (!(server.save && server.isValid())) - continue; - - const std::string index = toString(savedServerCount); - const std::string nameKey = "MostUsedServerName" + index; - const std::string typeKey = "MostUsedServerType" + index; - const std::string portKey = "MostUsedServerPort" + index; - - config.setValue(nameKey, toString(server.hostname)); - config.setValue(typeKey, serverTypeToString(server.type)); - config.setValue(portKey, toString(server.port)); - ++savedServerCount; - } -#endif // Insert an invalid entry at the end to make the loading stop there if (savedServerCount < MAX_SERVERLIST) config.setValue("MostUsedServerName" + toString(savedServerCount), ""); |