2 import Sailfish.Silica 1.0
3 import net.cirulla.quandoparte 1.0
4 import "StationListPage.js" as Private
8 property variant stationView
9 property string searchPattern
11 target: stationListProxyModel
12 property: "searchPattern"
13 value: stationListPage.searchPattern
16 interactive: !stationListView.flicking
21 text: qsTr("About Quando Parte")
22 onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
25 text: qsTr("Stations by Name")
26 onClicked: stationListProxyModel.sortingMode = StationListProxyModel.AlphaSorting
29 text: qsTr("Stations by Distance")
30 onClicked: stationListProxyModel.sortingMode = StationListProxyModel.DistanceSorting
33 text: qsTr("Stations Recently Seen")
34 onClicked: stationListProxyModel.sortingMode = StationListProxyModel.RecentUsageSorting
41 placeholderText: qsTr("Search station...")
42 inputMethodHints: Qt.ImhNoAutoUppercase
43 onTextChanged: stationListPage.searchPattern = searchField.text
44 width: stationListPage.width
45 EnterKey.onClicked: searchField.focus = false
52 cacheBuffer: 4 * Theme.itemSizeExtraSmall
53 anchors.top: header.bottom
54 anchors.bottom: parent.bottom
55 model: stationListProxyModel
58 contentHeight: Theme.itemSizeExtraSmall
64 margins: Theme.paddingMedium
67 textFormat: Text.StyledText
68 text: model.name ? Private.highlightSearch(model.name, Theme.highlightColor) : ""
69 verticalAlignment: Text.AlignVCenter
73 visible: model.favorite
74 source: "image://theme/icon-m-favorite-selected"
76 verticalCenter: parent.verticalCenter
81 searchField.focus = false
82 Private.loadStation(model.name, model.code)
89 text: model.favorite ? qsTr("Remove from Favorites") : qsTr("Add to Favorites")
91 model.favorite ^= true
92 console.log("Favorite Stations:" + settings.favoriteStations)
96 text: qsTr("Show on the map")
97 onClicked: Qt.openUrlExternally("geo:" + model.latitude + "," + model.longitude)
102 VerticalScrollDecorator {}