diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-17 18:40:08 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-17 18:44:51 +0000 |
commit | 3ddbab6847c23bc020fd3eaac2a9b1e10350459f (patch) | |
tree | a84feb216f018e8fea31a1693bace241b2e47ca0 /qt-ui/maintab.cpp | |
parent | f5bea8fcfd2b9baa7ddd6b5f7c892d07139f29eb (diff) | |
download | subsurface-3ddbab6847c23bc020fd3eaac2a9b1e10350459f.tar.gz |
Clarify the meaning of the values in the stats tab
Extend the tooltips to be shown both on the labels and the values and add
tooltips for all min/avg/max elements.
To avoid confusion when only one dive is selected, no longer show min SAC
or max SAC or min duration or max duration.
Fixes #694
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index cbd368798..3c7489f73 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -541,11 +541,11 @@ void MainTab::updateDiveInfo(bool clear) // ui.depthLimits->setAverage(get_depth_string(stats_selection.avg_depth, true)); ui.depthLimits->overrideMaxToolTipText(tr("Deepest dive")); ui.depthLimits->overrideMinToolTipText(tr("Shallowest dive")); - if (stats_selection.max_sac.mliter) + if (amount_selected > 1 && stats_selection.max_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 (amount_selected > 1 && stats_selection.min_sac.mliter) ui.sacLimits->setMinimum(get_volume_string(stats_selection.min_sac, true).append(tr("/min"))); else ui.sacLimits->setMinimum(""); @@ -553,6 +553,9 @@ void MainTab::updateDiveInfo(bool clear) ui.sacLimits->setAverage(get_volume_string(stats_selection.avg_sac, true).append(tr("/min"))); else ui.sacLimits->setAverage(""); + ui.sacLimits->overrideMaxToolTipText(tr("Highest total SAC of a dive")); + ui.sacLimits->overrideMinToolTipText(tr("Lowest total SAC of a dive")); + ui.sacLimits->overrideAvgToolTipText(tr("Average total SAC of all selected dives")); ui.divesAllText->setText(QString::number(stats_selection.selection_size)); temp.mkelvin = stats_selection.max_temp; ui.tempLimits->setMaximum(get_temperature_string(temp, true)); @@ -563,13 +566,21 @@ void MainTab::updateDiveInfo(bool clear) get_temp_units(0, &unit); ui.tempLimits->setAverage(QString("%1%2").arg(stats_selection.combined_temp / stats_selection.combined_count, 0, 'f', 1).arg(unit)); } + ui.tempLimits->overrideMaxToolTipText(tr("Highest temperature")); + ui.tempLimits->overrideMinToolTipText(tr("Lowest temperature")); + ui.tempLimits->overrideAvgToolTipText(tr("Average temperature of all selected dives")); ui.totalTimeAllText->setText(get_time_string(stats_selection.total_time.seconds, 0)); int seconds = stats_selection.total_time.seconds; if (stats_selection.selection_size) seconds /= stats_selection.selection_size; ui.timeLimits->setAverage(get_time_string(seconds, 0)); - ui.timeLimits->setMaximum(get_time_string(stats_selection.longest_time.seconds, 0)); - ui.timeLimits->setMinimum(get_time_string(stats_selection.shortest_time.seconds, 0)); + if (amount_selected > 1) { + ui.timeLimits->setMaximum(get_time_string(stats_selection.longest_time.seconds, 0)); + ui.timeLimits->setMinimum(get_time_string(stats_selection.shortest_time.seconds, 0)); + } + ui.timeLimits->overrideMaxToolTipText(tr("Longest dive")); + ui.timeLimits->overrideMinToolTipText(tr("Shortest dive")); + ui.timeLimits->overrideAvgToolTipText(tr("Average length of all selected dives")); // now let's get some gas use statistics QVector<QPair<QString, int> > gasUsed; QString gasUsedString; |