aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DivePlannerSetup.qml
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-08 11:35:07 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-24 20:23:37 -0800
commit1e14c3f0d38ac8ef9f0726daf1d8f0c990da6ef2 (patch)
treeae99110107d16233da63836ed798fd66425e58af /mobile-widgets/qml/DivePlannerSetup.qml
parent2ef0d23c290bcf2e7f8a9ddd52665c3dc8290dad (diff)
downloadsubsurface-1e14c3f0d38ac8ef9f0726daf1d8f0c990da6ef2.tar.gz
mobile-widgets/qml: add slot for volume change
Catch when volume type is changed and update bottomsac/decosac. Also update text l/min <-> cuft/min and add a space between value and unit. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DivePlannerSetup.qml')
-rw-r--r--mobile-widgets/qml/DivePlannerSetup.qml15
1 files changed, 11 insertions, 4 deletions
diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml
index abf5de363..58bbb1ac9 100644
--- a/mobile-widgets/qml/DivePlannerSetup.qml
+++ b/mobile-widgets/qml/DivePlannerSetup.qml
@@ -10,7 +10,8 @@ import org.kde.kirigami 2.4 as Kirigami
Kirigami.ScrollablePage {
title: qsTr("Dive planner setup")
- property string speedUnit: (Backend.length === Enums.METERS) ? qsTr("m/min") : qsTr("ft/min")
+ property string speedUnit: (Backend.length === Enums.METERS) ? qsTr(" m/min") : qsTr(" ft/min")
+ property string volumeUnit: (Backend.volume === Enums.LITER) ? qsTr(" l/min") : qsTr(" cuft/min")
Connections {
target: Backend
onLengthChanged: {
@@ -20,6 +21,10 @@ Kirigami.ScrollablePage {
spinAscratelast6m.value = Backend.ascratelast6m
spinDescrate.value = Backend.descrate
}
+ onVolumeChanged: {
+ spinBottomsac.value = Planner.bottomsac
+ spinDecosac.value = Planner.decosac
+ }
}
Column {
width: parent.width
@@ -220,12 +225,13 @@ Kirigami.ScrollablePage {
text: qsTr("Bottom SAC")
}
TemplateSpinBox {
+ id: spinBottomsac
from: 1
to: 99
stepSize: 1
value: Planner.bottomsac
textFromValue: function (value, locale) {
- return value + qsTr("l/min")
+ return value + volumeUnit
}
onValueModified: {
Planner.bottomsac = value
@@ -235,12 +241,13 @@ Kirigami.ScrollablePage {
text: qsTr("Deco SAC")
}
TemplateSpinBox {
+ id: spinDecosac
from: 1
to: 99
stepSize: 1
value: Planner.decosac
textFromValue: function (value, locale) {
- return value + qsTr("l/min")
+ return value + volumeUnit
}
onValueModified: {
Planner.decosac = value
@@ -315,7 +322,7 @@ Kirigami.ScrollablePage {
stepSize: 1
value: Planner.bestmixend
textFromValue: function (value, locale) {
- return value + qsTr("m")
+ return value + speedUnit
}
onValueModified: {
Planner.bestmixend = value