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>
This commit is contained in:
Dirk Hohndel 2014-11-17 18:40:08 +00:00
parent f5bea8fcfd
commit 3ddbab6847
3 changed files with 24 additions and 4 deletions

View file

@ -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;

View file

@ -112,11 +112,19 @@ void MinMaxAvgWidget::setMinimum(const QString &minimum)
void MinMaxAvgWidget::overrideMinToolTipText(const QString &newTip)
{
d->minIco->setToolTip(newTip);
d->minValue->setToolTip(newTip);
}
void MinMaxAvgWidget::overrideAvgToolTipText(const QString &newTip)
{
d->avgIco->setToolTip(newTip);
d->avgValue->setToolTip(newTip);
}
void MinMaxAvgWidget::overrideMaxToolTipText(const QString &newTip)
{
d->maxIco->setToolTip(newTip);
d->maxValue->setToolTip(newTip);
}
RenumberDialog *RenumberDialog::instance()

View file

@ -33,6 +33,7 @@ public:
void setMaximum(const QString &maximum);
void setAverage(const QString &average);
void overrideMinToolTipText(const QString &newTip);
void overrideAvgToolTipText(const QString &newTip);
void overrideMaxToolTipText(const QString &newTip);
void clear();