diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-01 04:15:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-01 04:15:19 +0300 |
commit | 292968544ed758ae58c29b613cb89a7b67e551fa (patch) | |
tree | 710b40f187592a1f3efb44b308a457f002f096f8 /src/gui/serverdialog.h | |
parent | d90303a19147d679f46759aba8b8711962b6e176 (diff) | |
download | plus-292968544ed758ae58c29b613cb89a7b67e551fa.tar.gz plus-292968544ed758ae58c29b613cb89a7b67e551fa.tar.bz2 plus-292968544ed758ae58c29b613cb89a7b67e551fa.tar.xz plus-292968544ed758ae58c29b613cb89a7b67e551fa.zip |
Rename CustomServerDialog to EditServerDialog.
Use EditServerDialog for adding new servers to ServerDialog.
Diffstat (limited to 'src/gui/serverdialog.h')
-rw-r--r-- | src/gui/serverdialog.h | 39 |
1 files changed, 8 insertions, 31 deletions
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 |