diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-24 14:39:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-24 14:39:37 +0300 |
commit | 09007720225215aed316b6a939fcfd47ee2f5ca9 (patch) | |
tree | 8ad6884828abeb016154adb4b9814fcbb84ab9d8 | |
parent | d0cfc6412b1d931b09d457cac2959b4881136ca4 (diff) | |
download | plus-09007720225215aed316b6a939fcfd47ee2f5ca9.tar.gz plus-09007720225215aed316b6a939fcfd47ee2f5ca9.tar.bz2 plus-09007720225215aed316b6a939fcfd47ee2f5ca9.tar.xz plus-09007720225215aed316b6a939fcfd47ee2f5ca9.zip |
Replace sliders to dropdowns in misc setup page.
-rw-r--r-- | src/gui/setup_other.cpp | 52 | ||||
-rw-r--r-- | src/gui/setup_other.h | 5 |
2 files changed, 38 insertions, 19 deletions
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp index 24b1837f9..b59cf8041 100644 --- a/src/gui/setup_other.cpp +++ b/src/gui/setup_other.cpp @@ -23,6 +23,7 @@ #include "gui/setup_other.h" #include "gui/widgets/layouthelper.h" +#include "gui/widgets/namesmodel.h" #include "gui/widgets/scrollarea.h" #include "configuration.h" @@ -31,10 +32,36 @@ #include "debug.h" +static const int shortcutsListSize = 3; + +static const char *const shortcutsList[] = +{ + N_("Always show"), + N_("Auto hide in small resolution"), + N_("Always auto hide") +}; + +static const int proxyTypeListSize = 8; + +static const char *const proxyTypeList[] = +{ + // TRANSLATORS: Proxy type selection + N_("System proxy"), + // TRANSLATORS: Proxy type selection + N_("Direct connection"), + "HTTP", + "HTTP 1.0", + "SOCKS4", + "SOCKS4A", + "SOCKS5", + // TRANSLATORS: Proxy type selection + N_("SOCKS5 hostname") +}; + Setup_Other::Setup_Other(const Widget2 *const widget) : SetupTabScroll(widget), - mProxyTypeList(new SetupItemNames), - mShortcutsList(new SetupItemNames) + mProxyTypeList(new NamesModel), + mShortcutsList(new NamesModel) { setName(_("Misc")); @@ -187,25 +214,16 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : new SetupItemLabel(_("Windows"), "", this); - mShortcutsList->push_back(_("Always show")); - mShortcutsList->push_back(_("Auto hide in small resolution")); - mShortcutsList->push_back(_("Always auto hide")); - new SetupItemSlider2(_("Shortcut buttons"), "", "autohideButtons", this, - "autohideButtonsEvent", 0, 2, mShortcutsList, false, true, true); + mShortcutsList->fillFromArray(&shortcutsList[0], shortcutsListSize); + new SetupItemDropDown(_("Shortcut buttons"), "", "autohideButtons", this, + "autohideButtonsEvent", mShortcutsList, 200); new SetupItemLabel(_("Proxy server"), "", this); - mProxyTypeList->push_back(_("System proxy")); - mProxyTypeList->push_back(_("Direct connection")); - mProxyTypeList->push_back("HTTP"); - mProxyTypeList->push_back("HTTP 1.0"); - mProxyTypeList->push_back("SOCKS4"); - mProxyTypeList->push_back("SOCKS4A"); - mProxyTypeList->push_back("SOCKS5"); - mProxyTypeList->push_back(_("SOCKS5 hostname")); - new SetupItemSlider2(_("Proxy type"), "", "downloadProxyType", this, - "downloadProxyTypeEvent", 0, 7, mProxyTypeList); + mProxyTypeList->fillFromArray(&proxyTypeList[0], proxyTypeListSize); + new SetupItemDropDown(_("Proxy type"), "", "downloadProxyType", this, + "downloadProxyTypeEvent", mProxyTypeList, 200); new SetupItemTextField(_("Proxy address:port"), "", "downloadProxy", this, "downloadProxyEvent"); diff --git a/src/gui/setup_other.h b/src/gui/setup_other.h index 37e79e974..29c228823 100644 --- a/src/gui/setup_other.h +++ b/src/gui/setup_other.h @@ -28,6 +28,7 @@ #include <guichan/actionlistener.hpp> class EditDialog; +class NamesModel; class TextField; class Setup_Other final : public SetupTabScroll @@ -42,9 +43,9 @@ class Setup_Other final : public SetupTabScroll void apply(); protected: - SetupItemNames *mProxyTypeList; + NamesModel *mProxyTypeList; - SetupItemNames *mShortcutsList; + NamesModel *mShortcutsList; }; #endif |