diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-11-02 11:32:46 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-11-02 12:51:31 -0800 |
commit | 8a3fb854c2b835271cc03ea02e1046f2ec0fd5d5 (patch) | |
tree | 34f27142fce33c91a406b4c13b1349faba1fdec1 /desktop-widgets/preferences | |
parent | f85883c707e9d6c021025dfe406c9acfb6441e57 (diff) | |
download | subsurface-8a3fb854c2b835271cc03ea02e1046f2ec0fd5d5.tar.gz |
Preferences: hook up the UI page with the preferences structure
With this the new date and time formats mostly work
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/preferences')
-rw-r--r-- | desktop-widgets/preferences/preferences_language.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp index ec4eed471..1b5ee19a8 100644 --- a/desktop-widgets/preferences/preferences_language.cpp +++ b/desktop-widgets/preferences/preferences_language.cpp @@ -32,6 +32,11 @@ void PreferencesLanguage::refreshSettings() QSettings s; s.beginGroup("Language"); ui->languageSystemDefault->setChecked(s.value("UseSystemLanguage", true).toBool()); + ui->timeFormatSystemDefault->setChecked(!s.value("time_format_override", false).toBool()); + ui->dateFormatSystemDefault->setChecked(!s.value("date_format_override", false).toBool()); + ui->timeFormatEntry->setText(s.value("time_format").toString()); + ui->dateFormatEntry->setText(s.value("date_format").toString()); + ui->shortDateFormatEntry->setText(s.value("date_format_short").toString()); QAbstractItemModel *m = ui->languageDropdown->model(); QModelIndexList languages = m->match(m->index(0, 0), Qt::UserRole, s.value("UiLanguage").toString()); if (languages.count()) @@ -51,7 +56,15 @@ void PreferencesLanguage::syncSettings() QMessageBox::warning(this, tr("Restart required"), tr("To correctly load a new language you must restart Subsurface.")); } - s.setValue("UseSystemLanguage", ui->languageSystemDefault->isChecked()); s.setValue("UiLanguage", currentText); + s.setValue("UseSystemLanguage", ui->languageSystemDefault->isChecked()); + s.setValue("time_format_override", !ui->timeFormatSystemDefault->isChecked()); + s.setValue("date_format_override", !ui->dateFormatSystemDefault->isChecked()); + if (!ui->timeFormatSystemDefault->isChecked()) + s.setValue("time_format", ui->timeFormatEntry->text()); + if (!ui->dateFormatSystemDefault->isChecked()) { + s.setValue("date_format", ui->dateFormatEntry->text()); + s.setValue("date_format_short", ui->shortDateFormatEntry->text()); + } s.endGroup(); } |