summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/DiveDetailsEdit.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/DiveDetailsEdit.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/DiveDetailsEdit.qml')
-rw-r--r--qt-mobile/qml/DiveDetailsEdit.qml3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-mobile/qml/DiveDetailsEdit.qml b/qt-mobile/qml/DiveDetailsEdit.qml
index 3acf8ba98..90ca304e5 100644
--- a/qt-mobile/qml/DiveDetailsEdit.qml
+++ b/qt-mobile/qml/DiveDetailsEdit.qml
@@ -139,6 +139,7 @@ Item {
}
TextField {
id: txtWeight
+ readOnly: (text == "cannot edit multiple weight systems" ? true : false)
Layout.fillWidth: true
}
@@ -167,7 +168,7 @@ Item {
// apply the changes to the dive_table
manager.commitChanges(dive_id, detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, detailsEdit.durationText,
detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, detailsEdit.suitText,
- detailsEdit.buddyText, detailsEdit.divemasterText, detailsEdit.notesText)
+ detailsEdit.buddyText, detailsEdit.divemasterText, detailsEdit.weightText, detailsEdit.notesText)
// apply the changes to the dive detail view - since the edit could have changed the order
// first make sure that we are looking at the correct dive - our model allows us to look
// up the index based on the unique dive_id