diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-11-21 21:07:59 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-10 20:31:56 +0100 |
commit | 98be39a094cc20f513da1847c553513682e4eeae (patch) | |
tree | bf3ac3591cf80c14e484328d50d7b553d18244e2 /src/gui/serverdialog.h | |
parent | 683da50e37fbbb2e3f70a4421a06dabd9bb912d8 (diff) | |
download | mana-98be39a094cc20f513da1847c553513682e4eeae.tar.gz mana-98be39a094cc20f513da1847c553513682e4eeae.tar.bz2 mana-98be39a094cc20f513da1847c553513682e4eeae.tar.xz mana-98be39a094cc20f513da1847c553513682e4eeae.zip |
Made addition of custom servers be done in a separate window.
Now the first window the user can see is a list of servers
which can double-clicked, making it all less cluttered.
This commit also makes custom servers able to now have
their own titles and their own description,
just as the official ones.
I also fixed the add entry button being registered twice
to the action listener, and the fact that the description
wasn't updated properly at windows loading
and when adding/removing an entry.
Resolves: Mana-Mantis #237.
Reviewed-by: Ablu
Diffstat (limited to 'src/gui/serverdialog.h')
-rw-r--r-- | src/gui/serverdialog.h | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index bf0a43d6..611f65e9 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -81,26 +81,6 @@ class ServersListModel : public gcn::ListModel }; /** - * Server Type List Model - */ -class TypeListModel : public gcn::ListModel -{ - public: - TypeListModel() {} - - /** - * Used to get number of line in the list - */ - int getNumberOfElements() { return 2; } - - /** - * Used to get an element from the list - */ - std::string getElementAt(int elementIndex); -}; - - -/** * The server choice dialog. * * \ingroup Interface @@ -135,6 +115,9 @@ class ServerDialog : public Window, friend class ServersListModel; MutexLocker lock() { return MutexLocker(&mMutex); } + friend class CustomServerDialog; + void saveCustomServers(const ServerInfo ¤tServer = ServerInfo()); + private: /** * Called to load a list of available server from an online xml file. @@ -143,15 +126,10 @@ class ServerDialog : public Window, void loadServers(); void loadCustomServers(); - void saveCustomServers(const ServerInfo ¤tServer = ServerInfo()); 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; @@ -161,9 +139,6 @@ class ServerDialog : public Window, ListBox *mServersList; ServersListModel *mServersListModel; - DropDown *mTypeField; - TypeListModel *mTypeListModel; - const std::string &mDir; enum ServerDialogDownloadStatus |