diff options
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r-- | qt-gui.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp index 10b7d8086..2474d407d 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -196,6 +196,14 @@ QString get_depth_string(depth_t depth, bool showunit) } } +QString get_depth_unit() +{ + if (prefs.units.length == units::METERS) + return "m"; + else + return "ft"; +} + QString get_weight_string(weight_t weight, bool showunit) { if (prefs.units.weight == units::KG) { @@ -207,6 +215,14 @@ QString get_weight_string(weight_t weight, bool showunit) } } +QString get_weight_unit() +{ + if (prefs.units.weight == units::KG) + return "kg"; + else + return "lbs"; +} + QString get_temperature_string(temperature_t temp, bool showunit) { if (prefs.units.temperature == units::CELSIUS) { @@ -220,6 +236,14 @@ QString get_temperature_string(temperature_t temp, bool showunit) } } +QString get_temp_unit() +{ + if (prefs.units.temperature == units::CELSIUS) + return QString(UTF8_DEGREE "C"); + else + return QString(UTF8_DEGREE "F"); +} + QString get_volume_string(volume_t volume, bool showunit) { if (prefs.units.volume == units::LITER) { @@ -231,6 +255,14 @@ QString get_volume_string(volume_t volume, bool showunit) } } +QString get_volume_unit() +{ + if (prefs.units.volume == units::LITER) + return "l"; + else + return "cuft"; +} + QString get_pressure_string(pressure_t pressure, bool showunit) { if (prefs.units.pressure == units::BAR) { |