2 import com.nokia.meego 1.0
3 import "UIConstants.js" as UIConstants
4 import "ExtrasConstants.js" as ExtrasConstants
8 property string currentLine: ''
9 property string currentDirection: ''
10 property string currentStation: ''
11 property string currentUrl: ''
13 acceptButtonText: 'Select'
14 rejectButtonText: 'Cancel'
16 function loadData(lineName) {
17 stationSheet.currentLine = lineName
19 directionChooser.direction1 = ''
20 directionChooser.direction2 = ''
22 directionChooserBusyIndicator.running = true
23 itip.load_directions(stationSheet.currentLine)
25 firstDirection.clicked()
26 directionChooser.checkedButton = firstDirection
33 directionChooserBusyIndicator.running = false
35 directionChooser.direction1 = itip.get_direction(0)
36 directionChooser.direction2 = itip.get_direction(1)
38 firstDirection.clicked()
39 directionChooser.checkedButton = firstDirection
48 property string direction1
49 property string direction2
51 visible: !directionChooserBusyIndicator.running
53 function chosen(idx) {
54 console.log('direction chosen: '+ idx)
56 stationSelectorListView.selectedIndex = -1
59 stationSheet.currentDirection = directionChooser.direction1
61 stationSheet.currentDirection = directionChooser.direction2
64 directionChooserModel.clear()
65 var stations = itip.get_stations(stationSheet.currentLine, stationSheet.currentDirection)
67 for (var s in stations) {
68 directionChooserModel.append({'station': stations[s]})
81 text: 'Richtung ' + directionChooser.direction1
82 onClicked: directionChooser.chosen(1)
87 text: 'Richtung ' + directionChooser.direction2
88 onClicked: directionChooser.chosen(2)
93 id: stationSelectorListView
94 visible: !directionChooserBusyIndicator.running
96 property int selectedIndex: -1
97 onSelectedIndexChanged: {
98 console.log('current index: ' + selectedIndex)
99 if (selectedIndex != -1) {
100 stationSheet.currentStation = directionChooserModel.get(selectedIndex).station
102 stationSheet.currentStation = ''
108 top: directionChooser.bottom
111 bottom: parent.bottom
117 id: directionChooserModel
120 delegate: SheetListItem { selector: stationSelectorListView }
124 flickableItem: stationSelectorListView
128 id: directionChooserBusyIndicator
129 anchors.centerIn: parent
131 platformStyle: BusyIndicatorStyle { size: 'large' }