summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveList.qml
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets/qml/DiveList.qml')
-rw-r--r--mobile-widgets/qml/DiveList.qml11
1 files changed, 10 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml
index cda60bf59..72d9d2da9 100644
--- a/mobile-widgets/qml/DiveList.qml
+++ b/mobile-widgets/qml/DiveList.qml
@@ -271,6 +271,15 @@ Kirigami.ScrollablePage {
manager.addDiveToTrip(currentItem.myData.id, currentItem.myData.tripBelow)
}
}
+ property QtObject createTripForDiveAction: Kirigami.Action {
+ text: visible ? qsTr("Create trip with dive %1").arg(currentItem.myData.number) : ""
+ icon { name: ":/icons/list-add" }
+ visible: currentItem && currentItem.myData && !currentItem.myData.isTrip && currentItem.myData.isTopLevel
+ onTriggered: {
+ manager.addTripForDive(currentItem.myData.id)
+ }
+ }
+
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" }
@@ -316,7 +325,7 @@ Kirigami.ScrollablePage {
enabled: manager.redoText !== ""
onTriggered: manager.redo()
}
- property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, toggleInvalidAction, deleteAction, mapAction, tripDetailsEdit, undoAction, redoAction ]
+ property variant contextactions: [ removeDiveFromTripAction, createTripForDiveAction, 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) {