mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
ad7fb80d0a
commit
a4ec520601
4 changed files with 26 additions and 5 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue