blob: 4ab9f5c0f6a6b0f955ececfdea18bdbc374931f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
import Qt 4.7
import "pagenavigation.js" as Navit
Rectangle {
id: page
property string poiFilter: ""
width: gui.width; height: gui.height
color: "Black"
opacity: 0
function calculateFilter() {
page.poiFilter='/points/point[type="point_begin" or ';
if (bankBtn.state=="on") {
page.poiFilter+='type="poi_bank" or ';
}
if (fuelBtn.state=="on") {
page.poiFilter+='type="poi_fuel" or ';
page.poiFilter+='type="poi_autoservice" or ';
page.poiFilter+='type="poi_repair_service" or ';
}
if (hotelBtn.state=="on") {
page.poiFilter+='type="poi_hotel" or ';
page.poiFilter+='type="poi_camp_rv" or ';
page.poiFilter+='type="poi_camping" or ';
page.poiFilter+='type="poi_resort" or ';
page.poiFilter+='type="poi_motel" or ';
page.poiFilter+='type="poi_hostel" or ';
}
if (foodBtn.state=="on") {
page.poiFilter+='type="poi_bar" or ';
page.poiFilter+='type="poi_picnic" or ';
page.poiFilter+='type="poi_burgerking" or ';
page.poiFilter+='type="poi_fastfood" or ';
page.poiFilter+='type="poi_restaurant" or ';
}
if (shopBtn.state=="on") {
page.poiFilter+='type="poi_shop_grocery" or ';
page.poiFilter+='type="poi_mall" or ';
}
if (serviceBtn.state=="on") {
page.poiFilter+='type="poi_marina" or ';
page.poiFilter+='type="poi_hospital" or ';
page.poiFilter+='type="poi_public_utilities" or ';
page.poiFilter+='type="poi_police" or ';
page.poiFilter+='type="poi_information" or ';
page.poiFilter+='type="poi_personal_service" or ';
page.poiFilter+='type="poi_restroom" or ';
}
if (parkingBtn.state=="on") {
page.poiFilter+='type="poi_car_parking" or ';
}
if (landBtn.state=="on") {
page.poiFilter+='type="poi_land_feature" or ';
page.poiFilter+='type="poi_rock" or ';
page.poiFilter+='type="poi_dam" or ';
}
page.poiFilter+='type="point_end"]';
listModel.query=page.poiFilter;
listModel.reload();
}
function pageOpen() {
page.opacity = 1;
}
Component.onCompleted: pageOpen();
Behavior on opacity {
NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
}
Text {
id: labelTxt; text: "Points of interest"; color: "White"; font.pointSize: 14;
anchors.horizontalCenter: page.horizontalCenter
anchors.top: page.top
}
VisualItemModel {
id: selectorsModel
ToggleButton { id: bankBtn; text: "Bank"; icon: "bank.svg";stOn: "true"; onChanged: calculateFilter(); }
ToggleButton { id: fuelBtn; text: "Fuel"; icon: "fuel.svg";stOn: "true"; onChanged: calculateFilter(); }
ToggleButton { id: hotelBtn; text: "Hotel"; icon: "bar.svg";stOn: "true"; onChanged: calculateFilter(); }
ToggleButton { id: foodBtn; text: "Food"; icon: "fastfood.svg";stOn: "true"; onChanged: calculateFilter(); }
ToggleButton { id: shopBtn; text: "Shop"; icon: "shopping.svg";stOn: "true"; onChanged: calculateFilter(); }
ToggleButton { id: serviceBtn; text: "Service"; icon: "hospital.svg";stOn: "true"; onChanged: calculateFilter(); }
ToggleButton { id: parkingBtn; text: "Parking"; icon: "police.svg";stOn: "true"; onChanged: calculateFilter(); }
ToggleButton { id: landBtn; text: "Land features"; icon: "peak.svg";stOn: "true"; onChanged: calculateFilter(); }
}
ListView {
id: selectorsList; model: selectorsModel
focus: true; clip: true; orientation: Qt.Horizontal
anchors.horizontalCenter: page.horizontalCenter; anchors.top: labelTxt.bottom
width: page.width; height: bankBtn.height*2
}
Slider {
id: distanceSlider; minValue: 1; maxValue: 250; value: gui.getAttr("radius"); text: "Distance"; onChanged: { gui.setAttr("radius",distanceSlider.value); listModel.xml=point.getPOI("points"); listModel.reload(); }
anchors.top: selectorsList.bottom; anchors.horizontalCenter: page.horizontalCenter;
}
XmlListModel {
id: listModel
xml: point.getPOI("points")
query: "/points/point"
XmlRole { name: "itemName"; query: "name/string()" }
XmlRole { name: "itemType"; query: "type/string()" }
XmlRole { name: "itemDistance"; query: "distance/string()" }
XmlRole { name: "itemDirection"; query: "direction/string()" }
XmlRole { name: "itemValue"; query: "coords/string()" }
}
Component {
id: listDelegate
Item {
id: wrapper
width: list.width; height: 20
Column {
x: 5; y: 5
Text { id: txtItemName; text: itemName; color: "White" }
Text { id: txtItemDist; text: itemDistance; color: "White"; anchors.leftMargin: 5; anchors.left: txtItemName.right;anchors.top: txtItemName.top }
Text { id: txtItemDirect; text: itemDirection; color: "White"; anchors.leftMargin: 5; anchors.left: txtItemDist.right;anchors.top: txtItemDist.top }
}
MouseArea {
id:delegateMouse
anchors.fill: parent
onClicked: { point.setNewPoint(itemValue); gui.returnSource="/main.qml"; Navit.load("PageNavigate.qml"); }
}
}
}
Component {
id: listHighlight
Rectangle {
opacity: 0
}
}
ListSelector {
id:layoutList; text: ""
anchors.top: distanceSlider.bottom;
anchors.left: parent.left;
anchors.topMargin: gui.height/16; anchors.leftMargin: gui.width/32
width: page.width; height: page.height*0.25
}
Cellar {id: cellar; anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
}
|