summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/maintab.cpp19
-rw-r--r--qt-ui/simplewidgets.cpp8
-rw-r--r--qt-ui/simplewidgets.h1
3 files changed, 24 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;
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index 4b3d789e7..da8a7d014 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -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()
diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h
index 00992d6ec..f9a6fdad3 100644
--- a/qt-ui/simplewidgets.h
+++ b/qt-ui/simplewidgets.h
@@ -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();