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">' +
48 anchors.top: parent.top
49 selectedIndex: stationListProxyModel.sortingMode
53 name: QT_TR_NOOP("Stations by Name")
56 name: QT_TR_NOOP("Stations by Distance")
59 name: QT_TR_NOOP("Stations Recently Seen")
65 anchors.top: header.bottom
68 target: stationListProxyModel
69 property: "searchPattern"
70 value: searchField.text
73 target: stationListProxyModel
74 property: "sortingMode"
75 value: header.selectedIndex
80 anchors.top: mainView.top
83 GradientStop {color: "#aa000000"; position: 0.0}
84 GradientStop {color: "#00000000"; position: 1.0}
91 anchors.top: searchField.bottom
92 width: parent.width - 32
99 model: stationListProxyModel
108 visible: mouseArea.pressed
109 source: "image://theme/meegotouch-list-background-pressed-center"
115 anchors.verticalCenter: parent.verticalCenter
119 text: highlightSearch(model.display)
126 anchors.fill: background
128 stationListPage.loadStation(model.display)
137 acceptButtonText: qsTr("Save")
138 rejectButtonText: qsTr("Cancel")
142 width: parent.width - 32
143 height: parent.height - 32
150 anchors.left: parent.left
151 anchors.right: parent.right
154 text: "Show Last Station on Startup"
155 anchors.verticalCenter: parent.verticalCenter
158 anchors.verticalCenter: parent.verticalCenter
159 id: showLastStationSwitch
160 anchors.right: parent.right
166 anchors.left: parent.left
167 anchors.right: parent.right
170 text: "Update Display Periodically"
171 anchors.verticalCenter: parent.verticalCenter
174 anchors.verticalCenter: parent.verticalCenter
175 anchors.right: parent.right
176 id: periodicCheckSwitch