diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-24 11:22:48 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-26 08:38:40 -0800 |
commit | 8d322218a8addd99c8daf84f507fe0f45d21a7d1 (patch) | |
tree | b7448a9be37a96dd77681ec2123eb746c17efba6 /backend-shared | |
parent | b877dd973cd787464875f0329c6472bf7f508e01 (diff) | |
download | subsurface-8d322218a8addd99c8daf84f507fe0f45d21a7d1.tar.gz |
plannerShared: add variables that reference qPrefDiveplanner
These are simple pass-through functions (normally optimized away
by the compiler), and serve to make a consistent backend interface
which have a simpler use especially in QML.
Variables:
dobailout
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'backend-shared')
-rw-r--r-- | backend-shared/plannershared.cpp | 10 | ||||
-rw-r--r-- | backend-shared/plannershared.h | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp index 2420fdedc..9bb8ad315 100644 --- a/backend-shared/plannershared.cpp +++ b/backend-shared/plannershared.cpp @@ -113,3 +113,13 @@ void plannerShared::set_vpmb_conservatism(int value) { DivePlannerPointsModel::instance()->setVpmbConservatism(value); } + +bool plannerShared::dobailout() +{ + return qPrefDivePlanner::dobailout(); +} +void plannerShared::set_dobailout(bool value) +{ + qPrefDivePlanner::set_dobailout(value); + DivePlannerPointsModel::instance()->emitDataChanged(); +} diff --git a/backend-shared/plannershared.h b/backend-shared/plannershared.h index b38b31f1d..0c2d5500a 100644 --- a/backend-shared/plannershared.h +++ b/backend-shared/plannershared.h @@ -31,6 +31,7 @@ class plannerShared: public QObject { Q_PROPERTY(int gflow READ gflow WRITE set_gflow NOTIFY gflowChanged); Q_PROPERTY(int gfhigh READ gfhigh WRITE set_gfhigh NOTIFY gfhighChanged); Q_PROPERTY(int vpmb_conservatism READ vpmb_conservatism WRITE set_vpmb_conservatism NOTIFY vpmb_conservatismChanged); + Q_PROPERTY(bool dobailout READ dobailout WRITE set_dobailout NOTIFY dobailoutChanged); public: static plannerShared *instance(); @@ -49,6 +50,7 @@ public: static int gflow(); static int gfhigh(); static int vpmb_conservatism(); + static bool dobailout(); public slots: // Ascend/Descend data, converted to meter/feet depending on user selection @@ -65,6 +67,7 @@ public slots: static void set_gflow(int value); static void set_gfhigh(int value); static void set_vpmb_conservatism(int value); + static void set_dobailout(bool value); signals: // Ascend/Descend data, converted to meter/feet depending on user selection @@ -81,6 +84,7 @@ signals: void gflowChanged(int value); void gfhighChanged(int value); void vpmb_conservatismChanged(int value); + void dobailoutChanged(bool value); private: plannerShared() {} |