2 import QtMobility.location 1.1
3 import com.nokia.meego 1.0
4 import net.cirulla.quandoparte 1.0
7 property variant stationView
9 Component.onCompleted: {
10 stationListProxyModel.sortingMode = StationListProxyModel.AlphaSorting
12 tools: ToolBarLayout {
14 ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
15 ToolIcon { iconId: "icon-m-toolbar-settings"; onClicked: settingsSheet.open(); }
16 ToolIcon { iconId: "icon-m-toolbar-view-menu"; }
19 function loadStation()
21 var component = Qt.createComponent("StationPage.qml");
22 if (component.status == Component.Ready) {
23 var view = component.createObject(stationListPage)
24 stationListPage.stationView = view
26 view.html = "<h1>Hello World</h1><p>Lorem ipsum</p>"
29 console.log('Cannot load component: ' + component.errorString());
32 function highlightSearch(s)
34 // TODO compile RegExp on change, or find a way to cleanly use
35 // stationListProxyModel.filterRegExp
36 if (searchField.text.length) {
37 var r = new RegExp(searchField.text, 'i')
39 return s.replace(r, '<span style="text-decoration:underline">' +
49 width: parent.width - 32
56 target: stationListProxyModel
57 property: "searchPattern"
58 value: searchField.text
65 model: stationListProxyModel
74 visible: mouseArea.pressed
75 source: "image://theme/meegotouch-list-background-pressed-center"
81 anchors.verticalCenter: parent.verticalCenter
85 text: highlightSearch(model.display)
92 anchors.fill: background
94 stationListPage.loadStation(model.display)
103 acceptButtonText: "Save"
104 rejectButtonText: "Cancel"
108 width: parent.width - 32
109 height: parent.height - 32
116 anchors.left: parent.left
117 anchors.right: parent.right
120 text: "Show Last Station on Startup"
121 anchors.verticalCenter: parent.verticalCenter
124 anchors.verticalCenter: parent.verticalCenter
125 id: showLastStationSwitch
126 anchors.right: parent.right
132 anchors.left: parent.left
133 anchors.right: parent.right
136 text: "Update Display Periodically"
137 anchors.verticalCenter: parent.verticalCenter
140 anchors.verticalCenter: parent.verticalCenter
141 anchors.right: parent.right
142 id: periodicCheckSwitch