summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/preferences')
-rw-r--r--desktop-widgets/preferences/preferences_units.cpp4
-rw-r--r--desktop-widgets/preferences/preferences_units.ui37
2 files changed, 41 insertions, 0 deletions
diff --git a/desktop-widgets/preferences/preferences_units.cpp b/desktop-widgets/preferences/preferences_units.cpp
index 2717688a6..9ff6eb0af 100644
--- a/desktop-widgets/preferences/preferences_units.cpp
+++ b/desktop-widgets/preferences/preferences_units.cpp
@@ -40,6 +40,9 @@ void PreferencesUnits::refreshSettings()
ui->vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
ui->vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS);
+ ui->duration_mixed->setChecked(prefs.units.duration_units == units::MIXED);
+ ui->duration_no_hours->setChecked(prefs.units.duration_units == units::MINUTES_ONLY);
+ ui->duration_show_hours->setChecked(prefs.units.duration_units == units::ALWAYS_HOURS);
}
void PreferencesUnits::syncSettings()
@@ -56,4 +59,5 @@ void PreferencesUnits::syncSettings()
units->setWeight(ui->lbs->isChecked() ? units::LBS : units::KG);
units->setVerticalSpeedTime(ui->vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS);
units->setCoordinatesTraditional(ui->gpsTraditional->isChecked());
+ units->setDurationUnits(ui->duration_mixed->isChecked() ? units::MIXED : (ui->duration_no_hours->isChecked() ? units::MINUTES_ONLY : units::ALWAYS_HOURS));
}
diff --git a/desktop-widgets/preferences/preferences_units.ui b/desktop-widgets/preferences/preferences_units.ui
index 4093181d4..49ef80a22 100644
--- a/desktop-widgets/preferences/preferences_units.ui
+++ b/desktop-widgets/preferences/preferences_units.ui
@@ -232,6 +232,43 @@
</widget>
</item>
<item>
+ <widget class="QGroupBox">
+ <property name="title">
+ <string>Duration units</string>
+ </property>
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" >
+ <property name="text">
+ <string>Show hours in duration</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QRadioButton" name="duration_show_hours">
+ <property name="text">
+ <string>hh:mm (always)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QRadioButton" name="duration_no_hours">
+ <property name="text">
+ <string>mm (always)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QRadioButton" name="duration_mixed">
+ <property name="text">
+ <string>mm (for dives shorter than 1 hour), hh:mm (otherwise)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<widget class="QGroupBox" name="groupBox_11">
<property name="title">
<string>GPS coordinates</string>