summaryrefslogtreecommitdiff
path: root/src/gui/setup_other.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-24 14:39:37 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-24 14:39:37 +0300
commit09007720225215aed316b6a939fcfd47ee2f5ca9 (patch)
tree8ad6884828abeb016154adb4b9814fcbb84ab9d8 /src/gui/setup_other.cpp
parentd0cfc6412b1d931b09d457cac2959b4881136ca4 (diff)
downloadmanaverse-09007720225215aed316b6a939fcfd47ee2f5ca9.tar.gz
manaverse-09007720225215aed316b6a939fcfd47ee2f5ca9.tar.bz2
manaverse-09007720225215aed316b6a939fcfd47ee2f5ca9.tar.xz
manaverse-09007720225215aed316b6a939fcfd47ee2f5ca9.zip
Replace sliders to dropdowns in misc setup page.
Diffstat (limited to 'src/gui/setup_other.cpp')
-rw-r--r--src/gui/setup_other.cpp52
1 files changed, 35 insertions, 17 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");