From 37e3e7e69a289db8c435a9d87188267c06703e11 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 1 Nov 2016 17:00:06 +0100 Subject: Deco mode for plannining is not deco mode for showing We had (in the wrong place, imo) a new feature that should differentiate the different deco_modes, you could plan your dive in buelhman and see it in vpm-b, for instance but both of them accessed the same pref. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- profile-widget/divetooltipitem.cpp | 5 ++++- profile-widget/profilewidget2.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'profile-widget') diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp index cb46e898c..e55ceb269 100644 --- a/profile-widget/divetooltipitem.cpp +++ b/profile-widget/divetooltipitem.cpp @@ -263,8 +263,11 @@ void ToolTipItem::refresh(const QPointF &pos) painter.setBrush(QColor(Qt::red)); painter.drawRect(0,0,16,10); if (entry) { + ProfileWidget2 *view = qobject_cast(scene()->views().first()); + Q_ASSERT(view); + painter.setPen(QColor(0, 0, 0, 255)); - if (prefs.deco_mode == BUEHLMANN) + if ((view->currentState == ProfileWidget2::PLAN && prefs.deco_mode == BUEHLMANN) || prefs.display_deco_mode == BUEHLMANN) painter.drawLine(0, 60 - entry->gfline / 2, 16, 60 - entry->gfline / 2); painter.drawLine(0, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure / 2, 16, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure /2); diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 65bdb0969..44e06eafb 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -558,7 +558,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) // this copies the dive and makes copies of all the relevant additional data copy_dive(d, &displayed_dive); #ifndef SUBSURFACE_MOBILE - if (prefs.deco_mode == VPMB) + if ((currentState == PLAN && prefs.deco_mode == VPMB) || prefs.display_deco_mode == VPMB) decoModelParameters->setText(QString("VPM-B +%1").arg(prefs.vpmb_conservatism)); else decoModelParameters->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh)); @@ -570,7 +570,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) plannerModel->deleteTemporaryPlan(); return; } - if (prefs.deco_mode == VPMB) + if ((currentState == PLAN && prefs.deco_mode == VPMB) || prefs.display_deco_mode == VPMB) decoModelParameters->setText(QString("VPM-B +%1").arg(diveplan.vpmb_conservatism)); else decoModelParameters->setText(QString("GF %1/%2").arg(diveplan.gflow).arg(diveplan.gfhigh)); -- cgit v1.2.3-70-g09d2