diff options
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp index 2752567ae..25161a904 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/core/subsurface-qt/SettingsObjectWrapper.cpp @@ -1626,6 +1626,11 @@ int UnitsSettings::verticalSpeedTime() const return prefs.units.vertical_speed_time; } +int UnitsSettings::durationUnits() const +{ + return prefs.units.duration_units; +} + QString UnitsSettings::unitSystem() const { return prefs.unit_system == METRIC ? QStringLiteral("metric") @@ -1705,6 +1710,17 @@ void UnitsSettings::setVerticalSpeedTime(int value) emit verticalSpeedTimeChanged(value); } +void UnitsSettings::setDurationUnits(int value) +{ + if (value == prefs.units.duration_units) + return; + QSettings s; + s.beginGroup(group); + s.setValue("duration_units", value); + prefs.units.duration_units = (units::DURATION) value; + emit durationUnitChanged(value); +} + void UnitsSettings::setCoordinatesTraditional(bool value) { if (value == prefs.coordinates_traditional) @@ -2180,6 +2196,7 @@ void SettingsObjectWrapper::load() GET_UNIT("weight", weight, units::LBS, units::KG); } GET_UNIT("vertical_speed_time", vertical_speed_time, units::MINUTES, units::SECONDS); + GET_UNIT3("duration_units", duration_units, units::MIXED, units::ALWAYS_HOURS, units::DURATION); GET_BOOL("coordinates", coordinates_traditional); s.endGroup(); s.beginGroup("TecDetails"); |