Commit 17424dc4 authored by Volker Krause's avatar Volker Krause
Browse files

Allow to delete time-less Apple Wallet passes

parent 8e97287a
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.17 as Kirigami
import org.kde.itinerary 1.0
import "." as App
PkPassPage {
property string genericPassId
Kirigami.OverlaySheet {
id: deleteWarningSheet
header: Kirigami.Heading {
text: i18n("Delete Pass")
}
QQC2.Label {
text: i18n("Do you really want to delete this pass?")
wrapMode: Text.WordWrap
}
footer: RowLayout {
QQC2.Button {
Layout.alignment: Qt.AlignHCenter
text: i18n("Delete")
icon.name: "edit-delete"
onClicked: {
PassManager.remove(genericPassId)
applicationWindow().pageStack.pop();
}
}
}
}
actions.contextualActions: [
Kirigami.Action {
icon.name: "edit-delete"
text: i18n("Delete")
onTriggered: deleteWarningSheet.open()
}
]
}
......@@ -21,7 +21,7 @@ Kirigami.ScrollablePage {
}
Component {
id: pkpassComponent
App.PkPassPage {}
App.GenericPkPassPage {}
}
Models.DelegateChooser {
......@@ -53,7 +53,7 @@ Kirigami.ScrollablePage {
subtitle: pkPass.organizationName
icon: "image://org.kde.pkpass/" + pkPassId + "/icon"
reserveSpaceForIcon: true
onClicked: applicationWindow().pageStack.push(pkpassComponent, { passId: pkPassId, pass: pkPass });
onClicked: applicationWindow().pageStack.push(pkpassComponent, { passId: pkPassId, pass: pkPass, genericPassId: model.passId });
}
}
}
......
......@@ -33,6 +33,7 @@
<file>FlightEditor.qml</file>
<file>FlightPage.qml</file>
<file>GenericPass.qml</file>
<file>GenericPkPassPage.qml</file>
<file>HealthCertificateBarcode.qml</file>
<file>HealthCertificateRecovery.qml</file>
<file>HealthCertificatePage.qml</file>
......
Supports Markdown
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