diff options
author | Gehad Elrobey <gehadelrobey@gmail.com> | 2014-04-16 22:03:44 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-16 13:09:55 -0700 |
commit | 8380f096199d4da1e89789c9bd67974e550f2bf3 (patch) | |
tree | 3bfc0618202730a976a2b6df99f3cb4fd348be74 /qt-ui/preferences.cpp | |
parent | 4bd4c0110815a9c5a9c9c05fbd6bd987573b2904 (diff) | |
download | subsurface-8380f096199d4da1e89789c9bd67974e550f2bf3.tar.gz |
Renaming the prefs struct members to be consistent with the QSettings.
-Renaming prefs members for consistency.
-Changing references of QSettings to the prefs structure instead.
-Removing unused functions in pref.h were left over from an old version.
-Changing the data-type of bool members to short for consistency with other members.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r-- | qt-ui/preferences.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index b22991c5b..c93dd3628 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -49,8 +49,8 @@ void PreferencesDialog::setUiFromPrefs() ui.pheThreshold->setValue(prefs.pp_graphs.phe_threshold); ui.po2Threshold->setValue(prefs.pp_graphs.po2_threshold); ui.pn2Threshold->setValue(prefs.pp_graphs.pn2_threshold); - ui.maxppo2->setValue(prefs.mod_ppO2); - ui.red_ceiling->setChecked(prefs.profile_red_ceiling); + ui.maxppo2->setValue(prefs.modppO2); + ui.red_ceiling->setChecked(prefs.redceiling); ui.units_group->setEnabled(ui.personalize->isChecked()); ui.gflow->setValue(prefs.gflow); @@ -179,7 +179,6 @@ void PreferencesDialog::syncSettings() // Graph s.beginGroup("TecDetails"); - s.setValue("phethreshold", ui.pheThreshold->value()); s.setValue("po2threshold", ui.po2Threshold->value()); s.setValue("pn2threshold", ui.pn2Threshold->value()); @@ -203,6 +202,7 @@ void PreferencesDialog::syncSettings() s.setValue("weight", ui.lbs->isChecked() ? units::LBS : units::KG); s.setValue("vertical_speed_time", ui.vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS); s.endGroup(); + // Defaults s.beginGroup("GeneralSettings"); s.setValue("default_filename", ui.defaultfilename->text()); @@ -216,6 +216,7 @@ void PreferencesDialog::syncSettings() s.endGroup(); s.sync(); + // Locale QLocale loc; s.beginGroup("Language"); bool useSystemLang = s.value("UseSystemLanguage", true).toBool(); @@ -228,8 +229,11 @@ void PreferencesDialog::syncSettings() s.setValue("UiLanguage", ui.languageView->currentIndex().data(Qt::UserRole)); s.endGroup(); + // Animation s.beginGroup("Animations"); s.setValue("animation_speed",ui.velocitySlider->value()); + s.endGroup(); + loadSettings(); emit settingsChanged(); } @@ -271,15 +275,15 @@ void PreferencesDialog::loadSettings() GET_DOUBLE("pn2threshold", pp_graphs.pn2_threshold); GET_DOUBLE("phethreshold", pp_graphs.phe_threshold); GET_BOOL("mod", mod); - GET_DOUBLE("modppO2", mod_ppO2); + GET_DOUBLE("modppO2", modppO2); GET_BOOL("ead", ead); - GET_BOOL("redceiling", profile_red_ceiling); - GET_BOOL("dcceiling", profile_dc_ceiling); - GET_BOOL("calcceiling", profile_calc_ceiling); - GET_BOOL("calcceiling3m", calc_ceiling_3m_incr); - GET_BOOL("calcndltts", calc_ndl_tts); - GET_BOOL("calcalltissues", calc_all_tissues); - GET_BOOL("hrgraph", heart_rate); + GET_BOOL("redceiling", redceiling); + GET_BOOL("dcceiling", dcceiling); + GET_BOOL("calcceiling", calcceiling); + GET_BOOL("calcceiling3m", calcceiling3m); + GET_BOOL("calcndltts", calcndltts); + GET_BOOL("calcalltissues", calcalltissues); + GET_BOOL("hrgraph", hrgraph); GET_INT("gflow", gflow); GET_INT("gfhigh", gfhigh); GET_BOOL("gf_low_at_maxdepth", gf_low_at_maxdepth); |