summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveList.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-20 15:59:38 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-21 14:31:37 -0700
commit30e6102886a5a8d2fc38d2a1b0d425cdcea0fbe0 (patch)
tree9a4260262693dc39a63b211de1beecd70ae99e3c /mobile-widgets/qml/DiveList.qml
parentc77cc93eecb4ed4663110e97817fe7524046e8aa (diff)
downloadsubsurface-30e6102886a5a8d2fc38d2a1b0d425cdcea0fbe0.tar.gz
mobile/divelist: add UI to toggle dive invalid flag
This reuses the corresponding undo command. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DiveList.qml')
-rw-r--r--mobile-widgets/qml/DiveList.qml8
1 files changed, 7 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml
index 647a11ca1..383e1f930 100644
--- a/mobile-widgets/qml/DiveList.qml
+++ b/mobile-widgets/qml/DiveList.qml
@@ -276,6 +276,12 @@ Kirigami.ScrollablePage {
manager.addDiveToTrip(currentItem.myData.id, currentItem.myData.tripBelow)
}
}
+ property QtObject toggleInvalidAction: Kirigami.Action {
+ text: currentItem && currentItem.myData && currentItem.myData.isInvalid ? qsTr("Mark dive as valid") : qsTr("Mark dive as invalid")
+ // icon: { name: "TBD" }
+ visible: currentItem && currentItem.myData && !currentItem.myData.isTrip
+ onTriggered: manager.toggleDiveInvalid(currentItem.myData.id)
+ }
property QtObject deleteAction: Kirigami.Action {
text: qsTr("Delete dive")
icon { name: ":/icons/trash-empty.svg" }
@@ -315,7 +321,7 @@ Kirigami.ScrollablePage {
enabled: manager.redoText !== ""
onTriggered: manager.redo()
}
- property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, mapAction, tripDetailsEdit, undoAction, redoAction ]
+ property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, toggleInvalidAction, deleteAction, mapAction, tripDetailsEdit, undoAction, redoAction ]
function setupActions() {
if (Backend.cloud_verification_status === Enums.CS_VERIFIED || Backend.cloud_verification_status === Enums.CS_NOCLOUD) {