From 292968544ed758ae58c29b613cb89a7b67e551fa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 Feb 2012 04:15:19 +0300 Subject: Rename CustomServerDialog to EditServerDialog. Use EditServerDialog for adding new servers to ServerDialog. --- src/gui/serverdialog.h | 39 ++++++++------------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) (limited to 'src/gui/serverdialog.h') diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index d2fe0d25b..0618d4c4c 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -83,30 +83,6 @@ class ServersListModel : public gcn::ListModel ServerDialog *mParent; }; -/** - * Server Type List Model - */ -class TypeListModel : public gcn::ListModel -{ - public: - TypeListModel() {} - - /** - * Used to get number of line in the list - */ - int getNumberOfElements() -#ifdef MANASERV_SUPPORT - { return 3; } -#else - { return 2; } -#endif - - /** - * Used to get an element from the list - */ - std::string getElementAt(int elementIndex); -}; - /** * The server choice dialog. @@ -147,12 +123,16 @@ class ServerDialog : public Window, void logic(); + void updateServer(ServerInfo server, int index); + protected: friend class ServersListModel; MutexLocker lock() { return MutexLocker(&mMutex); } private: + friend class EditServerDialog; + /** * Called to load a list of available server from an online xml file. */ @@ -160,28 +140,25 @@ class ServerDialog : public Window, void loadServers(bool addNew = true); void loadCustomServers(); - void saveCustomServers(const ServerInfo ¤tServer = ServerInfo()); + void saveCustomServers(const ServerInfo ¤tServer = ServerInfo(), + int index = -1); static int downloadUpdate(void *ptr, DownloadStatus status, size_t total, size_t remaining); void setFieldsReadOnly(bool readOnly); - TextField *mServerNameField; - TextField *mPortField; Label *mDescription; Button *mQuitButton; Button *mConnectButton; - Button *mManualEntryButton; + Button *mAddEntryButton; + Button *mEditEntryButton; Button *mDeleteButton; Button *mLoadButton; ListBox *mServersList; ServersListModel *mServersListModel; - DropDown *mTypeField; - TypeListModel *mTypeListModel; - const std::string &mDir; enum ServerDialogDownloadStatus -- cgit v1.2.3-60-g2f50