summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/DiveDetails.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-05 22:54:47 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-05 22:54:47 -0800
commita4ec5206017b668842d2b9b317300b94dcb43057 (patch)
tree1adb3927c00ad39336b21da2f300cdbcae6b877f /qt-mobile/qml/DiveDetails.qml
parentad7fb80d0ac874e55ce91e5845f85aa12906941f (diff)
downloadsubsurface-a4ec5206017b668842d2b9b317300b94dcb43057.tar.gz
QML UI: enable editing of weight
But only if there is only one weight system defined in the dive. Otherwise display a read only text that explains that this cannot be edited. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml/DiveDetails.qml')
-rw-r--r--qt-mobile/qml/DiveDetails.qml9
1 files changed, 8 insertions, 1 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index aab113eef..ef51a71b2 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -70,7 +70,14 @@ MobileComponents.Page {
buddy = diveDetailsListView.currentItem.modelData.dive.buddy
divemaster = diveDetailsListView.currentItem.modelData.dive.divemaster
notes = diveDetailsListView.currentItem.modelData.dive.notes
- weight = diveDetailsListView.currentItem.modelData.dive.sumWeight
+ if (diveDetailsListView.currentItem.modelData.dive.singleWeight) {
+ // we have only one weight, go ahead, have fun and edit it
+ weight = diveDetailsListView.currentItem.modelData.dive.sumWeight
+ } else {
+ // careful when translating, this text is "magic" in DiveDetailsEdit.qml
+ weight = "cannot edit multiple weight systems"
+ }
+
diveDetailsPage.state = "edit"
}
}