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
43 placeholderText: 'Line'
52 right: lineSearchButton.left
56 // TODO: Check if text matches an item in lineSelectorModel and
57 // set selectedIndex in lineSelector to the right item
60 text = text.toUpperCase()
62 if (lineSelector.selectedIndex == -1) {
66 // Disable selection in line selector if user changes the text
67 if (lineSelectorModel.get(lineSelector.selectedIndex).name != text) {
68 lineSelector.selectedIndex = -1
77 drag.maximumY: parent.height
97 iconSource: 'image://theme/icon-m-common-search'
99 onClicked: lineSelector.open()
103 placeholderText: 'Station'
109 right: stationPickerButton.left
112 rightMargin: 10*stationPickerButton.opacity
121 id: stationPickerButton
125 bottom: gstation.bottom
130 Behavior on opacity { PropertyAnimation { } }
132 opacity: gline.text != '' // XXX: Check if the line is valid
134 width: lineSearchButton.width * opacity
135 //iconSource: 'image://theme/icon-m-common-location-picker'
136 iconSource: 'image://theme/icon-m-toolbar-list'
140 stationSheet.loadData(gline.text)
151 bottom: parent.bottom
157 gline: stationSheet.currentLine
158 gstation: stationSheet.currentStation
159 gdirection: stationSheet.currentDirection
161 sourceUrl: stationSheet.currentUrl