2 import com.nokia.meego 1.0
3 import com.nokia.extras 1.0
5 import "UIConstants.js" as UIConstants
6 import "ExtrasConstants.js" as ExtrasConstants
10 property string currentSection: ''
11 property string currentLine: ''
13 acceptButtonText: 'Select'
14 rejectButtonText: 'Cancel'
17 var lines = itip.get_lines()
19 for (var i in lines) {
20 lineSelectorModel.append({'name': lines[i]})
22 lineSheet.currentSection = sectionName
24 sectionChooserBusyIndicator.running = true
27 sectionChooser.checkedButton = underground
34 sectionChooserBusyIndicator.running = false
37 sectionChooser.checkedButton = underground
46 property string section1
47 property string section2
48 property string section3
49 property string section4
51 visible: !sectionChooserBusyIndicator.running
53 function chosen(idx) {
54 console.log('section chosen: '+ idx)
56 lineSelectorListView.selectedIndex = -1
59 lineSheet.currentSection = sectionChooser.section1
60 } else if (idx == 2) {
61 lineSheet.currentSection = sectionChooser.section2
62 } else if (idx == 2) {
63 lineSheet.currentSection = sectionChooser.section3
65 lineSheet.currentSection = sectionChooser.section4
67 console.log(lineSheet.currentSection)
69 sectionChooserModel.clear()
70 var lines = itip.get_lines()
72 for (var i in lines) {
73 lineSelectorModel.append({'name': lines[i]})
87 onClicked: sectionChooser.chosen(1)
93 onClicked: sectionChooser.chosen(2)
99 onClicked: sectionChooser.chosen(3)
105 onClicked: sectionChooser.chosen(4)
111 id: lineSelectorListView
112 visible: !sectionChooserBusyIndicator.running
114 property int selectedIndex: -1
115 onSelectedIndexChanged: {
116 console.log('current index: ' + selectedIndex)
117 if (selectedIndex != -1) {
118 lineSheet.currentLine = sectionChooserModel.get(selectedIndex).station
120 lineSheet.currentLine = ''
126 top: sectionChooserModel.bottom
129 bottom: parent.bottom
135 id: sectionChooserModel
138 delegate: SheetListItem { selector: lineSelectorListView }
142 flickableItem: lineSelectorListView
146 id: sectionChooserBusyIndicator
147 anchors.centerIn: parent
149 platformStyle: BusyIndicatorStyle { size: 'large' }
154 gstation.text = stationSheet.currentStation
156 realtimeResult.gline = stationSheet.currentLine
158 realtimeResult.sourceUrl = itip.get_directions_url(lineSheet.currentLine, lineSheet.currentSection, lineSheet.currentStation)