Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
Itinerary
Commits
c6d9c6c6
Commit
c6d9c6c6
authored
May 13, 2018
by
Volker Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add details page for flights
parent
0cc4d1a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
186 additions
and
8 deletions
+186
-8
src/app/CMakeLists.txt
src/app/CMakeLists.txt
+5
-0
src/app/FlightDelegate.qml
src/app/FlightDelegate.qml
+12
-8
src/app/FlightPage.qml
src/app/FlightPage.qml
+168
-0
src/app/qml.qrc
src/app/qml.qrc
+1
-0
No files found.
src/app/CMakeLists.txt
View file @
c6d9c6c6
...
...
@@ -56,15 +56,20 @@ qml_lint(
main.qml
BoardingPass.qml
BusDelegate.qml
DetailsPage.qml
FlightDelegate.qml
FlightPage.qml
HotelDelegate.qml
HotelPage.qml
PkPassPage.qml
PlaceDelegate.qml
RestaurantDelegate.qml
TicketPage.qml
TicketTokenDelegate.qml
TimelineDelegate.qml
TimelinePage.qml
TrainDelegate.qml
TrainPage.qml
)
install
(
TARGETS itinerary-app
${
INSTALL_TARGETS_DEFAULT_ARGS
}
)
...
...
src/app/FlightDelegate.qml
View file @
c6d9c6c6
...
...
@@ -107,15 +107,19 @@ App.TimelineDelegate {
QQC2.Button
{
Layout.columnSpan
:
2
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
!=
""
)
text
:
qsTr
(
"
Boarding Pass
"
)
onClicked
:
showBoardingPass
();
visible
:
root
.
passId
!==
""
icon.source
:
root
.
passId
!==
""
?
"
image://org.kde.pkpass/
"
+
passId
+
"
/icon
"
:
""
}
}
Component
{
id
:
detailsComponent
App.FlightPage
{
reservation
:
root
.
reservation
}
}
onClicked
:
applicationWindow
().
pageStack
.
push
(
detailsComponent
);
}
src/app/FlightPage.qml
0 → 100644
View file @
c6d9c6c6
/*
Copyright (C) 2018 Volker Krause <vkrause@kde.org>
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 <http://www.gnu.org/licenses/>.
*/
import
QtQuick
2.5
import
QtQuick
.
Layouts
1.1
import
QtQuick
.
Controls
2.1
as
QQC2
import
org
.
kde
.
kirigami
2.0
as
Kirigami
import
org
.
kde
.
kitinerary
1.0
import
org
.
kde
.
itinerary
1.0
import
"
.
"
as
App
App.DetailsPage
{
id
:
root
title
:
qsTr
(
"
Flight
"
)
GridLayout
{
id
:
grid
width
:
root
.
width
columns
:
2
QQC2.Label
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
text
:
reservation
.
reservationFor
.
airline
.
iataCode
+
"
"
+
reservation
.
reservationFor
.
flightNumber
horizontalAlignment
:
Qt
.
AlignHCenter
font.bold
:
true
}
// ticket barcode
App.TicketTokenDelegate
{
Layout.columnSpan
:
2
ticket
:
reservation
.
reservedTicket
}
// flight details
QQC2.Label
{
text
:
qsTr
(
"
Boarding time:
"
)
}
QQC2.Label
{
text
:
Localizer
.
formatDateTime
(
reservation
.
reservationFor
,
"
boardingTime
"
)
}
QQC2.Label
{
text
:
qsTr
(
"
Boarding group:
"
)
}
QQC2.Label
{
text
:
reservation
.
boardingGroup
}
QQC2.Label
{
text
:
qsTr
(
"
Seat:
"
)
}
QQC2.Label
{
text
:
reservation
.
airplaneSeat
}
QQC2.Label
{
text
:
qsTr
(
"
Airline:
"
)
}
QQC2.Label
{
text
:
reservation
.
reservationFor
.
airline
.
name
}
Kirigami.Separator
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
}
// departure data
QQC2.Label
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
text
:
qsTr
(
"
Departure
"
)
horizontalAlignment
:
Qt
.
AlignHCenter
}
QQC2.Label
{
text
:
qsTr
(
"
Departure time:
"
)
}
QQC2.Label
{
text
:
Localizer
.
formatDateTime
(
reservation
.
reservationFor
,
"
departureTime
"
)
}
QQC2.Label
{
text
:
reservation
.
reservationFor
.
departureAirport
.
name
+
"
(
"
+
reservation
.
reservationFor
.
departureAirport
.
iataCode
+
"
)
"
Layout.columnSpan
:
2
}
App.PlaceDelegate
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
place
:
reservation
.
reservationFor
.
departureAirport
}
QQC2.Label
{
text
:
qsTr
(
"
Departure terminal:
"
)
}
QQC2.Label
{
text
:
reservation
.
reservationFor
.
departureTerminal
}
QQC2.Label
{
text
:
qsTr
(
"
Departure gate:
"
)
}
QQC2.Label
{
text
:
reservation
.
reservationFor
.
departureGate
}
Kirigami.Separator
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
}
// arrival data
QQC2.Label
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
text
:
qsTr
(
"
Arrival
"
)
horizontalAlignment
:
Qt
.
AlignHCenter
}
QQC2.Label
{
text
:
qsTr
(
"
Arrival time:
"
)
}
QQC2.Label
{
text
:
Localizer
.
formatDateTime
(
reservation
.
reservationFor
,
"
arrivalTime
"
)
}
QQC2.Label
{
text
:
reservation
.
reservationFor
.
arrivalAirport
.
name
+
"
(
"
+
reservation
.
reservationFor
.
arrivalAirport
.
iataCode
+
"
)
"
Layout.columnSpan
:
2
}
App.PlaceDelegate
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
place
:
reservation
.
reservationFor
.
arrivalAirport
}
Kirigami.Separator
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
}
// booking details
QQC2.Label
{
Layout.columnSpan
:
2
Layout.fillWidth
:
true
text
:
qsTr
(
"
Booking
"
)
horizontalAlignment
:
Qt
.
AlignHCenter
}
QQC2.Label
{
text
:
qsTr
(
"
Booking reference:
"
)
}
QQC2.Label
{
text
:
reservation
.
reservationNumber
}
QQC2.Label
{
text
:
qsTr
(
"
Under name:
"
)
}
QQC2.Label
{
text
:
reservation
.
underName
.
name
}
}
}
src/app/qml.qrc
View file @
c6d9c6c6
...
...
@@ -5,6 +5,7 @@
<file>BusDelegate.qml</file>
<file>DetailsPage.qml</file>
<file>FlightDelegate.qml</file>
<file>FlightPage.qml</file>
<file>HotelDelegate.qml</file>
<file>HotelPage.qml</file>
<file>PkPassPage.qml</file>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment