2 import QtMobility.location 1.1
3 import com.nokia.meego 1.0
6 property variant stationView
10 ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
11 ToolIcon { iconId: "icon-m-toolbar-settings"; onClicked: settingsSheet.open(); }
12 ToolIcon { iconId: "icon-m-toolbar-view-menu"; }
15 function loadStation()
17 var component = Qt.createComponent("StationPage.qml");
18 if (component.status == Component.Ready) {
19 var view = component.createObject(stationListPage)
20 stationListPage.stationView = view
22 view.html = "<h1>Hello World</h1><p>Lorem ipsum</p>"
25 console.log('Cannot load component: ' + component.errorString());
28 function highlightSearch(s)
30 // TODO compile RegExp on change, or find a way to cleanly use
31 // stationListProxyModel.filterRegExp
32 if (searchField.text.length) {
33 var r = new RegExp(searchField.text, 'i')
35 return s.replace(r, '<span style="text-decoration:underline">' +
45 width: parent.width - 32
52 target: stationListProxyModel
53 property: "searchPattern"
54 value: searchField.text
61 model: stationListProxyModel
70 visible: mouseArea.pressed
71 source: "image://theme/meegotouch-list-background-pressed-center"
77 anchors.verticalCenter: parent.verticalCenter
81 text: highlightSearch(model.display)
88 anchors.fill: background
90 stationListPage.loadStation(model.display)
99 acceptButtonText: "Save"
100 rejectButtonText: "Cancel"
104 width: parent.width - 32
105 height: parent.height - 32
112 anchors.left: parent.left
113 anchors.right: parent.right
116 text: "Show Last Station on Startup"
117 anchors.verticalCenter: parent.verticalCenter
120 anchors.verticalCenter: parent.verticalCenter
121 id: showLastStationSwitch
122 anchors.right: parent.right
128 anchors.left: parent.left
129 anchors.right: parent.right
132 text: "Update Display Periodically"
133 anchors.verticalCenter: parent.verticalCenter
136 anchors.verticalCenter: parent.verticalCenter
137 anchors.right: parent.right
138 id: periodicCheckSwitch