diff options
author | jan Iversen <jan@casacondor.com> | 2020-01-21 16:16:10 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-01-25 17:13:20 -0800 |
commit | 86fd49f2d79f3e199de5261a80e01b34541b96f6 (patch) | |
tree | 0a71311342424f0228e3850b86c5d4651b731d5b /mobile-widgets | |
parent | cd3c2266f9f687746770912bfc913c4f94bb124b (diff) | |
download | subsurface-86fd49f2d79f3e199de5261a80e01b34541b96f6.tar.gz |
diveplanner: adjust sac-factor calculation.
The real values are 1.0 to 10.0, but QML needs int so mobile
gets values 10.0 to 100.0
add sacfactor() to QMLInterface and update QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DivePlannerSetup.qml | 6 | ||||
-rw-r--r-- | mobile-widgets/qmlinterface.cpp | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml index 2c04d4695..a0c4a3176 100644 --- a/mobile-widgets/qml/DivePlannerSetup.qml +++ b/mobile-widgets/qml/DivePlannerSetup.qml @@ -261,15 +261,15 @@ Kirigami.ScrollablePage { text: qsTr("SAC factor") } TemplateSpinBox { - from: 20 + from: 10 to: 99 stepSize: 1 - value: Planner.sacfactor + value: Backend.sacfactor textFromValue: function (value, locale) { return (value / 10).toFixed(1) } onValueModified: { - Planner.sacfactor = value + Backend.sacfactor = value } } TemplateLabel { diff --git a/mobile-widgets/qmlinterface.cpp b/mobile-widgets/qmlinterface.cpp index 99dc54f2f..21ab50494 100644 --- a/mobile-widgets/qmlinterface.cpp +++ b/mobile-widgets/qmlinterface.cpp @@ -69,6 +69,9 @@ void QMLInterface::setup(QQmlContext *ct) instance(), &QMLInterface::bottomsacChanged); connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::decosacChanged, instance(), &QMLInterface::decosacChanged); + connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::sacfactorChanged, + instance(), &QMLInterface::sacfactorChanged); + connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_runtimeChanged, instance(), &QMLInterface::display_runtimeChanged); connect(qPrefDivePlanner::instance(), &qPrefDivePlanner::display_durationChanged, |