From a98a7a135199bbe3dc25290da47c1915861b2300 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 2 Jun 2013 19:52:18 +0900 Subject: Correctly implement Metric / Imperial / Personalize preference The code so far had completely ignored Metric / Imperial. Turning this into a three way radio box seemed to make much more sense. Signed-off-by: Dirk Hohndel --- qt-ui/preferences.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt-ui/preferences.cpp') diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index dd484b6e8..551d7965a 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -1,6 +1,7 @@ #include "preferences.h" #include "ui_preferences.h" #include +#include PreferencesDialog* PreferencesDialog::instance() { @@ -43,6 +44,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags f) : QDial ui->increment_3m->setChecked(B(calcceiling3m, calc_ceiling_3m_incr)); ui->all_tissues->setEnabled(ui->calculated_ceiling->isChecked()); ui->all_tissues->setChecked(B(calcalltissues, calc_all_tissues)); + ui->groupBox->setEnabled(ui->personalize->isChecked()); ui->gflow->setValue((int)(I(gflow, gflow))); ui->gfhigh->setValue((int)(I(gfhigh, gfhigh))); @@ -121,7 +123,8 @@ void PreferencesDialog::syncSettings() // Units s.beginGroup("Units"); - s.setValue("units_metric", ui->metric->isChecked()); + QString unitSystem = ui->metric->isChecked() ? "metric" : (ui->imperial->isChecked() ? "imperial" : "personal"); + s.setValue("unit_system", unitSystem); s.setValue("temperature", ui->fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS); s.setValue("length", ui->feet->isChecked() ? units::FEET : units::METERS); s.setValue("pressure", ui->psi->isChecked() ? units::PSI : units::BAR); -- cgit v1.2.3-70-g09d2