From 8c9883cfcf66de99f6a563161918927ae0fb2f00 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Tue, 9 Feb 2016 17:20:17 +0100 Subject: QML UI: enable edit of cylinder pressures First cylinder only, show warning if there are more than one cylinder defined. Signed-off-by: Joakim Bygdell Signed-off-by: Dirk Hohndel --- qt-mobile/qml/DiveDetails.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qt-mobile/qml/DiveDetails.qml') diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml index 162e31b9d..f0e2ff35e 100644 --- a/qt-mobile/qml/DiveDetails.qml +++ b/qt-mobile/qml/DiveDetails.qml @@ -22,6 +22,8 @@ MobileComponents.Page { property alias notes: detailsEdit.notesText property alias suit: detailsEdit.suitText property alias weight: detailsEdit.weightText + property alias startpressure: detailsEdit.startpressureText + property alias endpressure: detailsEdit.endpressureText state: "view" @@ -99,6 +101,14 @@ MobileComponents.Page { // careful when translating, this text is "magic" in DiveDetailsEdit.qml weight = "cannot edit multiple weight systems" } + if (diveDetailsListView.currentItem.modelData.dive.getCylinder != "Multiple" ) { + startpressure = diveDetailsListView.currentItem.modelData.dive.startPressure + endpressure = diveDetailsListView.currentItem.modelData.dive.endPressure + } else { + // careful when translating, this text is "magic" in DiveDetailsEdit.qml + startpressure = "cannot edit multiple cylinders" + endpressure = "cannot edit multiple cylinders" + } diveDetailsPage.state = "edit" } -- cgit v1.2.3-70-g09d2