summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Jan Darowski <jan.darowski@gmail.com>2015-08-15 15:16:51 +0200
committerGravatar Jan Darowski <jan.darowski@gmail.com>2015-08-15 15:16:51 +0200
commit6856e87689c554bfa7ac058451e030fecfe941f5 (patch)
treec3a7dad003dd705891af8e2a489579371f928d36 /qt-models
parentcad866013b6ea8f4bdabc3371b5d319209713fa7 (diff)
downloadsubsurface-6856e87689c554bfa7ac058451e030fecfe941f5.tar.gz
VPM-B: Add conservatism levels to the ui. Fix planner settings disabling.
Conservatism level can now be changed from gui, is saved in settings. Also way of disabling the planner settings in the ui was improved to support more deco models and be called at the widget creation. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/diveplannermodel.cpp6
-rw-r--r--qt-models/diveplannermodel.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index e82daba11..005061feb 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -397,6 +397,12 @@ void DivePlannerPointsModel::triggerGFLow()
}
}
+void DivePlannerPointsModel::setConservatism(int level)
+{
+ prefs.conservatism_level = level;
+ emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
+}
+
void DivePlannerPointsModel::setSurfacePressure(int pressure)
{
diveplan.surface_pressure = pressure;
diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h
index a8524393a..b87ed84c3 100644
--- a/qt-models/diveplannermodel.h
+++ b/qt-models/diveplannermodel.h
@@ -65,6 +65,7 @@ slots:
void triggerGFHigh();
void setGFLow(const int ghflow);
void triggerGFLow();
+ void setConservatism(int level);
void setSurfacePressure(int pressure);
void setSalinity(int salinity);
int getSurfacePressure();