summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-gui.cpp2
-rw-r--r--qt-ui/preferences.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp
index 3cd35893a..d57a3250b 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -92,7 +92,7 @@ void init_ui(int *argcp, char ***argvp)
QLocale loc;
if (!s.value("UseSystemLanguage", true).toBool()){
- loc = QLocale(s.value("UiLanguage", QLocale().uiLanguages().first()).toString());
+ loc = QLocale(s.value("UiLanguage", QLocale().uiLanguages().first()).toString());
}
QString uiLang = loc.uiLanguages().first();
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 7f0a94c4c..4e71a0ef3 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -116,7 +116,7 @@ void PreferencesDialog::setUiFromPrefs()
QSettings s;
s.beginGroup("Language");
- ui.languageSystemDefault->setChecked(s.value("UseSystemLanguage").toBool());
+ ui.languageSystemDefault->setChecked(s.value("UseSystemLanguage", true).toBool());
QAbstractItemModel *m = ui.languageView->model();
QModelIndexList languages = m->match( m->index(0,0), Qt::UserRole, s.value("UiLanguage").toString());
if (languages.count())
@@ -190,8 +190,9 @@ void PreferencesDialog::syncSettings()
QLocale loc;
s.beginGroup("Language");
- if (s.value("UiLanguage").toString() != ui.languageView->currentIndex().data(Qt::UserRole) ||
- s.value("UseSystemLanguage").toBool() != ui.languageSystemDefault->isChecked()) {
+ bool useSystemLang = s.value("UseSystemLanguage", true).toBool();
+ if (useSystemLang != ui.languageSystemDefault->isChecked() ||
+ (!useSystemLang && s.value("UiLanguage").toString() != ui.languageView->currentIndex().data(Qt::UserRole))) {
QMessageBox::warning(mainWindow(), tr("Restart required"),
tr("To correctly load a new language you must restart Subsurface."));
}