Commit 91e7038d authored by Volker Krause's avatar Volker Krause

Ask for confirmation before deleting an element

parent 8574ca12
......@@ -29,15 +29,33 @@ Kirigami.ScrollablePage {
property variant reservation
property string passId
Kirigami.OverlaySheet {
id: deleteWarningSheet
QQC2.Label {
text: qsTr("Do you really want to delete this event?")
wrapMode: Text.WordWrap
}
footer: RowLayout {
QQC2.Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Delete")
icon.name: "edit-delete"
onClicked: {
_reservationManager.removeReservation(root.resId)
applicationWindow().pageStack.pop()
}
}
}
}
actions {
contextualActions: [
Kirigami.Action {
iconName: "edit-delete"
text: qsTr("Delete")
onTriggered: {
_reservationManager.removeReservation(root.resId)
applicationWindow().pageStack.pop()
}
onTriggered: deleteWarningSheet.sheetOpen = true
},
Kirigami.Action {
iconSource: root.passId !== "" ? "image://org.kde.pkpass/" + passId + "/icon" : ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment