From 2d3f7f0a902f63992a7b5ea5207583adb168439d Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 25 Jan 2016 17:20:18 -0200 Subject: More Profile Itens on the new Settings Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- profile-widget/diveprofileitem.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'profile-widget/diveprofileitem.cpp') 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; -- cgit v1.2.3-70-g09d2