summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-02-21 19:26:38 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-21 13:11:19 -0800
commit508387b1e194d4d723b2bd8cb2c48d49e2c95ba9 (patch)
tree03140c07fc0983c13b3428455ec94762b2b7a4d2 /profile-widget
parentb39b641a0518593e3afa64e19c317cdbae05642b (diff)
downloadsubsurface-508387b1e194d4d723b2bd8cb2c48d49e2c95ba9.tar.gz
Add units and nicer formating for items in profile info box
"SP change" info format in info box: Added/changed formating and add "bar" unit. "waypoint above ceiling" event in info box: Added formating, depth conversation to ft/m and depth unit. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/diveeventitem.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index 3780ebbf7..5af188c2d 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -156,6 +156,10 @@ void DiveEventItem::setupToolTipString()
} else if (value) {
if (type == SAMPLE_EVENT_PO2 && same_string(internalEvent->name, "SP change")) {
name += QString(": %1bar").arg((double)value / 1000, 0, 'f', 1);
+ } else if (type == SAMPLE_EVENT_CEILING && same_string(internalEvent->name, "planned waypoint above ceiling")) {
+ const char *depth_unit;
+ double depth_value = get_depth_units(value*1000, NULL, &depth_unit);
+ name += QString(": %1%2").arg((int) round(depth_value)).arg(depth_unit);
} else {
name += QString(": %1").arg(value);
}