summaryrefslogtreecommitdiff
path: root/src/gui/windows/editserverdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/editserverdialog.cpp')
-rw-r--r--src/gui/windows/editserverdialog.cpp47
1 files changed, 19 insertions, 28 deletions
diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp
index 51b208164..847fe1591 100644
--- a/src/gui/windows/editserverdialog.cpp
+++ b/src/gui/windows/editserverdialog.cpp
@@ -1,10 +1,10 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2012 The Mana Developers
* Copyright (C) 2012-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -103,19 +103,27 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent,
place(0, 0, nameLabel, 1, 1);
place(1, 0, mNameField, 4, 1).setPadding(3);
+
place(0, 1, serverAdressLabel, 1, 1);
place(1, 1, mServerAddressField, 4, 1).setPadding(3);
+
place(0, 2, portLabel, 1, 1);
place(1, 2, mPortField, 4, 1).setPadding(3);
+
place(0, 3, typeLabel, 1, 1);
- place(1, 3, mTypeField, 1, 1).setPadding(3);
+ place(1, 3, mTypeField, 4, 1).setPadding(3);
+
place(0, 4, descriptionLabel, 1, 1);
place(1, 4, mDescriptionField, 4, 1).setPadding(3);
+
place(0, 5, onlineListUrlLabel, 1, 1);
place(1, 5, mOnlineListUrlField, 4, 1).setPadding(3);
+
place(0, 6, packetVersionLabel, 1, 1);
place(1, 6, mPacketVersionField, 4, 1).setPadding(3);
+
place(0, 7, mPersistentIp, 4, 1).setPadding(3);
+
place(0, 8, mConnectButton, 1, 1);
place(4, 8, mOkButton, 1, 1);
place(3, 8, mCancelButton, 1, 1);
@@ -157,24 +165,16 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent,
switch (mServer.type)
{
- case ServerType::EATHENA:
-#ifdef TMWA_SUPPORT
- mTypeField->setSelected(1);
-#else // TMWA_SUPPORT
- mTypeField->setSelected(0);
-#endif // TMWA_SUPPORT
- break;
default:
case ServerType::UNKNOWN:
case ServerType::TMWATHENA:
mTypeField->setSelected(0);
break;
+ case ServerType::EATHENA:
+ mTypeField->setSelected(1 - SERVER_TYPE_INDEX_OFFSET);
+ break;
case ServerType::EVOL2:
-#ifdef TMWA_SUPPORT
- mTypeField->setSelected(2);
-#else // TMWA_SUPPORT
- mTypeField->setSelected(1);
-#endif // TMWA_SUPPORT
+ mTypeField->setSelected(2 - SERVER_TYPE_INDEX_OFFSET);
break;
}
@@ -245,22 +245,13 @@ void EditServerDialog::action(const ActionEvent &event)
case 0:
mServer.type = ServerType::TMWATHENA;
break;
- case 1:
- mServer.type = ServerType::EATHENA;
- break;
- case 2:
+#endif // TMWA_SUPPORT
+ case 1 - SERVER_TYPE_INDEX_OFFSET:
mServer.type = ServerType::EVOL2;
break;
-#else // TMWA_SUPPORT
-
- case 0:
+ case 2 - SERVER_TYPE_INDEX_OFFSET:
mServer.type = ServerType::EATHENA;
break;
- case 1:
- mServer.type = ServerType::EVOL2;
- break;
-#endif // TMWA_SUPPORT
-
default:
mServer.type = ServerType::UNKNOWN;
break;