From 2d8af34016e815a4208efeaf3c6ed8bda2d4f167 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Tue, 28 Jan 2020 16:31:42 +0100 Subject: mobile-widgets: add dive_mode variable to QML Add dive_move variable to qmlinterface, to make it aviable to QML. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlinterface.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qmlinterface.h b/mobile-widgets/qmlinterface.h index 45a39206e..0669c402c 100644 --- a/mobile-widgets/qmlinterface.h +++ b/mobile-widgets/qmlinterface.h @@ -48,6 +48,7 @@ class QMLInterface : public QObject { Q_PROPERTY(int ascrate75 READ ascrate75 WRITE set_ascrate75 NOTIFY ascrate75Changed); Q_PROPERTY(int descrate READ descrate WRITE set_descrate NOTIFY descrateChanged); + Q_PROPERTY(DIVE_MODE dive_mode READ dive_mode WRITE set_dive_mode NOTIFY dive_modeChanged); Q_PROPERTY(DECO_MODE planner_deco_mode READ planner_deco_mode WRITE set_planner_deco_mode NOTIFY planner_deco_modeChanged); Q_PROPERTY(int reserve_gas READ reserve_gas WRITE set_reserve_gas NOTIFY reserve_gasChanged); Q_PROPERTY(bool safetystop READ safetystop WRITE set_safetystop NOTIFY safetystopChanged); @@ -188,6 +189,7 @@ public: int ascrate75() { return DivePlannerPointsModel::instance()->ascrate75Display(); } int descrate() { return DivePlannerPointsModel::instance()->descrateDisplay(); } + DIVE_MODE dive_mode() { return OC; } DECO_MODE planner_deco_mode() { return (DECO_MODE)plannerShared::planner_deco_mode(); } int reserve_gas() { return plannerShared::reserve_gas(); } bool safetystop() { return prefs.safetystop; } @@ -236,6 +238,7 @@ public slots: void set_ascrate75(int value) { DivePlannerPointsModel::instance()->setAscrate75Display(value); } void set_descrate(int value) { DivePlannerPointsModel::instance()->setDescrateDisplay(value); } + void set_dive_mode(DIVE_MODE value) { DivePlannerPointsModel::instance()->setRebreatherMode((int)value); } void set_planner_deco_mode(DECO_MODE value) { plannerShared::set_planner_deco_mode((deco_mode)value); } void set_reserve_gas(int value) { plannerShared::set_reserve_gas(value); } void set_safetystop(bool value) { DivePlannerPointsModel::instance()->setSafetyStop(value); } @@ -282,6 +285,7 @@ signals: void ascrate75Changed(int); void descrateChanged(int); + void dive_modeChanged(DIVE_MODE value); void planner_deco_modeChanged(DECO_MODE value); void reserve_gasChanged(int value); void safetystopChanged(bool value); -- cgit v1.2.3-70-g09d2