From 8f6aaaba25b875ab4ad90ab3164884d22b870d47 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 8 Jan 2020 21:15:57 +0100 Subject: [PATCH] mobile-widgets/qml: graphic layout Planner (Planning) Add all needed graphical elements for DivePlannerSetup planning section. Signed-off-by: jan Iversen --- mobile-widgets/qml/DivePlannerSetup.qml | 164 ++++++++++++++++++------ 1 file changed, 128 insertions(+), 36 deletions(-) diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml index f3d5fa71d..76f085a3d 100644 --- a/mobile-widgets/qml/DivePlannerSetup.qml +++ b/mobile-widgets/qml/DivePlannerSetup.qml @@ -152,51 +152,143 @@ Kirigami.ScrollablePage { columnSpacing: Kirigami.Units.smallSpacing visible: planning.isExpanded - // Only support "Open circuit" TemplateLabel { - text: "WORK in progress" + text: qsTr("Dive mode") } - - TemplateRadioButton { - text: qsTr("Recreational NO deco") + TemplateComboBox { + editable: false + model: ListModel { + ListElement {text: qsTr("Open circuit")} + ListElement {text: qsTr("CCR")} + ListElement {text: qsTr("pSCR")} + } + onActivated: { + } + } + TemplateCheckBox { + text: qsTr("Bailout: Deco on OC") Layout.columnSpan: 2 } - // Reserve gas is 50bar (PADI/SSI rules) - TemplateRadioButton { - text: qsTr("Bühlmann, GFLow/GFHigh:") - } - Row { - spacing: 0 - TemplateSpinBox { - width: planning.width / 2 -30 - from: 1 - to: 99 - stepSize: 1 - value: 15 - textFromValue: function (value, locale) { - return value + qsTr(" %") - } - onValueModified: { - console.log("got value: " + value) - } + TemplateRadioButton { + text: qsTr("Recreational mode") + Layout.columnSpan: 2 + } + + TemplateLabel { + text: qsTr("Reserve gas") + leftPadding: Kirigami.Units.smallSpacing * 2 + } + TemplateSpinBox { + from: 1 + to: 99 + stepSize: 1 + value: 50 + textFromValue: function (value, locale) { + return value + volumeUnit } - TemplateSpinBox { - width: planning.width / 2 -30 - from: 1 - to: 99 - stepSize: 1 - value: 15 - textFromValue: function (value, locale) { - return value + qsTr(" %") - } - onValueModified: { - console.log("got value: " + value) - } + onValueModified: { } } + + TemplateCheckBox { + text: qsTr("Safety stop") + Layout.columnSpan: 2 + leftPadding: Kirigami.Units.smallSpacing * 6 + } + TemplateRadioButton { - text: qsTr("VPM-B, Conservatism:") + text: qsTr("Bühlmannh deco") + Layout.columnSpan: 2 + } + + TemplateLabel { + text: qsTr("GFLow") + leftPadding: Kirigami.Units.smallSpacing * 2 + } + TemplateSpinBox { + from: 1 + to: 99 + stepSize: 1 + value: 50 + textFromValue: function (value, locale) { + return value + volumeUnit + } + onValueModified: { + } + } + + TemplateLabel { + text: qsTr("GFHigh") + leftPadding: Kirigami.Units.smallSpacing * 2 + } + TemplateSpinBox { + from: 1 + to: 99 + stepSize: 1 + value: 50 + textFromValue: function (value, locale) { + return value + volumeUnit + } + onValueModified: { + } + } + + TemplateRadioButton { + text: qsTr("VPM-B deco") + Layout.columnSpan: 2 + } + + TemplateLabel { + text: qsTr("Conservatism level") + leftPadding: 20 + } + TemplateSpinBox { + from: 0 + to: 4 + stepSize: 1 + value: 2 + textFromValue: function (value, locale) { + return qsTr("+") + value + } + onValueModified: { + console.log("got value: " + value) + } + } + + TemplateCheckBox { + text: qsTr("Last stop at ??") + Layout.columnSpan: 2 + } + + TemplateCheckBox { + text: qsTr("Plan backgas breaks") + Layout.columnSpan: 2 + } + + TemplateCheckBox { + text: qsTr("Only switch at required stops") + Layout.columnSpan: 2 + } + + TemplateLabel { + text: qsTr("Min switch time") + } + TemplateSpinBox { + from: 0 + to: 4 + stepSize: 1 + value: 2 + textFromValue: function (value, locale) { + return qsTr("+") + value + } + onValueModified: { + console.log("got value: " + value) + } + } + + TemplateLabel { + text: qsTr("Surface segment") } TemplateSpinBox { from: 0