summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveDetailsEdit.qml
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-01-10 08:25:37 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-10 09:25:57 -0700
commit57b96490b2c5b81023439046dea225b8caf09946 (patch)
tree3c5a811d23fbd80720de18331786ab1b56222407 /mobile-widgets/qml/DiveDetailsEdit.qml
parent200932189451d52e277004871004e3b2a0593e58 (diff)
downloadsubsurface-57b96490b2c5b81023439046dea225b8caf09946.tar.gz
mobile/undo: create EditDive command
Command that just swaps two dives. This is rather complex, as for example a dive site might be created. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qml/DiveDetailsEdit.qml')
-rw-r--r--mobile-widgets/qml/DiveDetailsEdit.qml19
1 files changed, 1 insertions, 18 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml
index ceeaedaf6..070db7a62 100644
--- a/mobile-widgets/qml/DiveDetailsEdit.qml
+++ b/mobile-widgets/qml/DiveDetailsEdit.qml
@@ -112,29 +112,12 @@ Item {
detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText,
suitBox.editText, buddyBox.editText, divemasterBox.editText,
detailsEdit.weightText, detailsEdit.notesText, startpressure,
- endpressure, usedGas, usedCyl ,
+ endpressure, usedGas, usedCyl,
detailsEdit.rating,
detailsEdit.visibility, state)
// trigger the profile to be redrawn
QMLProfile.diveId = dive_id
- // 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
- var newIdx = diveModel.getIdxForId(dive_id)
- diveDetailsListView.currentIndex = newIdx
- diveDetailsListView.currentItem.modelData.date = detailsEdit.dateText
- diveDetailsListView.currentItem.modelData.location = locationBox.currentText
- diveDetailsListView.currentItem.modelData.duration = detailsEdit.durationText
- diveDetailsListView.currentItem.modelData.depth = detailsEdit.depthText
- diveDetailsListView.currentItem.modelData.airtemp = detailsEdit.airtempText
- diveDetailsListView.currentItem.modelData.watertemp = detailsEdit.watertempText
- diveDetailsListView.currentItem.modelData.suit = suitBox.currentText
- diveDetailsListView.currentItem.modelData.buddy = buddyBox.currentText
- diveDetailsListView.currentItem.modelData.divemaster = divemasterBox.currentText
- diveDetailsListView.currentItem.modelData.notes = detailsEdit.notesText
- diveDetailsListView.currentItem.modelData.rating = detailsEdit.rating
- diveDetailsListView.currentItem.modelData.visibility = detailsEdit.visibility
Qt.inputMethod.hide()
// now make sure we directly show the saved dive (this may be a new dive, or it may have moved)
clearDetailsEdit()