Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
KTrip
Commits
baa15a6c
Commit
baa15a6c
authored
Aug 08, 2019
by
Nicolas Fella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing files
parent
4278442b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
160 additions
and
0 deletions
+160
-0
src/qml/DepartureQueryPage.qml
src/qml/DepartureQueryPage.qml
+87
-0
src/qml/DeparturesPage.qml
src/qml/DeparturesPage.qml
+73
-0
No files found.
src/qml/DepartureQueryPage.qml
0 → 100644
View file @
baa15a6c
/**
* Copyright 2019 Nicolas Fella <nicolas.fella@gmx.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* 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 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 <https://www.gnu.org/licenses/>.
*/
import
QtQuick
2.2
import
QtQuick
.
Layouts
1.1
import
QtQuick
.
Controls
2.4
import
org
.
kde
.
kirigami
2.0
as
Kirigami
Kirigami.Page
{
id
:
rootPage
title
:
i18nc
(
"
@title
"
,
"
Query Departures
"
)
actions.main
:
Kirigami.Action
{
icon.name
:
"
search
"
text
:
i18nc
(
"
@action
"
,
"
Search
"
)
enabled
:
_queryController
.
start
.
name
!=
""
onTriggered
:
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
DeparturesPage.qml
"
))
}
function
startPicked
(
data
)
{
_queryController
.
start
=
data
}
ColumnLayout
{
width
:
parent
.
width
Label
{
text
:
i18n
(
"
From:
"
)
}
Button
{
Layout.fillWidth
:
true
text
:
_queryController
.
start
.
name
?
_queryController
.
start
.
name
:
i18nc
(
"
@action:button
"
,
"
Pick Start
"
)
onClicked
:
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
LocationQueryPage.qml
"
),
{
title
:
i18nc
(
"
@title
"
,
"
Search for Start Location
"
),
callback
:
startPicked
})
}
Label
{
text
:
i18n
(
"
Departure date:
"
)
}
DatePickerButton
{
text
:
_queryController
.
departureDate
Layout.fillWidth
:
true
onDatePicked
:
{
if
(
theDate
!=
""
)
{
_queryController
.
departureDate
=
theDate
}
}
}
Label
{
text
:
i18n
(
"
Departure time:
"
)
}
TimePickerButton
{
text
:
_queryController
.
departureTime
Layout.fillWidth
:
true
onTimePicked
:
{
if
(
theTime
!=
""
)
{
_queryController
.
departureTime
=
theTime
}
}
}
}
}
src/qml/DeparturesPage.qml
0 → 100644
View file @
baa15a6c
/**
* Copyright 2019 Nicolas Fella <nicolas.fella@gmx.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* 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 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 <https://www.gnu.org/licenses/>.
*/
import
QtQuick
2.2
import
QtQuick
.
Layouts
1.1
import
QtQuick
.
Controls
2.4
import
org
.
kde
.
kirigami
2.4
as
Kirigami
import
org
.
kde
.
kpublictransport
1.0
as
KPT
Kirigami.Page
{
title
:
i18nc
(
"
@title
"
,
"
Departures
"
)
header
:
Kirigami.InlineMessage
{
type
:
Kirigami
.
MessageType
.
Error
text
:
theModel
.
errorMessage
visible
:
theModel
.
errorMessage
!=
""
}
ListView
{
anchors.fill
:
parent
model
:
KPT.DepartureQueryModel
{
id
:
theModel
request
:
_queryController
.
createDepartureRequest
()
manager
:
_manager
}
delegate
:
Kirigami.AbstractListItem
{
RowLayout
{
Label
{
text
:
i18n
(
"
%3 %1 (%2)
"
,
departure
.
route
.
line
.
name
,
departure
.
route
.
direction
,
_formatter
.
formatTime
(
departure
.
scheduledDepartureTime
))
Layout.fillWidth
:
true
}
Label
{
text
:
departure
.
scheduledPlatform
}
}
}
footer
:
Button
{
text
:
i18nc
(
"
@action:button
"
,
"
Later
"
)
width
:
parent
.
width
visible
:
theModel
.
canQueryNext
onClicked
:
theModel
.
queryNext
()
}
}
BusyIndicator
{
running
:
theModel
.
loading
anchors.centerIn
:
parent
}
}
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