2 import Sailfish.Silica 1.0
3 import net.cirulla.quandoparte 1.0
6 property alias name: schedule.name
7 property alias code: schedule.code
12 iconId: "icon-m-toolbar-back" + (theme.inverted ? "-white": "")
13 onClicked: pageStack.pop()
16 iconId: "icon-m-toolbar-refresh" + (theme.inverted ? "-white": "")
17 onClicked: updateStation() }
19 iconId: "icon-m-toolbar-view-menu" + (theme.inverted ? "-white": "")
20 onClicked: menu.open()
25 anchors.top: parent.top
26 selectedIndex: schedule.type
34 anchors.top: header.bottom
40 value: header.selectedIndex
58 id: stationScheduleView
68 delegate: StationScheduleDelegate {
69 width: stationScheduleView.width
71 arrivalTime: model.arrivalTime
72 departureTime: model.departureTime
74 arrivalStation: model.arrivalStation
75 departureStation: model.departureStation
77 actualPlatform: model.actualPlatform
78 expectedPlatfrom: model.expectedPlatform
83 flickableItem: stationScheduleView
87 platformStyle: BusyIndicatorStyle {
90 anchors.centerIn: parent
95 anchors.centerIn: parent
97 anchors.centerIn: parent
98 spacing: UiConstants.DefaultMargin
102 font.pixelSize: UiConstants.HeaderFontPixelSize
103 font.bold: UiConstants.HeaderFontBoldness
104 horizontalAlignment: Text.AlignHCenter
109 font.pixelSize: UiConstants.HeaderFontPixelSize
110 font.bold: UiConstants.DefaultFontBoldness
111 horizontalAlignment: Text.AlignHCenter
120 target: stationScheduleView
128 target: busyIndicator
135 target: stationScheduleView
143 target: busyIndicator
151 target: stationScheduleView
159 target: busyIndicator
165 StationScheduleModel {
167 onNameChanged: updateStation()
168 onLayoutChanged: if (error) view.state = "error"
169 else view.state = "ready"
171 Component.onCompleted: {
172 updateTimer.timeout.connect(updateStation)
173 view.state = "loading"
175 function updateStation() {
176 view.state = "loading"
177 console.log("Updating station with " + schedule.name + ", " + schedule.code)
178 schedule.fetch(schedule.name, schedule.code)