Feature to show or hide heart rate graph

Adds new push button "HR" to the button bar on the dive profile to
toggle display of heart rate.

TODO: New icon for the heart rate button is needed.

Fixes #485

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lakshman 2014-04-08 00:00:50 -04:00 committed by Dirk Hohndel
parent 20bde81023
commit 6a8d929876
10 changed files with 70 additions and 9 deletions

View file

@ -221,6 +221,7 @@ DiveHeartrateItem::DiveHeartrateItem()
pen.setCosmetic(true);
pen.setWidth(1);
setPen(pen);
visible = true;
}
void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
@ -297,6 +298,27 @@ void DiveHeartrateItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
painter->drawPolyline(polygon());
}
void DiveHeartrateItem::preferencesChanged()
{
QSettings s;
s.beginGroup("TecDetails");
setVisible(s.value(visibilityKey).toBool());
if (s.value(visibilityKey).toBool())
visible = true;
else
visible = false;
}
void DiveHeartrateItem::setVisibilitySettingsKey(const QString &key)
{
visibilityKey = key;
}
bool DiveHeartrateItem::isVisible()
{
return visible == true;
}
DiveTemperatureItem::DiveTemperatureItem()
{
QPen pen;