summaryrefslogtreecommitdiffstats
path: root/profile-widget/diveprofileitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget/diveprofileitem.cpp')
-rw-r--r--profile-widget/diveprofileitem.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index f567801ce..e46adca18 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -784,6 +784,8 @@ DiveCalculatedCeiling::DiveCalculatedCeiling(ProfileWidget2 *widget) :
profileWidget(widget),
is3mIncrement(false)
{
+ connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::dcceilingChanged, this, &DiveCalculatedCeiling::setVisible);
+ setVisible(prefs.calcceiling);
settingsChanged();
}
@@ -835,7 +837,7 @@ void DiveCalculatedTissue::setVisible(bool visible)
void DiveCalculatedTissue::settingsChanged()
{
- setVisible(prefs.calcalltissues && prefs.calcceiling);
+ DiveCalculatedCeiling::setVisible(prefs.calcalltissues && prefs.calcceiling);
}
void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
@@ -879,12 +881,6 @@ void DiveCalculatedCeiling::settingsChanged()
recalc();
}
is3mIncrement = prefs.calcceiling3m;
- setVisible(prefs.calcceiling);
-}
-
-void DiveReportedCeiling::settingsChanged()
-{
- setVisible(prefs.dcceiling);
}
void DiveReportedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
@@ -956,18 +952,6 @@ PartialPressureGasItem::PartialPressureGasItem() :
{
}
-void PartialPressureGasItem::settingsChanged()
-{
- QSettings s;
- s.beginGroup("TecDetails");
- setVisible(s.value(visibilityKey).toBool());
-}
-
-void PartialPressureGasItem::setVisibilitySettingsKey(const QString &key)
-{
- visibilityKey = key;
-}
-
void PartialPressureGasItem::setColors(const QColor &normal, const QColor &alert)
{
normalColor = normal;