2 import com.nokia.meego 1.0
3 import com.nokia.extras 1.0
4 import "UIConstants.js" as UIConstants
5 import "ExtrasConstants.js" as ExtrasConstants
10 property string gline: ''
11 property string gstation: ''
12 property string gdirection: ''
14 property string sourceUrl: ''
15 property bool busy: true
16 property bool isStation: false
20 console.debug('refreshing')
23 console.debug('station based')
24 itip.load_station_departures(gstation)
26 console.debug('one line')
27 itip.load_departures(sourceUrl)
31 function isCorrectInput () {
32 return resultRealtime.sourceUrl != '' || (resultRealtime.isStation && resultRealtime.gstation != '')
36 console.debug('gstation changed')
45 departuresModel.clear()
47 var departures = itip.get_departures()
49 for (var d in departures) {
50 console.log('time: ' + departures[d].time)
51 var row = {'line': departures[d].line, 'station': departures[d].station, 'destination': departures[d].direction, 'departure': departures[d].time, 'lowfloor': departures[d].lowfloor}
52 departuresModel.append(row)
66 visible: mouseArea.pressed
67 source: theme.inverted ? 'image://theme/meegotouch-list-inverted-background-pressed-vertical-center': 'image://theme/meegotouch-list-background-pressed-vertical-center'
72 anchors.margins: UIConstants.DEFAULT_MARGIN
79 anchors.verticalCenter: parent.verticalCenter
81 font.pixelSize: UIConstants.FONT_XLARGE
83 font.family: ExtrasConstants.FONT_FAMILY_LIGHT
84 color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
88 anchors.verticalCenter: parent.verticalCenter
92 text: station // <----
93 width: parent.parent.parent.width - l.width - dep.width - 15
94 elide: Text.ElideRight
95 font.pixelSize: UIConstants.FONT_LARGE
96 font.family: ExtrasConstants.FONT_FAMILY_LIGHT
97 color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
102 text: destination // <----
103 width: parent.parent.parent.width - l.width - dep.width - 15
104 elide: Text.ElideRight
105 color: !theme.inverted ? UIConstants.COLOR_SECONDARY_FOREGROUND : UIConstants.COLOR_INVERTED_SECONDARY_FOREGROUND
106 font.family: ExtrasConstants.FONT_FAMILY_LIGHT
107 font.pixelSize: UIConstants.FONT_LSMALL
114 anchors.right: parent.right
115 anchors.verticalCenter: parent.verticalCenter
118 // FIXME strange int float transformation appears
120 anchors.right: parent.right
121 anchors.rightMargin: UIConstants.DEFAULT_MARGIN
122 font.italic: lowfloor == 1
124 font.pixelSize: UIConstants.FONT_XLARGE
125 font.family: ExtrasConstants.FONT_FAMILY_LIGHT
126 color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
134 console.debug("clicked: " + l.text)
142 width: parent.width; height: parent.height
146 height: childrenRect.height + 2*UIConstants.DEFAULT_MARGIN
147 color: "lightsteelblue"
158 margins: UIConstants.DEFAULT_MARGIN
161 text: 'Richtung ' + gdirection
162 elide: Text.ElideRight
164 font.family: ExtrasConstants.FONT_FAMILY_LIGHT
165 font.pixelSize: UIConstants.FONT_LSMALL
172 delegate: departureDelegate
174 visible: !resultRealtime.busy && isCorrectInput()
180 platformStyle: ScrollDecoratorStyle {}
185 visible: resultRealtime.busy && isCorrectInput()
187 platformStyle: BusyIndicatorStyle { size: 'large' }
188 anchors.centerIn: parent