diff options
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DivePlannerSetup.qml | 24 | ||||
-rw-r--r-- | mobile-widgets/qmlinterface.cpp | 4 | ||||
-rw-r--r-- | mobile-widgets/qmlinterface.h | 1 |
3 files changed, 19 insertions, 10 deletions
diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml index 294752de3..2c04d4695 100644 --- a/mobile-widgets/qml/DivePlannerSetup.qml +++ b/mobile-widgets/qml/DivePlannerSetup.qml @@ -22,8 +22,8 @@ Kirigami.ScrollablePage { spinDescrate.value = Backend.descrate } onVolumeChanged: { - spinBottomsac.value = Planner.bottomsac - spinDecosac.value = Planner.decosac + spinBottomsac.value = Backend.bottomsac + spinDecosac.value = Backend.decosac } } Column { @@ -227,14 +227,16 @@ Kirigami.ScrollablePage { TemplateSpinBox { id: spinBottomsac from: 1 - to: 99 + to: (Backend.volume === Enums.LITER) ? 85 : 300 stepSize: 1 - value: Planner.bottomsac + value: Backend.bottomsac textFromValue: function (value, locale) { - return value + volumeUnit + return (Backend.volume === Enums.LITER) ? + value + volumeUnit : + (value / 100).toFixed(2) + volumeUnit } onValueModified: { - Planner.bottomsac = value + Backend.bottomsac = value } } TemplateLabel { @@ -243,14 +245,16 @@ Kirigami.ScrollablePage { TemplateSpinBox { id: spinDecosac from: 1 - to: 99 + to: (Backend.volume === Enums.LITER) ? 85 : 300 stepSize: 1 - value: Planner.decosac + value: Backend.decosac textFromValue: function (value, locale) { - return value + volumeUnit + return (Backend.volume === Enums.LITER) ? + value + volumeUnit : + (value / 100).toFixed(2) + volumeUnit } onValueModified: { - Planner.decosac = value + Backend.decosac = value } } TemplateLabel { diff --git a/mobile-widgets/qmlinterface.cpp b/mobile-widgets/qmlinterface.cpp index 04fd0b6d9..99dc54f2f 100644 --- a/mobile-widgets/qmlinterface.cpp +++ b/mobile-widgets/qmlinterface.cpp @@ -65,6 +65,10 @@ void QMLInterface::setup(QQmlContext *ct) connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::problemsolvingtimeChanged, instance(), &QMLInterface::problemsolvingtimeChanged); + connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::bottomsacChanged, + instance(), &QMLInterface::bottomsacChanged); + connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::decosacChanged, + instance(), &QMLInterface::decosacChanged); connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_runtimeChanged, instance(), &QMLInterface::display_runtimeChanged); connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_durationChanged, diff --git a/mobile-widgets/qmlinterface.h b/mobile-widgets/qmlinterface.h index 17b9af0ef..88110937f 100644 --- a/mobile-widgets/qmlinterface.h +++ b/mobile-widgets/qmlinterface.h @@ -6,6 +6,7 @@ #include "core/settings/qPrefDivePlanner.h" #include "core/settings/qPrefTechnicalDetails.h" #include "qt-models/diveplannermodel.h" +#include "backend-shared/plannershared.h" #include <QObject> #include <QQmlContext> |