2 import com.nokia.meego 1.0
3 import net.cirulla.quandoparte 1.0
4 import "uiconstants.js" as UiConstants
7 property alias name: schedule.name
8 property alias code: schedule.code
10 tools: ToolBarLayout {
12 ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop() }
13 ToolIcon { iconId: "icon-m-toolbar-refresh"; onClicked: updateStation() }
14 ToolIcon { iconId: "icon-m-toolbar-view-menu"; onClicked: menu.open() }
18 anchors.top: parent.top
19 selectedIndex: schedule.type
27 anchors.top: header.bottom
33 value: header.selectedIndex
51 id: stationScheduleView
61 delegate: StationScheduleDelegate {
62 width: stationScheduleView.width
64 arrivalTime: model.arrivalTime
65 departureTime: model.departureTime
67 arrivalStation: model.arrivalStation
68 departureStation: model.departureStation
70 actualPlatform: model.actualPlatform
71 expectedPlatfrom: model.expectedPlatform
76 flickableItem: stationScheduleView
80 platformStyle: BusyIndicatorStyle {
83 anchors.centerIn: parent
88 anchors.centerIn: parent
90 anchors.centerIn: parent
91 spacing: UiConstants.DefaultMargin
94 font.pixelSize: UiConstants.HeaderFontPixelSize
95 font.bold: UiConstants.HeaderFontBoldness
96 horizontalAlignment: Text.AlignHCenter
100 font.pixelSize: UiConstants.DefaultFontBoldness
101 font.bold: UiConstants.DefaultFontBoldness
102 horizontalAlignment: Text.AlignHCenter
111 target: stationScheduleView
119 target: busyIndicator
126 target: stationScheduleView
134 target: busyIndicator
142 target: stationScheduleView
150 target: busyIndicator
156 StationScheduleModel {
158 onNameChanged: updateStation()
159 onLayoutChanged: if (error) view.state = "error"
160 else view.state = "ready"
162 Component.onCompleted: {
163 updateTimer.timeout.connect(updateStation)
164 view.state = "loading"
166 function updateStation() {
167 view.state = "loading"
168 console.log("Updating station with " + schedule.name + ", " + schedule.code)
169 schedule.fetch(schedule.name, schedule.code)