4 function showAboutPage()
6 var component = Qt.createComponent("AboutPage.qml")
7 if (component.status === Component.Ready) {
8 about = component.createObject(stationListPage)
11 console.log('Cannot load component: ' + component.errorString());
14 function loadStation(name, code)
16 var component = Qt.createComponent("StationPage.qml");
17 if (component.status === Component.Ready) {
18 view = component.createObject(stationListPage)
19 stationListPage.stationView = view
23 XXX Ugliness ahead! Changing the name triggers the station
24 schedule to be fetched. So any extra data (the code specifically)
25 must be set before changing the name.
27 if (code !== undefined) view.code = code
31 console.log('Cannot load component: ' + component.errorString());
34 function highlightSearch(s, color)
36 // TODO compile RegExp on change, or find a way to cleanly use
37 // stationListProxyModel.filterRegExp
38 if (searchPattern.length) {
39 var r = new RegExp(searchPattern, 'i')
41 console.log('s is ' + s);
43 return s.replace(r, '<font color="' + color + '">' +