summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-11 19:58:07 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-11 23:36:49 +0300
commitb6bf8e607146202b82b7943147fc5a99d4c46a60 (patch)
tree0465526af0ebefee944382af2869f08bfbcc7c94 /src/gui/widgets/tabs
parentdbf65ef9c85f1b1b93fc9666bda31c5e5171b8c7 (diff)
downloadManaVerse-b6bf8e607146202b82b7943147fc5a99d4c46a60.tar.gz
ManaVerse-b6bf8e607146202b82b7943147fc5a99d4c46a60.tar.bz2
ManaVerse-b6bf8e607146202b82b7943147fc5a99d4c46a60.tar.xz
ManaVerse-b6bf8e607146202b82b7943147fc5a99d4c46a60.zip
Add option to set sdl logging level.
Only for SDL2.
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r--src/gui/widgets/tabs/setup_misc.cpp85
-rw-r--r--src/gui/widgets/tabs/setup_misc.h3
2 files changed, 65 insertions, 23 deletions
diff --git a/src/gui/widgets/tabs/setup_misc.cpp b/src/gui/widgets/tabs/setup_misc.cpp
index 759f6507e..f4ce6cba0 100644
--- a/src/gui/widgets/tabs/setup_misc.cpp
+++ b/src/gui/widgets/tabs/setup_misc.cpp
@@ -91,10 +91,35 @@ static const char *const densityList[] =
N_("xxhigh")
};
+#ifdef USE_SDL2
+static const int sdlLogListSize = 7;
+
+static const char *const sdlLogList[] =
+{
+ // TRANSLATORS: sdl2 log level
+ N_("default"),
+ // TRANSLATORS: sdl2 log level
+ N_("verbose"),
+ // TRANSLATORS: sdl2 log level
+ N_("debug"),
+ // TRANSLATORS: sdl2 log level
+ N_("info"),
+ // TRANSLATORS: sdl2 log level
+ N_("warn"),
+ // TRANSLATORS: sdl2 log level
+ N_("error"),
+ // TRANSLATORS: sdl2 log level
+ N_("critical")
+};
+#endif // USE_SDL2
+
Setup_Misc::Setup_Misc(const Widget2 *const widget) :
SetupTabScroll(widget),
mProxyTypeList(new NamesModel),
mShortcutsList(new NamesModel),
+#ifdef USE_SDL2
+ mSdlLogList(new NamesModel),
+#endif // USE_SDL2
mDensityList(new NamesModel)
{
// TRANSLATORS: misc tab in settings
@@ -362,29 +387,7 @@ Setup_Misc::Setup_Misc(const Widget2 *const widget) :
// TRANSLATORS: settings group
- new SetupItemLabel(_("Other"), "", this);
-
- // TRANSLATORS: settings option
- new SetupItemCheckBox(_("Enable server side attack"), "",
- "serverAttack", this, "serverAttackEvent");
-
- // TRANSLATORS: settings option
- new SetupItemCheckBox(_("Hide support page link on error"), "",
- "hidesupport", this, "hidesupportEvent");
-
- // TRANSLATORS: settings option
- new SetupItemCheckBox(_("Enable double clicks"), "",
- "doubleClick", this, "doubleClickEvent");
-
- // TRANSLATORS: settings option
- new SetupItemCheckBox(_("Enable bot checker"), "",
- "enableBotCheker", this, "enableBotChekerEvent");
-
- // TRANSLATORS: settings option
- new SetupItemCheckBox(_("Enable buggy servers protection "
- "(do not disable)"), "", "enableBuggyServers", this,
- "enableBuggyServersEvent",
- MainConfig_false);
+ new SetupItemLabel(_("Logging"), "", this);
// TRANSLATORS: settings option
new SetupItemCheckBox(_("Enable OpenGL version check "
@@ -411,10 +414,43 @@ Setup_Misc::Setup_Misc(const Widget2 *const widget) :
new SetupItemCheckBox(_("Enable input log"), "",
"logInput", this, "logInputEvent");
+#ifdef USE_SDL2
+ mSdlLogList->fillFromArray(&sdlLogList[0], sdlLogListSize);
+ // TRANSLATORS: settings option
+ new SetupItemDropDown(_("SDL logging level"), "",
+ "sdlLogLevel", this, "sdlLogLevelEvent", mSdlLogList, 100);
+#endif // USE_SDL2
+
// TRANSLATORS: settings option
new SetupButtonItem(_("Upload log file"), "", "upload",
this, "uploadLog", &uploadListener);
+
+ // TRANSLATORS: settings group
+ new SetupItemLabel(_("Other"), "", this);
+
+ // TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Enable server side attack"), "",
+ "serverAttack", this, "serverAttackEvent");
+
+ // TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Hide support page link on error"), "",
+ "hidesupport", this, "hidesupportEvent");
+
+ // TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Enable double clicks"), "",
+ "doubleClick", this, "doubleClickEvent");
+
+ // TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Enable bot checker"), "",
+ "enableBotCheker", this, "enableBotChekerEvent");
+
+ // TRANSLATORS: settings option
+ new SetupItemCheckBox(_("Enable buggy servers protection "
+ "(do not disable)"), "", "enableBuggyServers", this,
+ "enableBuggyServersEvent",
+ MainConfig_false);
+
// TRANSLATORS: settings option
new SetupItemCheckBox(_("Low traffic mode"), "", "lowTraffic",
this, "lowTrafficEvent");
@@ -454,6 +490,9 @@ Setup_Misc::~Setup_Misc()
delete2(mProxyTypeList);
delete2(mShortcutsList);
delete2(mDensityList);
+#ifdef USE_SDL2
+ delete2(mSdlLogList);
+#endif // USE_SDL2
}
void Setup_Misc::apply()
diff --git a/src/gui/widgets/tabs/setup_misc.h b/src/gui/widgets/tabs/setup_misc.h
index c31026c92..787f4c181 100644
--- a/src/gui/widgets/tabs/setup_misc.h
+++ b/src/gui/widgets/tabs/setup_misc.h
@@ -43,6 +43,9 @@ class Setup_Misc final : public SetupTabScroll
protected:
NamesModel *mProxyTypeList;
NamesModel *mShortcutsList;
+#ifdef USE_SDL2
+ NamesModel *mSdlLogList;
+#endif // USE_SDL2
NamesModel *mDensityList;
};