From f0164e97a2d769aa63263756e53ccbf37e9bd0e5 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sun, 16 Dec 2018 21:01:25 +0100 Subject: [PATCH] Show average max depth in statistics tab This makes more sense than average depth. The min entry is also about max depth for a dive. Signed-off-by: Robert C. Helling --- desktop-widgets/tab-widgets/TabDiveStatistics.cpp | 14 +++++--------- desktop-widgets/tab-widgets/TabDiveStatistics.ui | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp index 67e80ed24..1b3fe9522 100644 --- a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp +++ b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp @@ -48,17 +48,13 @@ void TabDiveStatistics::updateData() calculate_stats_selected(&stats_selection); clear(); ui->depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true)); - if (amount_selected > 1) + if (amount_selected > 1) { ui->depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true)); - else + ui->depthLimits->setAverage(get_depth_string(stats_selection.combined_max_depth.mm / stats_selection.selection_size, 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)); - - // Also hide the avgIco, so its clear that its not there. - ui->depthLimits->overrideAvgToolTipText(""); - ui->depthLimits->setAvgVisibility(false); + ui->depthLimits->setAverage(""); + } 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"))); diff --git a/desktop-widgets/tab-widgets/TabDiveStatistics.ui b/desktop-widgets/tab-widgets/TabDiveStatistics.ui index d954dca3b..1be4bbcfc 100644 --- a/desktop-widgets/tab-widgets/TabDiveStatistics.ui +++ b/desktop-widgets/tab-widgets/TabDiveStatistics.ui @@ -70,7 +70,7 @@ - Depth + Max. depth