Commit a4982d74 authored by Volker Krause's avatar Volker Krause

Provide access to passes from the details page when present

parent 7713666a
......@@ -84,20 +84,14 @@ App.TimelineDelegate {
text: qsTr("Arrival: %1").arg(Localizer.formatDateTime(reservation.reservationFor, "arrivalTime"))
color: Kirigami.Theme.textColor
}
QQC2.Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Boarding Pass")
onClicked: showBoardingPass();
visible: root.passId !== ""
icon.source: root.passId !== "" ? "image://org.kde.pkpass/" + passId + "/icon" : ""
}
}
Component {
id: detailsComponent
App.BusPage {
reservation: root.reservation
passId: root.passId
pass: root.pass
}
}
......
......@@ -26,6 +26,27 @@ import "." as App
Kirigami.ScrollablePage {
id: root
property variant reservation
property string passId
property variant pass
Component {
id: pkpassComponent
App.PkPassPage {
passId: root.passId
pass: root.pass
}
}
actions {
contextualActions: [
Kirigami.Action {
iconSource: root.passId !== "" ? "image://org.kde.pkpass/" + passId + "/icon" : ""
text: qsTr("Boarding Pass")
visible: root.passId !== ""
onTriggered: applicationWindow().pageStack.push(pkpassComponent);
}
]
}
onBackRequested: pageStack.pop()
}
......@@ -118,6 +118,8 @@ App.TimelineDelegate {
id: detailsComponent
App.FlightPage {
reservation: root.reservation
passId: root.passId
pass: root.pass
}
}
......
......@@ -22,6 +22,7 @@ import "." as App
Kirigami.Page {
property alias passId: pkpass.passId
property alias pass: pkpass.pass
title: qsTr("Boarding Pass")
App.BoardingPass {
x: (parent.width - implicitWidth) / 2
id: pkpass
......
......@@ -89,20 +89,14 @@ App.TimelineDelegate {
place: reservation.reservationFor.arrivalStation
Layout.fillWidth: true
}
QQC2.Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Boarding Pass")
onClicked: showBoardingPass();
visible: root.passId !== ""
icon.source: root.passId !== "" ? "image://org.kde.pkpass/" + passId + "/icon" : ""
}
}
Component {
id: detailsComponent
App.TrainPage {
reservation: root.reservation
passId: root.passId
pass: root.pass
}
}
......
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