2 import com.nokia.meego 1.0
3 import QtMobility.location 1.1
5 import "UIConstants.js" as UIConstants
6 import "ExtrasConstants.js" as ExtrasConstants
11 property bool canRefresh: realtimeResult.sourceUrl != '' || (realtimeResult.isStation && realtimeResult.gstation != '')
12 //property alias stationSelect: stationSelector
13 property variant nearbyStations
16 realtimeResult.refresh()
19 function fillNearbyStations(lat, lon) {
20 nearbyStations = itip.get_nearby_stations(lat, lon)
23 function showNearby() {
24 console.log("show nearby")
26 var stations = nearbyStations
27 stationSelectorModel.clear()
28 for (var idx in stations) {
29 stationSelectorModel.append({'name': stations[idx]})
32 stationSelector.open()
42 fillNearbyStations(positionSource.position.coordinate.latitude, positionSource.position.coordinate.longitude)
48 titleText: 'Select nearby station'
51 id: stationSelectorModel
55 realtimeResult.isStation = true
56 realtimeResult.gstation = stationSelectorModel.get(selectedIndex).name
57 realtimeResult.gline = ''
58 realtimeResult.sourceUrl = ''
60 gstation.text = stationSelectorModel.get(selectedIndex).name
61 console.log('station to get: ' + realtimeResult.gstation)
66 placeholderText: 'Line'
75 right: lineSearchButton.left
87 drag.maximumY: parent.height
94 gline.text = currentLine
96 /* We usually want to select a station after selecting a line */
97 stationPickerButton.clicked()
112 iconSource: 'image://theme/icon-m-common-search'
115 lineSheet.currentLine = ''
121 placeholderText: 'Station'
127 right: stationPickerButton.left
130 rightMargin: 10*stationPickerButton.opacity
139 id: stationPickerButton
143 bottom: gstation.bottom
148 Behavior on opacity { PropertyAnimation { } }
150 opacity: gline.text !== '' // XXX: Check if the line is valid
152 width: lineSearchButton.width * opacity
153 //iconSource: 'image://theme/icon-m-common-location-picker'
154 iconSource: 'image://theme/icon-m-toolbar-list'
158 stationSheet.loadData(gline.text)
169 bottom: parent.bottom
175 gline: stationSheet.currentLine
176 gstation: stationSheet.currentStation
177 gdirection: stationSheet.currentDirection
179 sourceUrl: stationSheet.currentUrl