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
95 font.pixelSize: UiConstants.HeaderFontPixelSize
96 font.bold: UiConstants.HeaderFontBoldness
97 horizontalAlignment: Text.AlignHCenter
102 font.pixelSize: UiConstants.HeaderFontPixelSize
103 font.bold: UiConstants.DefaultFontBoldness
104 horizontalAlignment: Text.AlignHCenter
113 target: stationScheduleView
121 target: busyIndicator
128 target: stationScheduleView
136 target: busyIndicator
144 target: stationScheduleView
152 target: busyIndicator
158 StationScheduleModel {
160 onNameChanged: updateStation()
161 onLayoutChanged: if (error) view.state = "error"
162 else view.state = "ready"
164 Component.onCompleted: {
165 updateTimer.timeout.connect(updateStation)
166 view.state = "loading"
168 function updateStation() {
169 view.state = "loading"
170 console.log("Updating station with " + schedule.name + ", " + schedule.code)
171 schedule.fetch(schedule.name, schedule.code)