summaryrefslogtreecommitdiffhomepage
path: root/gui/options-dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-08 13:39:23 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-08 13:42:40 +0200
commit863b8cad6d95ed2492ac929066f843664a49998d (patch)
tree527a20e268234ac81b86d6e88506c3b847f5dc25 /gui/options-dialog.cpp
parentced9bbd4c1b7d3a3968dbf8b1731bc49ff9f9164 (diff)
add complete(?) portable config support
Diffstat (limited to 'gui/options-dialog.cpp')
-rw-r--r--gui/options-dialog.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp
index 7eb6f68d..c35a6b52 100644
--- a/gui/options-dialog.cpp
+++ b/gui/options-dialog.cpp
@@ -33,7 +33,10 @@ QString OptionsDialog::kopts_to_string(const key_opts& kopts)
void OptionsDialog::set_disable_translation_state(bool value)
{
- QSettings(OPENTRACK_ORG).setValue("disable-translation", value);
+ group::with_global_settings_object([&](QSettings& s)
+ {
+ s.setValue("disable-translation", value);
+ });
}
OptionsDialog::OptionsDialog(std::function<void(bool)> pause_keybindings) :
@@ -88,7 +91,10 @@ OptionsDialog::OptionsDialog(std::function<void(bool)> pause_keybindings) :
tie_setting(main.neck_enable, ui.neck_enable);
- ui.disable_translation->setChecked(QSettings(OPENTRACK_ORG).value("disable-translation", false).toBool());
+ const bool is_translation_disabled = group::with_global_settings_object([] (QSettings& s) {
+ return s.value("disable-translation", false).toBool();
+ });
+ ui.disable_translation->setChecked(is_translation_disabled);
struct tmp
{