summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2016-09-24 18:02:08 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-09-24 08:30:11 -0700
commit7e09a6c7bcb135d65b3e48f2aee44791dd080443 (patch)
treed1a3620e9084cf335f711fdf0b4ca397914117a3 /qt-models
parent7b891904e77364719471098a7bdf4eacc589807c (diff)
downloadsubsurface-7e09a6c7bcb135d65b3e48f2aee44791dd080443.tar.gz
Separate VPM-B conservatism preference for planner and profile
Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for planning dives and prefs.vpmb_conservatism for profile ceiling display of saved dives. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/diveplannermodel.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 10713f36f..10f2d5f52 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -185,8 +185,10 @@ void DivePlannerPointsModel::setPlanMode(Mode m)
mode = m;
// the planner may reset our GF settings that are used to show deco
// reset them to what's in the preferences
- if (m != PLAN)
+ if (m != PLAN) {
set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
+ set_vpmb_conservatism(prefs.vpmb_conservatism);
+ }
}
bool DivePlannerPointsModel::isPlanner()
@@ -423,8 +425,10 @@ void DivePlannerPointsModel::triggerGFLow()
void DivePlannerPointsModel::setVpmbConservatism(int level)
{
- prefs.vpmb_conservatism = level;
- emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
+ if (diveplan.vpmb_conservatism != level) {
+ diveplan.vpmb_conservatism = level;
+ emitDataChanged();
+ }
}
void DivePlannerPointsModel::setSurfacePressure(int pressure)