diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-05-19 02:24:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-05-19 02:24:20 +0300 |
commit | 886522371299b45254b7dc72e6de3070703d7c10 (patch) | |
tree | 738745eab76eb5f55a9adc08bfac10077b07efac /src/gui/serverdialog.cpp | |
parent | 7cd309e7c9e0200cedb45edfeeba5a601d3fb446 (diff) | |
download | manaverse-886522371299b45254b7dc72e6de3070703d7c10.tar.gz manaverse-886522371299b45254b7dc72e6de3070703d7c10.tar.bz2 manaverse-886522371299b45254b7dc72e6de3070703d7c10.tar.xz manaverse-886522371299b45254b7dc72e6de3070703d7c10.zip |
Enable server type selection again. Add evol server type. Now working same as tmweathena.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r-- | src/gui/serverdialog.cpp | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index ca5711104..fca10c3c8 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -63,6 +63,8 @@ static std::string serverTypeToString(ServerInfo::Type type) { case ServerInfo::TMWATHENA: return "TmwAthena"; + case ServerInfo::EVOL: + return "Evol"; #ifdef MANASERV_SUPPORT case ServerInfo::MANASERV: return "ManaServ"; @@ -82,6 +84,7 @@ static unsigned short defaultPortForServerType(ServerInfo::Type type) default: case ServerInfo::UNKNOWN: case ServerInfo::TMWATHENA: + case ServerInfo::EVOL: #ifdef MANASERV_SUPPORT return 6901; case ServerInfo::MANASERV: @@ -134,8 +137,10 @@ std::string TypeListModel::getElementAt(int elementIndex) { if (elementIndex == 0) return "TmwAthena"; -#ifdef MANASERV_SUPPORT else if (elementIndex == 1) + return "Evol"; +#ifdef MANASERV_SUPPORT + else if (elementIndex == 2) return "ManaServ"; #endif else @@ -251,18 +256,26 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): ScrollArea *usedScroll = new ScrollArea(mServersList); usedScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); -#ifdef MANASERV_SUPPORT Label *typeLabel = new Label(_("Server type:")); mTypeListModel = new TypeListModel(); mTypeField = new DropDown(mTypeListModel); - mTypeField->setSelected((serverInfo->type == ServerInfo::MANASERV) ? - 1 : 0); - int n = 1; -#else - mTypeListModel = 0; - mTypeField = 0; - int n = 0; + switch (serverInfo->type) + { + case ServerInfo::MANASERV: +#ifdef MANASERV_SUPPORT + mTypeField->setSelected(2); + break; #endif + default: + case ServerInfo::UNKNOWN: + case ServerInfo::TMWATHENA: + mTypeField->setSelected(0); + break; + case ServerInfo::EVOL: + mTypeField->setSelected(1); + break; + } + int n = 1; mDescription = new Label(std::string()); @@ -285,10 +298,8 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): place(1, 0, mServerNameField, 5).setPadding(3); place(0, 1, portLabel); place(1, 1, mPortField, 5).setPadding(3); -#ifdef MANASERV_SUPPORT place(0, 2, typeLabel); place(1, 2, mTypeField, 5).setPadding(3); -#endif place(0, 2 + n, usedScroll, 6, 5).setPadding(3); place(0, 7 + n, mDescription, 6); place(0, 8 + n, mPersistentIPCheckBox, 6); @@ -399,8 +410,11 @@ void ServerDialog::action(const gcn::ActionEvent &event) case 0: mServerInfo->type = ServerInfo::TMWATHENA; break; -#ifdef MANASERV_SUPPORT case 1: + mServerInfo->type = ServerInfo::EVOL; + break; +#ifdef MANASERV_SUPPORT + case 2: mServerInfo->type = ServerInfo::MANASERV; break; #endif @@ -491,7 +505,7 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &) mTypeField->setSelected(0); break; case ServerInfo::MANASERV: - mTypeField->setSelected(1); + mTypeField->setSelected(2); break; #else case ServerInfo::MANASERV: @@ -499,6 +513,9 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &) mTypeField->setSelected(0); break; #endif + case ServerInfo::EVOL: + mTypeField->setSelected(1); + break; } } setFieldsReadOnly(true); |