mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: deal with multiple buddies correctly
When editing adive in Subsurface-mobile we can only handle one buddy due to the limitations of the combobox. To prevent loss of data when editing a dive with more than one buddy we display "Multiple Buddies" in the buddy field. This creates a special case where no changes are written to the buddy field unless the user changes buddy for that dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ed11dab7fb
commit
1219dc6931
3 changed files with 17 additions and 4 deletions
|
@ -156,7 +156,11 @@ Kirigami.Page {
|
|||
airtemp = diveDetailsListView.currentItem.modelData.dive.airTemp
|
||||
watertemp = diveDetailsListView.currentItem.modelData.dive.waterTemp
|
||||
suitIndex = diveDetailsListView.currentItem.modelData.dive.suitList.indexOf(diveDetailsListView.currentItem.modelData.dive.suit)
|
||||
buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
|
||||
if (diveDetailsListView.currentItem.modelData.dive.buddy.search(",")) {
|
||||
buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf("Multiple Buddies");
|
||||
} else {
|
||||
buddyIndex = diveDetailsListView.currentItem.modelData.dive.buddyList.indexOf(diveDetailsListView.currentItem.modelData.dive.buddy)
|
||||
}
|
||||
divemasterIndex = diveDetailsListView.currentItem.modelData.dive.divemasterList.indexOf(diveDetailsListView.currentItem.modelData.dive.divemaster)
|
||||
notes = diveDetailsListView.currentItem.modelData.dive.notes
|
||||
if (diveDetailsListView.currentItem.modelData.dive.singleWeight) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue