diff --git a/src/app/BusPage.qml b/src/app/BusPage.qml index 3ee54d9..1941065 100644 --- a/src/app/BusPage.qml +++ b/src/app/BusPage.qml @@ -1,104 +1,107 @@ /* Copyright (C) 2018 Volker Krause This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.5 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.1 as QQC2 import org.kde.kirigami 2.4 as Kirigami import org.kde.kitinerary 1.0 import org.kde.itinerary 1.0 import "." as App App.DetailsPage { id: root title: i18n("Bus Ticket") - Kirigami.FormLayout { - width: root.width + ColumnLayout { + width: parent.width QQC2.Label { - Kirigami.FormData.isSection: true + Layout.fillWidth: true text: reservationFor.busName + " " + reservationFor.busNumber horizontalAlignment: Qt.AlignHCenter font.bold: true } // ticket barcode App.TicketTokenDelegate { - Kirigami.FormData.isSection: true resIds: _reservationManager.reservationsForBatch(root.batchId) } - // departure data - Kirigami.Separator { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Departure") - } - QQC2.Label { - Kirigami.FormData.label: i18n("Time:") - text: Localizer.formatDateTime(reservationFor, "departureTime") - } - QQC2.Label { - Kirigami.FormData.label: i18n("Station:") - text: reservationFor.departureBusStop.name - } - App.PlaceDelegate { - place: reservationFor.departureBusStop - } + Kirigami.FormLayout { + Layout.fillWidth: true - // arrival data - Kirigami.Separator { - Kirigami.FormData.label: i18n("Arrival") - Kirigami.FormData.isSection: true - } - QQC2.Label { - Kirigami.FormData.label: i18n("Time:") - text: Localizer.formatDateTime(reservationFor, "arrivalTime") - } - QQC2.Label { - Kirigami.FormData.label: i18n("Station:") - text: reservationFor.arrivalBusStop.name - } - App.PlaceDelegate { - place: reservationFor.arrivalBusStop - } + // departure data + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Departure") + } + QQC2.Label { + Kirigami.FormData.label: i18n("Time:") + text: Localizer.formatDateTime(reservationFor, "departureTime") + } + QQC2.Label { + Kirigami.FormData.label: i18n("Station:") + text: reservationFor.departureBusStop.name + } + App.PlaceDelegate { + place: reservationFor.departureBusStop + } - // seat reservation - Kirigami.Separator { - Kirigami.FormData.label: i18n("Seat") - Kirigami.FormData.isSection: true - } - QQC2.Label { - Kirigami.FormData.label: i18n("Seat:") - text: reservation.reservedTicket.ticketedSeat.seatNumber - } + // arrival data + Kirigami.Separator { + Kirigami.FormData.label: i18n("Arrival") + Kirigami.FormData.isSection: true + } + QQC2.Label { + Kirigami.FormData.label: i18n("Time:") + text: Localizer.formatDateTime(reservationFor, "arrivalTime") + } + QQC2.Label { + Kirigami.FormData.label: i18n("Station:") + text: reservationFor.arrivalBusStop.name + } + App.PlaceDelegate { + place: reservationFor.arrivalBusStop + } - // booking details - Kirigami.Separator { - Kirigami.FormData.label: i18n("Booking") - Kirigami.FormData.isSection: true - } - QQC2.Label { - Kirigami.FormData.label: i18n("Reference:") - text: reservation.reservationNumber - } - QQC2.Label { - Kirigami.FormData.label: i18n("Under name:") - text: reservation.underName.name + // seat reservation + Kirigami.Separator { + Kirigami.FormData.label: i18n("Seat") + Kirigami.FormData.isSection: true + } + QQC2.Label { + Kirigami.FormData.label: i18n("Seat:") + text: reservation.reservedTicket.ticketedSeat.seatNumber + } + + // booking details + Kirigami.Separator { + Kirigami.FormData.label: i18n("Booking") + Kirigami.FormData.isSection: true + } + QQC2.Label { + Kirigami.FormData.label: i18n("Reference:") + text: reservation.reservationNumber + } + QQC2.Label { + Kirigami.FormData.label: i18n("Under name:") + text: reservation.underName.name + } } } } diff --git a/src/app/EventPage.qml b/src/app/EventPage.qml index 8f0eb06..07e3825 100644 --- a/src/app/EventPage.qml +++ b/src/app/EventPage.qml @@ -1,67 +1,71 @@ /* Copyright (C) 2018 Volker Krause This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.5 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.1 as QQC2 import org.kde.kirigami 2.4 as Kirigami import org.kde.kitinerary 1.0 import org.kde.itinerary 1.0 import "." as App App.DetailsPage { id: root title: i18n("Event") - Kirigami.FormLayout { - width: root.width + ColumnLayout { + width: parent.width QQC2.Label { - Kirigami.FormData.isSection: true + Layout.fillWidth: true text: reservationFor.name horizontalAlignment: Qt.AlignHCenter font.bold: true } App.TicketTokenDelegate { - Kirigami.FormData.isSection: true resIds: _reservationManager.reservationsForBatch(root.batchId) } - QQC2.Label { - Kirigami.FormData.label: i18n("Location:") - text: reservationFor.location.name - } + Kirigami.FormLayout { + Layout.fillWidth: true - App.PlaceDelegate { - place: reservationFor.location - } - QQC2.Label { - Kirigami.FormData.label: i18n("Entrance:") - text: Localizer.formatDateTime(reservationFor, "doorTime") - } - QQC2.Label { - Kirigami.FormData.label: i18n("Start Time:") - text: Localizer.formatDateTime(reservationFor, "startDate") - } - QQC2.Label { - Kirigami.FormData.label: i18n("End Time:") - text: Localizer.formatDateTime(reservationFor, "endDate") + QQC2.Label { + Kirigami.FormData.label: i18n("Location:") + text: reservationFor.location.name + } + + App.PlaceDelegate { + place: reservationFor.location + } + + QQC2.Label { + Kirigami.FormData.label: i18n("Entrance:") + text: Localizer.formatDateTime(reservationFor, "doorTime") + } + QQC2.Label { + Kirigami.FormData.label: i18n("Start Time:") + text: Localizer.formatDateTime(reservationFor, "startDate") + } + QQC2.Label { + Kirigami.FormData.label: i18n("End Time:") + text: Localizer.formatDateTime(reservationFor, "endDate") + } } } } diff --git a/src/app/FlightPage.qml b/src/app/FlightPage.qml index ede9fe6..7c86676 100644 --- a/src/app/FlightPage.qml +++ b/src/app/FlightPage.qml @@ -1,151 +1,154 @@ /* Copyright (C) 2018 Volker Krause This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.5 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.1 as QQC2 import org.kde.kirigami 2.4 as Kirigami import org.kde.kitinerary 1.0 import org.kde.itinerary 1.0 import "." as App App.DetailsPage { id: root title: i18n("Flight") property var resIds: _reservationManager.reservationsForBatch(root.batchId) editor: Component { App.FlightEditor { batchId: root.batchId } } - Kirigami.FormLayout { - width: root.width + ColumnLayout { + width: parent.width QQC2.Label { - Kirigami.FormData.isSection: true + Layout.fillWidth: true text: reservationFor.airline.iataCode + " " + reservationFor.flightNumber horizontalAlignment: Qt.AlignHCenter font.bold: true } // ticket barcode App.TicketTokenDelegate { - Kirigami.FormData.isSection: true resIds: _reservationManager.reservationsForBatch(root.batchId) onCurrentReservationIdChanged: root.currentReservationId = currentReservationId } - // flight details - Kirigami.Separator { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Flight") - } - QQC2.Label { - Kirigami.FormData.label: i18n("Boarding:") - text: Localizer.formatDateTime(reservationFor, "boardingTime") - visible: reservationFor.boardingTime > 0 + Kirigami.FormLayout { + Layout.fillWidth: true - } - QQC2.Label { - Kirigami.FormData.label: i18n("Boarding group:") - text: reservation.boardingGroup - visible: reservation.boardingGroup.length > 0 + // flight details + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Flight") + } + QQC2.Label { + Kirigami.FormData.label: i18n("Boarding:") + text: Localizer.formatDateTime(reservationFor, "boardingTime") + visible: reservationFor.boardingTime > 0 - } - QQC2.Label { - Kirigami.FormData.label: i18n("Seat:") - text: reservation.airplaneSeat - visible: reservation.airplaneSeat.length > 0 + } + QQC2.Label { + Kirigami.FormData.label: i18n("Boarding group:") + text: reservation.boardingGroup + visible: reservation.boardingGroup.length > 0 - } - QQC2.Label { - Kirigami.FormData.label: i18n("Airline:") - text: reservationFor.airline.name - visible: reservationFor.airline.name.length > 0 - } + } + QQC2.Label { + Kirigami.FormData.label: i18n("Seat:") + text: reservation.airplaneSeat + visible: reservation.airplaneSeat.length > 0 + } + QQC2.Label { + Kirigami.FormData.label: i18n("Airline:") + text: reservationFor.airline.name + visible: reservationFor.airline.name.length > 0 + } - // departure data - Kirigami.Separator { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Departure") - } - QQC2.Label { - Kirigami.FormData.label: i18n("Time:") - text: Localizer.formatDateTime(reservationFor, "departureTime") - visible: reservationFor.departureTime > 0 - } - QQC2.Label { - Kirigami.FormData.label: i18n("Airport:") - text: reservationFor.departureAirport.name + " (" + reservationFor.departureAirport.iataCode + ")" - visible: reservationFor.departureAirport.name.length > 0 - } - App.PlaceDelegate { - place: reservationFor.departureAirport - } - QQC2.Label { - Kirigami.FormData.label: i18n("Terminal:") - text: reservationFor.departureTerminal - visible: reservationFor.departureTerminal.length > 0 - } - QQC2.Label { - Kirigami.FormData.label: i18n("Gate:") - text: reservationFor.departureGate - visible: reservationFor.departureGate.length > 0 - } + // departure data + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Departure") + } + QQC2.Label { + Kirigami.FormData.label: i18n("Time:") + text: Localizer.formatDateTime(reservationFor, "departureTime") + visible: reservationFor.departureTime > 0 + } + QQC2.Label { + Kirigami.FormData.label: i18n("Airport:") + text: reservationFor.departureAirport.name + " (" + reservationFor.departureAirport.iataCode + ")" + visible: reservationFor.departureAirport.name.length > 0 + } + App.PlaceDelegate { + place: reservationFor.departureAirport + } + QQC2.Label { + Kirigami.FormData.label: i18n("Terminal:") + text: reservationFor.departureTerminal + visible: reservationFor.departureTerminal.length > 0 + } + QQC2.Label { + Kirigami.FormData.label: i18n("Gate:") + text: reservationFor.departureGate + visible: reservationFor.departureGate.length > 0 + } - // arrival data - Kirigami.Separator { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Arrival") - } - QQC2.Label { - Kirigami.FormData.label: i18n("Time:") - text: Localizer.formatDateTime(reservationFor, "arrivalTime") - visible: reservationFor.arrivalTime > 0 - } - QQC2.Label { - Kirigami.FormData.label: i18n("Airport:") - text: reservationFor.arrivalAirport.name + " (" + reservationFor.arrivalAirport.iataCode + ")" - visible: reservationFor.arrivalAirport.name.length > 0 - } - App.PlaceDelegate { - place: reservationFor.arrivalAirport - } - QQC2.Label { - Kirigami.FormData.label: i18n("Terminal:") - text: reservationFor.arrivalTerminal - visible: reservationFor.arrivalTerminal.length > 0 - } - // booking details - Kirigami.Separator { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Booking") - } - Repeater { - model: resIds.length * 2 - delegate: QQC2.Label { - property var res: _reservationManager.reservation(resIds[Math.floor(index/2)]); - Kirigami.FormData.label: index % 2 == 0 ? i18n("Under name:") : i18n("Reference:") - text: index % 2 == 0 ? res.underName.name : res.reservationNumber + // arrival data + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Arrival") + } + QQC2.Label { + Kirigami.FormData.label: i18n("Time:") + text: Localizer.formatDateTime(reservationFor, "arrivalTime") + visible: reservationFor.arrivalTime > 0 + } + QQC2.Label { + Kirigami.FormData.label: i18n("Airport:") + text: reservationFor.arrivalAirport.name + " (" + reservationFor.arrivalAirport.iataCode + ")" + visible: reservationFor.arrivalAirport.name.length > 0 + } + App.PlaceDelegate { + place: reservationFor.arrivalAirport + } + QQC2.Label { + Kirigami.FormData.label: i18n("Terminal:") + text: reservationFor.arrivalTerminal + visible: reservationFor.arrivalTerminal.length > 0 + } + + // booking details + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Booking") + } + Repeater { + model: resIds.length * 2 + delegate: QQC2.Label { + property var res: _reservationManager.reservation(resIds[Math.floor(index/2)]); + Kirigami.FormData.label: index % 2 == 0 ? i18n("Under name:") : i18n("Reference:") + text: index % 2 == 0 ? res.underName.name : res.reservationNumber + } } } } } diff --git a/src/app/TrainPage.qml b/src/app/TrainPage.qml index 196b66c..8bbe4e1 100644 --- a/src/app/TrainPage.qml +++ b/src/app/TrainPage.qml @@ -1,175 +1,178 @@ /* Copyright (C) 2018 Volker Krause This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.5 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.1 as QQC2 import org.kde.kirigami 2.4 as Kirigami import org.kde.kitinerary 1.0 import org.kde.itinerary 1.0 import "." as App App.DetailsPage { id: root title: i18n("Train Ticket") property var arrival: _liveDataManager.arrival(batchId) property var departure: _liveDataManager.departure(batchId) Component { id: alternativePage App.TrainJourneyQueryPage { batchId: root.batchId } } Component { id: alternativeAction Kirigami.Action { text: i18n("Alternatives") iconName: "clock" onTriggered: { applicationWindow().pageStack.push(alternativePage); } } } Component.onCompleted: { actions.contextualActions.push(alternativeAction.createObject(root)); } - Kirigami.FormLayout { - width: root.width + ColumnLayout { + width: parent.width QQC2.Label { - Kirigami.FormData.isSection: true + Layout.fillWidth: true text: reservationFor.trainName + " " + reservationFor.trainNumber horizontalAlignment: Qt.AlignHCenter font.bold: true } // ticket barcode App.TicketTokenDelegate { - Kirigami.FormData.isSection: true resIds: _reservationManager.reservationsForBatch(root.batchId) } - // departure data - Kirigami.Separator { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Departure") - } - RowLayout { - Kirigami.FormData.label: i18n("Time:") - QQC2.Label { - text: Localizer.formatDateTime(reservationFor, "departureTime") + Kirigami.FormLayout { + Layout.fillWidth: true + + // departure data + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Departure") } - QQC2.Label { - text: (departure.departureDelay >= 0 ? "+" : "") + departure.departureDelay - color: (departure.departureDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor - visible: departure.hasExpectedDepartureTime + RowLayout { + Kirigami.FormData.label: i18n("Time:") + QQC2.Label { + text: Localizer.formatDateTime(reservationFor, "departureTime") + } + QQC2.Label { + text: (departure.departureDelay >= 0 ? "+" : "") + departure.departureDelay + color: (departure.departureDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor + visible: departure.hasExpectedDepartureTime + } } - } - QQC2.Label { - Kirigami.FormData.label: i18n("Station:") - text: reservationFor.departureStation.name - } - App.PlaceDelegate { - place: reservationFor.departureStation - } - RowLayout { - Kirigami.FormData.label: i18n("Platform:") QQC2.Label { - text: departure.hasExpectedPlatform ? departure.expectedPlatform : reservationFor.departurePlatform - color: departure.platformChanged ? Kirigami.Theme.negativeTextColor : - departure.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor : - Kirigami.Theme.textColor; + Kirigami.FormData.label: i18n("Station:") + text: reservationFor.departureStation.name + } + App.PlaceDelegate { + place: reservationFor.departureStation + } + RowLayout { + Kirigami.FormData.label: i18n("Platform:") + QQC2.Label { + text: departure.hasExpectedPlatform ? departure.expectedPlatform : reservationFor.departurePlatform + color: departure.platformChanged ? Kirigami.Theme.negativeTextColor : + departure.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor : + Kirigami.Theme.textColor; + } + QQC2.Label { + text: i18n("(was: %1)", reservationFor.departurePlatform) + visible: departure.platformChanged && reservationFor.departurePlatform != "" + } + } + + // arrival data + Kirigami.Separator { + Kirigami.FormData.isSection: true + Kirigami.FormData.label: i18n("Arrival") + } + RowLayout { + Kirigami.FormData.label: i18n("Arrival time:") + QQC2.Label { + text: Localizer.formatDateTime(reservationFor, "arrivalTime") + } + QQC2.Label { + text: (arrival.arrivalDelay >= 0 ? "+" : "") + arrival.arrivalDelay + color: (arrival.arrivalDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor + visible: arrival.hasExpectedArrivalTime + } } QQC2.Label { - text: i18n("(was: %1)", reservationFor.departurePlatform) - visible: departure.platformChanged && reservationFor.departurePlatform != "" + Kirigami.FormData.label: i18n("Station:") + text: reservationFor.arrivalStation.name + } + App.PlaceDelegate { + place: reservationFor.arrivalStation + } + RowLayout { + Kirigami.FormData.label: i18n("Platform:") + QQC2.Label { + text: arrival.hasExpectedPlatform ? arrival.expectedPlatform : reservationFor.arrivalPlatform + color: arrival.platformChanged ? Kirigami.Theme.negativeTextColor : + arrival.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor : + Kirigami.Theme.textColor; + } + QQC2.Label { + text: i18n("(was: %1)", reservationFor.arrivalPlatform) + visible: arrival.platformChanged && reservationFor.arrivalPlatform != "" + } } - } - // arrival data - Kirigami.Separator { - Kirigami.FormData.isSection: true - Kirigami.FormData.label: i18n("Arrival") - } - RowLayout { - Kirigami.FormData.label: i18n("Arrival time:") + // seat reservation + Kirigami.Separator { + Kirigami.FormData.label: i18n("Seat") + Kirigami.FormData.isSection: true + visible: reservation.reservedTicket.ticketedSeat.seatNumber != "" || reservation.reservedTicket.ticketedSeat.seatSection != "" + } QQC2.Label { - text: Localizer.formatDateTime(reservationFor, "arrivalTime") + Kirigami.FormData.label: i18n("Coach:") + text: reservation.reservedTicket.ticketedSeat.seatSection + visible: reservation.reservedTicket.ticketedSeat.seatSection != "" } QQC2.Label { - text: (arrival.arrivalDelay >= 0 ? "+" : "") + arrival.arrivalDelay - color: (arrival.arrivalDelay > 1) ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor - visible: arrival.hasExpectedArrivalTime + Kirigami.FormData.label: i18n("Seat:") + text: reservation.reservedTicket.ticketedSeat.seatNumber + visible: reservation.reservedTicket.ticketedSeat.seatNumber != "" + } + + // booking details + Kirigami.Separator { + Kirigami.FormData.label: i18n("Booking") + Kirigami.FormData.isSection: true } - } - QQC2.Label { - Kirigami.FormData.label: i18n("Station:") - text: reservationFor.arrivalStation.name - } - App.PlaceDelegate { - place: reservationFor.arrivalStation - } - RowLayout { - Kirigami.FormData.label: i18n("Platform:") QQC2.Label { - text: arrival.hasExpectedPlatform ? arrival.expectedPlatform : reservationFor.arrivalPlatform - color: arrival.platformChanged ? Kirigami.Theme.negativeTextColor : - arrival.hasExpectedPlatform ? Kirigami.Theme.positiveTextColor : - Kirigami.Theme.textColor; + Kirigami.FormData.label: i18n("Reference:") + text: reservation.reservationNumber } QQC2.Label { - text: i18n("(was: %1)", reservationFor.arrivalPlatform) - visible: arrival.platformChanged && reservationFor.arrivalPlatform != "" + Kirigami.FormData.label: i18n("Under name:") + text: reservation.underName.name } } - - // seat reservation - Kirigami.Separator { - Kirigami.FormData.label: i18n("Seat") - Kirigami.FormData.isSection: true - visible: reservation.reservedTicket.ticketedSeat.seatNumber != "" || reservation.reservedTicket.ticketedSeat.seatSection != "" - } - QQC2.Label { - Kirigami.FormData.label: i18n("Coach:") - text: reservation.reservedTicket.ticketedSeat.seatSection - visible: reservation.reservedTicket.ticketedSeat.seatSection != "" - } - QQC2.Label { - Kirigami.FormData.label: i18n("Seat:") - text: reservation.reservedTicket.ticketedSeat.seatNumber - visible: reservation.reservedTicket.ticketedSeat.seatNumber != "" - } - - // booking details - Kirigami.Separator { - Kirigami.FormData.label: i18n("Booking") - Kirigami.FormData.isSection: true - } - QQC2.Label { - Kirigami.FormData.label: i18n("Reference:") - text: reservation.reservationNumber - } - QQC2.Label { - Kirigami.FormData.label: i18n("Under name:") - text: reservation.underName.name - } } }