Override the MinMaxAvgWidget tool tips for the depth instance.

Add new methods to the MinMaxAvgWidget class to allow us to override the
default tooltips of its min and max icons, and then uses these methods to
make the tooltips for the Stats tab Depth instance more descriptive.

See #521

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tim Wootton 2014-05-30 23:46:55 +01:00 committed by Dirk Hohndel
parent 89f3532145
commit d825d689dd
3 changed files with 14 additions and 0 deletions

View file

@ -528,6 +528,8 @@ void MainTab::updateDiveInfo(int dive)
ui.depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true));
ui.depthLimits->setMinimum(get_depth_string(stats_selection.min_depth, true));
ui.depthLimits->setAverage(get_depth_string(stats_selection.avg_depth, true));
ui.depthLimits->overrideMaxToolTipText(QObject::tr("Deepest Dive"));
ui.depthLimits->overrideMinToolTipText(QObject::tr("Shallowest Dive"));
ui.sacLimits->setMaximum(get_volume_string(stats_selection.max_sac, true).append(tr("/min")));
ui.sacLimits->setMinimum(get_volume_string(stats_selection.min_sac, true).append(tr("/min")));
ui.sacLimits->setAverage(get_volume_string(stats_selection.avg_sac, true).append(tr("/min")));

View file

@ -112,6 +112,16 @@ void MinMaxAvgWidget::setMinimum(const QString &minimum)
d->minValue->setText(minimum);
}
void MinMaxAvgWidget::overrideMinToolTipText(const QString &newTip)
{
d->minIco->setToolTip(newTip);
}
void MinMaxAvgWidget::overrideMaxToolTipText(const QString &newTip)
{
d->maxIco->setToolTip(newTip);
}
RenumberDialog *RenumberDialog::instance()
{
static RenumberDialog *self = new RenumberDialog(MainWindow::instance());

View file

@ -30,6 +30,8 @@ public:
void setMinimum(const QString &minimum);
void setMaximum(const QString &maximum);
void setAverage(const QString &average);
void overrideMinToolTipText(const QString &newTip);
void overrideMaxToolTipText(const QString &newTip);
void clear();
private: