Commit b17a78c3 authored by Volker Krause's avatar Volker Krause
Browse files

Allow to view the arrival train layout as well

parent 77dcd9e6
......@@ -33,7 +33,6 @@ App.DetailsPage {
id: vehicleLayoutPage
App.VehicleLayoutPage {
publicTransportManager: root.controller.liveDataManager.publicTransportManager
departure: root.departure
selectedVehicleSection: root.reservation.reservedTicket.ticketedSeat.seatSection
selectedClasses: root.reservation.reservedTicket.ticketedSeat.seatingType
seat: root.reservation.reservedTicket.ticketedSeat.seatNumber
......@@ -51,13 +50,24 @@ App.DetailsPage {
}
}
Component {
id: vehicleLayoutAction
id: vehicleDepartureLayoutAction
Kirigami.Action {
text: i18n("Vehicle Layout")
text: i18n("Departure Vehicle Layout")
iconName: "view-list-symbolic"
enabled: departure && departure.route.line.mode == KPublicTransport.Line.LongDistanceTrain
onTriggered: {
applicationWindow().pageStack.push(vehicleLayoutPage);
applicationWindow().pageStack.push(vehicleLayoutPage, {"stopover": root.controller.departure});
}
}
}
Component {
id: vehicleArrivalLayoutAction
Kirigami.Action {
text: i18n("Arrival Vehicle Layout")
iconName: "view-list-symbolic"
enabled: arrival && arrival.route.line.mode == KPublicTransport.Line.LongDistanceTrain
onTriggered: {
applicationWindow().pageStack.push(vehicleLayoutPage, {"stopover": root.controller.arrival});
}
}
}
......@@ -83,7 +93,8 @@ App.DetailsPage {
Component.onCompleted: {
actions.contextualActions.push(alternativeAction.createObject(root));
actions.contextualActions.push(journeyDetailsAction.createObject(root));
actions.contextualActions.push(vehicleLayoutAction.createObject(root));
actions.contextualActions.push(vehicleDepartureLayoutAction.createObject(root));
actions.contextualActions.push(vehicleArrivalLayoutAction.createObject(root));
actions.contextualActions.push(notifyTestAction.createObject(root));
}
......
......@@ -17,7 +17,7 @@ Kirigami.ScrollablePage {
title: i18n("Vehicle Layout")
property alias publicTransportManager: vehicleModel.manager
property var departure
property var stopover
property string selectedVehicleSection
property string selectedClasses
property string seat
......@@ -34,7 +34,7 @@ Kirigami.ScrollablePage {
return c;
}
onDepartureChanged: vehicleModel.request.departure = root.departure;
onStopoverChanged: vehicleModel.request.stopover = root.stopover;
KPublicTransport.VehicleLayoutQueryModel {
id: vehicleModel
......
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