Commit e02477eb authored by Volker Krause's avatar Volker Krause

Unify boarding pass buttons

parent 8e4c62d6
......@@ -79,6 +79,19 @@ App.TimelineDelegate {
text: qsTr("Arrival: %1").arg(Localizer.formatDateTime(reservation.reservationFor, "arrivalTime"))
color: Kirigami.Theme.textColor
}
QQC2.Button {
Layout.alignment: Qt.AlignHCenter
text: root.passId !== "" ? qsTr("Boarding Pass") : qsTr("🎫 Ticket")
onClicked: {
if (root.passId !== "")
showBoardingPass();
else
showTicket();
}
visible: root.passId !== "" || (root.reservation.reservedTicket != undefined && root.reservation.reservedTicket.ticketToken != "")
icon.source: root.passId !== "" ? "image://org.kde.pkpass/" + passId + "/icon" : ""
}
}
}
......
......@@ -96,11 +96,15 @@ App.TimelineDelegate {
QQC2.Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Boarding Pass")
onClicked: showBoardingPass()
visible: root.passId !== ""
text: root.passId !== "" ? qsTr("Boarding Pass") : qsTr("🎫 Ticket")
onClicked: {
if (root.passId !== "")
showBoardingPass();
else
showTicket();
}
visible: root.passId !== "" || (root.reservation.reservedTicket != undefined && root.reservation.reservedTicket.ticketToken != "")
icon.source: root.passId !== "" ? "image://org.kde.pkpass/" + passId + "/icon" : ""
}
}
}
......@@ -86,9 +86,15 @@ App.TimelineDelegate {
QQC2.Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("🎫 Ticket")
onClicked: root.showTicket()
visible: root.reservation.reservedTicket != undefined && root.reservation.reservedTicket.ticketToken != ""
text: root.passId !== "" ? qsTr("Boarding Pass") : qsTr("🎫 Ticket")
onClicked: {
if (root.passId !== "")
showBoardingPass();
else
showTicket();
}
visible: root.passId !== "" || (root.reservation.reservedTicket != undefined && root.reservation.reservedTicket.ticketToken != "")
icon.source: 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