summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--backend-shared/plannershared.cpp45
-rw-r--r--backend-shared/plannershared.h28
-rw-r--r--desktop-widgets/diveplanner.cpp8
-rw-r--r--mobile-widgets/qml/DivePlannerSetup.qml20
-rw-r--r--mobile-widgets/qmlinterface.cpp11
-rw-r--r--mobile-widgets/qmlinterface.h25
6 files changed, 49 insertions, 88 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp
index bf92f21a2..622953dfd 100644
--- a/backend-shared/plannershared.cpp
+++ b/backend-shared/plannershared.cpp
@@ -214,51 +214,6 @@ void plannerShared::set_bestmixend(int value)
CylindersModel::instance()->updateBestMixes();
}
-bool plannerShared::display_runtime()
-{
- return qPrefDivePlanner::display_runtime();
-}
-void plannerShared::set_display_runtime(bool value)
-{
- DivePlannerPointsModel::instance()->setDisplayRuntime(value);
-}
-
-bool plannerShared::display_duration()
-{
- return qPrefDivePlanner::display_duration();
-}
-void plannerShared::set_display_duration(bool value)
-{
- DivePlannerPointsModel::instance()->setDisplayDuration(value);
-}
-
-bool plannerShared::display_transitions()
-{
- return qPrefDivePlanner::display_transitions();
-}
-void plannerShared::set_display_transitions(bool value)
-{
- DivePlannerPointsModel::instance()->setDisplayTransitions(value);
-}
-
-bool plannerShared::verbatim_plan()
-{
- return qPrefDivePlanner::verbatim_plan();
-}
-void plannerShared::set_verbatim_plan(bool value)
-{
- DivePlannerPointsModel::instance()->setVerbatim(value);
-}
-
-bool plannerShared::display_variations()
-{
- return qPrefDivePlanner::display_variations();
-}
-void plannerShared::set_display_variations(bool value)
-{
- DivePlannerPointsModel::instance()->setDisplayVariations(value);
-}
-
// Handle when user changes length measurement type
void plannerShared::unit_lengthChangedSlot(int value)
{
diff --git a/backend-shared/plannershared.h b/backend-shared/plannershared.h
index d044cf987..1062dc85f 100644
--- a/backend-shared/plannershared.h
+++ b/backend-shared/plannershared.h
@@ -39,13 +39,6 @@ class plannerShared: public QObject {
Q_PROPERTY(double decopo2 READ decopo2 WRITE set_decopo2 NOTIFY decopo2Changed);
Q_PROPERTY(int bestmixend READ bestmixend WRITE set_bestmixend NOTIFY bestmixendChanged);
- // Notes data
- Q_PROPERTY(bool display_runtime READ display_runtime WRITE set_display_runtime NOTIFY display_runtimeChanged);
- Q_PROPERTY(bool display_duration READ display_duration WRITE set_display_duration NOTIFY display_durationChanged);
- Q_PROPERTY(bool display_transitions READ display_transitions WRITE set_display_transitions NOTIFY display_transitionsChanged);
- Q_PROPERTY(bool verbatim_plan READ verbatim_plan WRITE set_verbatim_plan NOTIFY verbatim_planChanged);
- Q_PROPERTY(bool display_variations READ display_variations WRITE set_display_variations NOTIFY display_variationsChanged);
-
public:
static plannerShared *instance();
@@ -73,13 +66,6 @@ public:
static double decopo2();
static int bestmixend();
- // Notes data
- static bool display_runtime();
- static bool display_duration();
- static bool display_transitions();
- static bool verbatim_plan();
- static bool display_variations();
-
public slots:
// Planning data
@@ -106,13 +92,6 @@ public slots:
static void set_decopo2(double value);
static void set_bestmixend(int value);
- // Notes data
- static void set_display_runtime(bool value);
- static void set_display_duration(bool value);
- static void set_display_transitions(bool value);
- static void set_verbatim_plan(bool value);
- static void set_display_variations(bool value);
-
signals:
// Planning data
void planner_deco_modeChanged(deco_mode value);
@@ -138,13 +117,6 @@ signals:
void decopo2Changed(double value);
void bestmixendChanged(int value);
- // Notes data
- void display_runtimeChanged(bool value);
- void display_durationChanged(bool value);
- void display_transitionsChanged(bool value);
- void verbatim_planChanged(bool value);
- void display_variationsChanged(bool value);
-
private slots:
static void unit_lengthChangedSlot(int value);
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index b3c4fe631..1d1da27f2 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -461,10 +461,10 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.lastStop, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_last_stop);
connect(ui.lastStop, &QAbstractButton::toggled, this, &PlannerSettingsWidget::disableBackgasBreaks);
- connect(ui.verbatim_plan, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_verbatim_plan);
- connect(ui.display_duration, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_display_duration);
- connect(ui.display_runtime, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_display_runtime);
- connect(ui.display_transitions, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_display_transitions);
+ connect(ui.verbatim_plan, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setVerbatim);
+ connect(ui.display_duration, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setDisplayDuration);
+ connect(ui.display_runtime, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setDisplayRuntime);
+ connect(ui.display_transitions, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setDisplayTransitions);
connect(ui.safetystop, &QAbstractButton::toggled, plannerShared::instance(), &plannerShared::set_safetystop);
connect(ui.reserve_gas, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_reserve_gas);
connect(ui.ascRate75, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate75Display);
diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml
index ec1e14ca4..870444275 100644
--- a/mobile-widgets/qml/DivePlannerSetup.qml
+++ b/mobile-widgets/qml/DivePlannerSetup.qml
@@ -331,37 +331,37 @@ Kirigami.ScrollablePage {
TemplateCheckBox {
text: qsTr("Display runtime")
- checked: Planner.display_runtime
+ checked: Backend.display_runtime
onClicked: {
- Planner.display_runtime = checked
+ Backend.display_runtime = checked
}
}
TemplateCheckBox {
text: qsTr("Display segment duration")
- checked: Planner.display_duration
+ checked: Backend.display_duration
onClicked: {
- Planner.display_duration = checked
+ Backend.display_duration = checked
}
}
TemplateCheckBox {
text: qsTr("Display transitions in deco")
- checked: Planner.display_transitions
+ checked: Backend.display_transitions
onClicked: {
- Planner.display_transitions = checked
+ Backend.display_transitions = checked
}
}
TemplateCheckBox {
text: qsTr("Verbatim dive plan")
- checked: Planner.verbatim_plan
+ checked: Backend.verbatim_plan
onClicked: {
- Planner.verbatim_plan = checked
+ Backend.verbatim_plan = checked
}
}
TemplateCheckBox {
text: qsTr("Display plan variations")
- checked: Planner.display_variations
+ checked: Backend.display_variations
onClicked: {
- Planner.display_variations = checked
+ Backend.display_variations = checked
}
}
}
diff --git a/mobile-widgets/qmlinterface.cpp b/mobile-widgets/qmlinterface.cpp
index e422a5856..277db13ef 100644
--- a/mobile-widgets/qmlinterface.cpp
+++ b/mobile-widgets/qmlinterface.cpp
@@ -47,4 +47,15 @@ void QMLInterface::setup(QQmlContext *ct)
instance(), &QMLInterface::ascrate75Changed);
connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::descrateChanged,
instance(), &QMLInterface::descrateChanged);
+
+ connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_runtimeChanged,
+ instance(), &QMLInterface::display_runtimeChanged);
+ connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_durationChanged,
+ instance(), &QMLInterface::display_durationChanged);
+ connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_transitionsChanged,
+ instance(), &QMLInterface::display_transitionsChanged);
+ connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::verbatim_planChanged,
+ instance(), &QMLInterface::verbatim_planChanged);
+ connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_variationsChanged,
+ instance(), &QMLInterface::display_variationsChanged);
}
diff --git a/mobile-widgets/qmlinterface.h b/mobile-widgets/qmlinterface.h
index 7d96785bf..670512b6f 100644
--- a/mobile-widgets/qmlinterface.h
+++ b/mobile-widgets/qmlinterface.h
@@ -43,6 +43,12 @@ 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(bool display_runtime READ display_runtime WRITE set_display_runtime NOTIFY display_runtimeChanged);
+ Q_PROPERTY(bool display_duration READ display_duration WRITE set_display_duration NOTIFY display_durationChanged);
+ Q_PROPERTY(bool display_transitions READ display_transitions WRITE set_display_transitions NOTIFY display_transitionsChanged);
+ Q_PROPERTY(bool verbatim_plan READ verbatim_plan WRITE set_verbatim_plan NOTIFY verbatim_planChanged);
+ Q_PROPERTY(bool display_variations READ display_variations WRITE set_display_variations NOTIFY display_variationsChanged);
+
public:
static QMLInterface *instance();
@@ -134,6 +140,12 @@ public:
int ascrate75() { return DivePlannerPointsModel::instance()->ascrate75Display(); }
int descrate() { return DivePlannerPointsModel::instance()->descrateDisplay(); }
+ bool display_runtime() { return prefs.display_runtime; }
+ bool display_duration() { return prefs.display_duration; }
+ bool display_transitions() { return prefs.display_transitions; }
+ bool verbatim_plan() { return prefs.verbatim_plan; }
+ bool display_variations() { return prefs.display_variations; }
+
public slots:
void set_cloud_verification_status(CLOUD_STATUS value) { qPrefCloudStorage::set_cloud_verification_status(value); }
void set_duration_units(DURATION value) { qPrefUnits::set_duration_units((units::DURATION)value); }
@@ -151,6 +163,12 @@ public slots:
void set_ascrate75(int value) { DivePlannerPointsModel::instance()->setAscrate75Display(value); }
void set_descrate(int value) { DivePlannerPointsModel::instance()->setDescrateDisplay(value); }
+ void set_display_runtime(bool value) { DivePlannerPointsModel::instance()->setDisplayRuntime(value); }
+ void set_display_duration(bool value) { DivePlannerPointsModel::instance()->setDisplayDuration(value); }
+ void set_display_transitions(bool value) { DivePlannerPointsModel::instance()->setDisplayTransitions(value); }
+ void set_verbatim_plan(bool value) { DivePlannerPointsModel::instance()->setVerbatim(value); }
+ void set_display_variations(bool value) { DivePlannerPointsModel::instance()->setDisplayVariations(value); }
+
signals:
void cloud_verification_statusChanged(CLOUD_STATUS);
void duration_unitsChanged(DURATION);
@@ -168,8 +186,13 @@ signals:
void ascrate75Changed(int);
void descrateChanged(int);
+ void display_runtimeChanged(bool value);
+ void display_durationChanged(bool value);
+ void display_transitionsChanged(bool value);
+ void verbatim_planChanged(bool value);
+ void display_variationsChanged(bool value);
+
private:
QMLInterface() {}
};
#endif // QMLINTERFACE_H
-