summaryrefslogtreecommitdiffstats
path: root/qt-gui.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-06-18 10:48:46 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-06-18 10:48:46 -0700
commit370673cc999f9738f247d1c0544ab49733c25a39 (patch)
treebc3270601b5305c86563a18a5a30579cefa208e2 /qt-gui.cpp
parentdda28c76aa4b71c6f17999a11cc486460518398c (diff)
downloadsubsurface-370673cc999f9738f247d1c0544ab49733c25a39.tar.gz
Improve display of yearly statistics
Display the units in the header, make the header more consistent looking, convert the values into the right units with appropriate precision. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r--qt-gui.cpp32
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) {