diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-01-19 15:28:56 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-20 22:38:52 +1200 |
commit | 2923329e8e47f64667c34b33eb1de64657cb6774 (patch) | |
tree | 2a0bdd654b93d1828380c5255e9b85a9d9496cd4 /qt-ui/preferences.cpp | |
parent | 2bb81d0fe58cea8a7ef08c0ac0b4aec4c41651d6 (diff) | |
download | subsurface-2923329e8e47f64667c34b33eb1de64657cb6774.tar.gz |
UI for pSCR preferences
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r-- | qt-ui/preferences.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 334b2a1d2..6c4e65df8 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -125,6 +125,8 @@ void PreferencesDialog::setUiFromPrefs() ui.gf_low_at_maxdepth->setChecked(prefs.gf_low_at_maxdepth); ui.show_ccr_setpoint->setChecked(prefs.show_ccr_setpoint); ui.defaultSetpoint->setValue((double)prefs.defaultsetpoint / 1000.0); + ui.psro2rate->setValue(prefs.o2consumption / 1000.0); + ui.pscrfactor->setValue(rint(1000.0 / prefs.pscr_ratio)); // units if (prefs.unit_system == METRIC) @@ -299,7 +301,9 @@ void PreferencesDialog::syncSettings() s.setValue("default_filename", ui.defaultfilename->text()); s.setValue("default_cylinder", ui.default_cylinder->currentText()); s.setValue("use_default_file", ui.btnUseDefaultFile->isChecked()); - s.setValue("defaultsetpoint", (int) (ui.defaultSetpoint->value() * 1000.0)); + s.setValue("defaultsetpoint", rint(ui.defaultSetpoint->value() * 1000.0)); + s.setValue("o2consumption", rint(ui.psro2rate->value() *1000.0)); + s.setValue("pscr_ratio", rint(1000.0 / ui.pscrfactor->value())); s.endGroup(); s.beginGroup("Display"); @@ -397,7 +401,6 @@ void PreferencesDialog::loadSettings() GET_BOOL("show_sac", show_sac); GET_BOOL("display_unused_tanks", display_unused_tanks); GET_BOOL("show_average_depth", show_average_depth); - GET_INT("default_setpoint", defaultsetpoint); s.endGroup(); s.beginGroup("GeneralSettings"); @@ -405,6 +408,8 @@ void PreferencesDialog::loadSettings() GET_TXT("default_cylinder", default_cylinder); GET_BOOL("use_default_file", use_default_file); GET_INT("defaultsetpoint", defaultsetpoint); + GET_INT("o2consumption", o2consumption); + GET_INT("pscr_ratio", pscr_ratio); s.endGroup(); s.beginGroup("Display"); |