2 import com.nokia.meego 1.0
4 import "UIConstants.js" as UIConstants
5 import "ExtrasConstants.js" as ExtrasConstants
10 property bool canRefresh: realtimeResult.sourceUrl != ''
13 realtimeResult.refresh()
18 titleText: 'Select line'
23 Component.onCompleted: {
24 var lines = itip.get_lines()
26 for (var idx in lines) {
27 lineSelectorModel.append({'name': lines[idx]})
32 // XXX It would be nice if we could make a delegate with
33 // icons (i.e. U1, U2, ... in the right colors), but we
34 // would have to "copy" the default delegate style
37 console.log('accepted: ' + selectedIndex)
38 gline.text = lineSelectorModel.get(selectedIndex).name
44 titleText: 'Select nearby station'
47 id: stationSelectorModel
49 Component.onCompleted: {
50 var stations = itip.get_nearby_stations(positionSource.position.coordinate.latitude, positionSource.position.coordinate.longitude)
52 for (var idx in stations) {
53 stationSelectorModel.append({'name': stations[idx]})
58 // XXX It would be nice if we could make a delegate with
59 // icons (i.e. U1, U2, ... in the right colors), but we
60 // would have to "copy" the default delegate style
63 console.log('accepted: ' + lineSelectorModel.get(selectedIndex).name)
64 //gline.text = lineSelectorModel.get(selectedIndex).name
69 placeholderText: 'Line'
78 right: lineSearchButton.left
82 // TODO: Check if text matches an item in lineSelectorModel and
83 // set selectedIndex in lineSelector to the right item
86 if (lineSelector.selectedIndex == -1) {
90 // Disable selection in line selector if user changes the text
91 if (lineSelectorModel.get(lineSelector.selectedIndex).name != text) {
92 lineSelector.selectedIndex = -1
101 drag.maximumY: parent.height
121 iconSource: 'image://theme/icon-m-common-search'
123 onClicked: lineSelector.open()
127 placeholderText: 'Station'
133 right: stationPickerButton.left
136 rightMargin: 10*stationPickerButton.opacity
145 id: stationPickerButton
149 bottom: gstation.bottom
154 Behavior on opacity { PropertyAnimation { } }
156 opacity: gline.text != '' // XXX: Check if the line is valid
158 width: lineSearchButton.width * opacity
159 //iconSource: 'image://theme/icon-m-common-location-picker'
160 iconSource: 'image://theme/icon-m-toolbar-list'
164 stationSheet.loadData(gline.text)
175 bottom: parent.bottom
181 gline: stationSheet.currentLine
182 gstation: stationSheet.currentStation
183 gdirection: stationSheet.currentDirection
185 sourceUrl: stationSheet.currentUrl