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
81 if (lineSelector.selectedIndex === -1) {
82 text = text.toUpperCase()
92 drag.maximumY: parent.height
98 onAccepted: gline.text = currentLine
112 iconSource: 'image://theme/icon-m-common-search'
114 onClicked: lineSheet.open()
118 placeholderText: 'Station'
124 right: stationPickerButton.left
127 rightMargin: 10*stationPickerButton.opacity
136 id: stationPickerButton
140 bottom: gstation.bottom
145 Behavior on opacity { PropertyAnimation { } }
147 opacity: gline.text !== '' // XXX: Check if the line is valid
149 width: lineSearchButton.width * opacity
150 //iconSource: 'image://theme/icon-m-common-location-picker'
151 iconSource: 'image://theme/icon-m-toolbar-list'
155 stationSheet.loadData(gline.text)
166 bottom: parent.bottom
172 gline: stationSheet.currentLine
173 gstation: stationSheet.currentStation
174 gdirection: stationSheet.currentDirection
176 sourceUrl: stationSheet.currentUrl