summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/TabDiveStatistics.cpp
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-04-27 21:46:29 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-01 21:24:02 -0700
commit257f7c082de42855ea82f6f33c2e0765ad33587f (patch)
treea29ec407710f5f84ab1fdb85caf6ca16e7597504 /desktop-widgets/tab-widgets/TabDiveStatistics.cpp
parent9c91264f844b26d6cab6edd51cca41fdf17f5293 (diff)
downloadsubsurface-257f7c082de42855ea82f6f33c2e0765ad33587f.tar.gz
Show min/max SAC in statistics only if different to average...
...and don't show a minimum depth in stats if there is only a single dive. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDiveStatistics.cpp')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveStatistics.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp
index 80ac12e74..ec7b16f22 100644
--- a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp
@@ -46,7 +46,10 @@ void TabDiveStatistics::updateData()
{
clear();
ui->depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true));
- ui->depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true));
+ if (amount_selected > 1)
+ ui->depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true));
+ else
+ ui->depthLimits->setMinimum("");
// the overall average depth is really confusing when listed between the
// deepest and shallowest dive - let's just not set it
// ui->depthLimits->setAverage(get_depth_string(stats_selection.avg_depth, true));
@@ -55,11 +58,11 @@ void TabDiveStatistics::updateData()
ui->depthLimits->overrideAvgToolTipText("");
ui->depthLimits->setAvgVisibility(false);
- if (stats_selection.max_sac.mliter)
+ if (stats_selection.max_sac.mliter && (stats_selection.max_sac.mliter != stats_selection.avg_sac.mliter))
ui->sacLimits->setMaximum(get_volume_string(stats_selection.max_sac, true).append(tr("/min")));
else
ui->sacLimits->setMaximum("");
- if (stats_selection.min_sac.mliter)
+ if (stats_selection.min_sac.mliter && (stats_selection.min_sac.mliter != stats_selection.avg_sac.mliter))
ui->sacLimits->setMinimum(get_volume_string(stats_selection.min_sac, true).append(tr("/min")));
else
ui->sacLimits->setMinimum("");