diff options
author | Tomaz Canabrava <tomaz.canabrava@gmail.com> | 2016-08-27 22:13:33 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-08-27 22:37:15 -0700 |
commit | 0a6f6b4382a35402cdfd792487a82c4e83b3a3b0 (patch) | |
tree | 21519e278df6586976900e10f37bb060a1d6f1f2 /desktop-widgets | |
parent | 270864d073359f783fbb9cbe17c583d6b88cb8ae (diff) | |
download | subsurface-0a6f6b4382a35402cdfd792487a82c4e83b3a3b0.tar.gz |
Settings update: Fix missing groups and Language initialization
There's one function named uiLanguage() that should return
the current uiLanguage() that subsurface is running, but
it actually sets a whole lot of preferences, I think
that the general idea of that function is okay, but it seems
broken for me.
still, I used it to load the correct language from the preferences
since it's what this function is currently doing right now.
Also, a lot of missing groups where added.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/preferences/preferences_language.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp index 75297a8ff..64e937aef 100644 --- a/desktop-widgets/preferences/preferences_language.cpp +++ b/desktop-widgets/preferences/preferences_language.cpp @@ -42,18 +42,19 @@ void PreferencesLanguage::refreshSettings() ui->languageDropdown->setCurrentIndex(languages.first().row()); } +#include <QDebug> void PreferencesLanguage::syncSettings() { - auto lang = SettingsObjectWrapper::instance()->language_settings; bool useSystemLang = prefs.locale.use_system_language; + QString currentText = ui->languageDropdown->currentText(); - QAbstractItemModel *m = ui->languageDropdown->model(); - QString currentText = m->data(m->index(ui->languageDropdown->currentIndex(),0), Qt::UserRole).toString(); if (useSystemLang != ui->languageSystemDefault->isChecked() || (!useSystemLang && currentText != prefs.locale.language)) { QMessageBox::warning(this, tr("Restart required"), tr("To correctly load a new language you must restart Subsurface.")); } + + auto lang = SettingsObjectWrapper::instance()->language_settings; lang->setLanguage(currentText); lang->setUseSystemLanguage(ui->languageSystemDefault->isChecked()); lang->setTimeFormatOverride(!ui->timeFormatSystemDefault->isChecked()); |