3 import com.nokia.meego 1.0
4 import net.cirulla.quandoparte 1.0
5 import "uiconstants.js" as UiConstants
8 property alias name: schedule.name
10 tools: ToolBarLayout {
12 ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop() }
13 ToolIcon { iconId: "icon-m-toolbar-view-menu"; onClicked: menu.open() }
17 anchors.top: parent.top
18 selectedIndex: schedule.type
22 name: QT_TR_NOOP("Departures")
25 name: QT_TR_NOOP("Arrivals")
31 anchors.top: header.bottom
37 value: header.selectedIndex
55 id: stationScheduleView
66 height: UiConstants.ListItemHeightDefault
72 visible: mouseArea.pressed
73 source: "image://theme/meegotouch-list-background-pressed-center"
78 spacing: UiConstants.ButtonSpacing
83 anchors.verticalCenter: parent.verticalCenter
85 spacing: UiConstants.ButtonSpacing
88 font.bold: UiConstants.SpecialFontBoldness
89 font.pixelSize: UiConstants.SpecialFontPixelSize
90 visible: schedule.type === StationScheduleModel.ArrivalSchedule
94 font.bold: UiConstants.SpecialFontBoldness
95 font.pixelSize: UiConstants.SpecialFontPixelSize
96 visible: schedule.type === StationScheduleModel.DepartureSchedule
100 font.bold: UiConstants.SpecialFontBoldness
101 font.pixelSize: UiConstants.SpecialFontPixelSize
102 color: UiConstants.AccentColor
106 text: qsTr("from ") + arrivalStation
107 font.bold: UiConstants.DefaultFontBoldness
108 font.pixelSize: UiConstants.DefaultFontPixelSize
109 visible: schedule.type === StationScheduleModel.ArrivalSchedule
112 text: qsTr("to ") + departureStation
113 font.bold: UiConstants.DefaultFontBoldness
114 font.pixelSize: UiConstants.DefaultFontPixelSize
115 visible: schedule.type === StationScheduleModel.DepartureSchedule
120 font.bold: UiConstants.SubtitleFontBoldness
121 font.pixelSize: UiConstants.SubtitleFontPixelSize
127 bottom: bodyRow.bottom
129 rightMargin: UiConstants.DefaultMargin
131 text: qsTr("Platform ") + actualPlatform
132 font.bold: UiConstants.SubtitleFontBoldness
133 font.pixelSize: UiConstants.SubtitleFontPixelSize
140 source: "image://theme/meegotouch-separator-background-horizontal"
144 anchors.fill: background
146 // Load an external page about the train, for now
147 Qt.openUrlExternally(settings.queryBaseUrl + "/" + detailsUrl)
148 console.log(settings.queryBaseUrl + "/" + detailsUrl)
155 flickableItem: stationScheduleView
159 platformStyle: BusyIndicatorStyle {
162 anchors.centerIn: parent
163 visible: !stationScheduleView.visible
170 target: stationScheduleView
177 target: stationScheduleView
183 StationScheduleModel {
185 onNameChanged: schedule.fetch(name)
186 onLayoutChanged: view.state = "ready"