Merge lp:~nik90/unav/fix-pagestack-navigation into lp:unav
- fix-pagestack-navigation
- Merge into trunk
Proposed by
Nekhelesh Ramananthan
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 30 | ||||
Proposed branch: | lp:~nik90/unav/fix-pagestack-navigation | ||||
Merge into: | lp:unav | ||||
Diff against target: |
294 lines (+33/-38) 8 files modified
qml/Coordinate.qml (+2/-2) qml/FavoritesPage.qml (+7/-5) qml/Nearby.qml (+6/-3) qml/PoiListPage.qml (+3/-8) qml/PoiPage.qml (+1/-9) qml/RoutePage.qml (+1/-1) qml/SearchPage.qml (+8/-7) qml/SharePage.qml (+5/-3) |
||||
To merge this branch: | bzr merge lp:~nik90/unav/fix-pagestack-navigation | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
costales | Approve | ||
Review via email: mp+291032@code.launchpad.net |
Commit message
Revamped the pagestack navigation code. pop() and clear() are quite clever at what page they pop.
Description of the change
Improves the pagestack navigation code massively. No more headaches on which page gets pushed from which page and so on. This is how it was meant to be written ;)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'qml/Coordinate.qml' | |||
2 | --- qml/Coordinate.qml 2016-04-03 10:34:22 +0000 | |||
3 | +++ qml/Coordinate.qml 2016-04-05 19:49:15 +0000 | |||
4 | @@ -101,7 +101,7 @@ | |||
5 | 101 | mainPageStack.clickedLng = parseFloat(aux_lng).toFixed(5); | 101 | mainPageStack.clickedLng = parseFloat(aux_lng).toFixed(5); |
6 | 102 | if (mainPageStack.center_onpos === 2) | 102 | if (mainPageStack.center_onpos === 2) |
7 | 103 | mainPageStack.center_onpos = 1; | 103 | mainPageStack.center_onpos = 1; |
9 | 104 | mainPageStack.pop(coordPage); | 104 | mainPageStack.clear(); |
10 | 105 | mainPageStack.executeJavaScript( | 105 | mainPageStack.executeJavaScript( |
11 | 106 | "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);" | 106 | "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);" |
12 | 107 | ); | 107 | ); |
13 | @@ -305,7 +305,7 @@ | |||
14 | 305 | mainPageStack.clickedLng = parseFloat(aux_lng).toFixed(5); | 305 | mainPageStack.clickedLng = parseFloat(aux_lng).toFixed(5); |
15 | 306 | if (mainPageStack.center_onpos === 2) | 306 | if (mainPageStack.center_onpos === 2) |
16 | 307 | mainPageStack.center_onpos = 1; | 307 | mainPageStack.center_onpos = 1; |
18 | 308 | mainPageStack.pop(coordPage); | 308 | mainPageStack.clear(); |
19 | 309 | mainPageStack.executeJavaScript( | 309 | mainPageStack.executeJavaScript( |
20 | 310 | "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);" | 310 | "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);" |
21 | 311 | ); | 311 | ); |
22 | 312 | 312 | ||
23 | === modified file 'qml/FavoritesPage.qml' | |||
24 | --- qml/FavoritesPage.qml 2016-04-03 08:11:41 +0000 | |||
25 | +++ qml/FavoritesPage.qml 2016-04-05 19:49:15 +0000 | |||
26 | @@ -59,14 +59,16 @@ | |||
27 | 59 | visible: header === standardHeader | 59 | visible: header === standardHeader |
28 | 60 | z: 500 | 60 | z: 500 |
29 | 61 | flickable: favoritesListView | 61 | flickable: favoritesListView |
30 | 62 | // #FIXME: This back button is only here to allow the user to press Escape to go back. | ||
31 | 63 | // This feature will be implemented upstream by the SDK devs when they add keyboard shortcuts to pages, | ||
32 | 64 | // at which point this back button can be removed. | ||
33 | 62 | leadingActionBar.actions: Action { | 65 | leadingActionBar.actions: Action { |
34 | 63 | iconName: "back" | 66 | iconName: "back" |
35 | 64 | text: i18n.tr("Back") | 67 | text: i18n.tr("Back") |
36 | 65 | shortcut: "Escape" | 68 | shortcut: "Escape" |
37 | 66 | enabled: header === standardHeader | 69 | enabled: header === standardHeader |
38 | 67 | onTriggered: { | 70 | onTriggered: { |
41 | 68 | mainPageStack.pop(favoritesPage) | 71 | mainPageStack.pop() |
40 | 69 | mainPageStack.push(Qt.resolvedUrl("RoutePage.qml")) | ||
42 | 70 | } | 72 | } |
43 | 71 | } | 73 | } |
44 | 72 | trailingActionBar.actions: Action { | 74 | trailingActionBar.actions: Action { |
45 | @@ -130,7 +132,7 @@ | |||
46 | 130 | Action { | 132 | Action { |
47 | 131 | iconName: "send" | 133 | iconName: "send" |
48 | 132 | onTriggered: { | 134 | onTriggered: { |
50 | 133 | mainPageStack.pop(favoritesPage); | 135 | mainPageStack.clear(); |
51 | 134 | mainPageStack.center_onpos = 2; | 136 | mainPageStack.center_onpos = 2; |
52 | 135 | mainPageStack.routeState = 'yes'; | 137 | mainPageStack.routeState = 'yes'; |
53 | 136 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); | 138 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); |
54 | @@ -162,7 +164,7 @@ | |||
55 | 162 | } | 164 | } |
56 | 163 | 165 | ||
57 | 164 | onClicked: { | 166 | onClicked: { |
59 | 165 | mainPageStack.pop(favoritesPage); | 167 | mainPageStack.clear() |
60 | 166 | if (navApp.settings.saveHistory) { | 168 | if (navApp.settings.saveHistory) { |
61 | 167 | UnavDB.saveTofavHistory(model.name, model.lat, model.lng); | 169 | UnavDB.saveTofavHistory(model.name, model.lat, model.lng); |
62 | 168 | } | 170 | } |
63 | @@ -215,7 +217,7 @@ | |||
64 | 215 | } | 217 | } |
65 | 216 | Action { | 218 | Action { |
66 | 217 | text: i18n.tr("Add From Map") | 219 | text: i18n.tr("Add From Map") |
68 | 218 | onTriggered: mainPageStack.pop(favoritesPage); | 220 | onTriggered: mainPageStack.clear() |
69 | 219 | } | 221 | } |
70 | 220 | } | 222 | } |
71 | 221 | } | 223 | } |
72 | 222 | 224 | ||
73 | === modified file 'qml/Nearby.qml' | |||
74 | --- qml/Nearby.qml 2016-04-01 14:18:40 +0000 | |||
75 | +++ qml/Nearby.qml 2016-04-05 19:49:15 +0000 | |||
76 | @@ -26,13 +26,15 @@ | |||
77 | 26 | title: i18n.tr("Nearby") | 26 | title: i18n.tr("Nearby") |
78 | 27 | flickable: flickable | 27 | flickable: flickable |
79 | 28 | 28 | ||
80 | 29 | // #FIXME: This back button is only here to allow the user to press Escape keyboard key to go back. | ||
81 | 30 | // This feature will be implemented upstream by the SDK devs when they add keyboard shortcuts to pages, | ||
82 | 31 | // at which point this back button can be removed. | ||
83 | 29 | leadingActionBar.actions: Action { | 32 | leadingActionBar.actions: Action { |
84 | 30 | iconName: "back" | 33 | iconName: "back" |
85 | 31 | text: i18n.tr("Back") | 34 | text: i18n.tr("Back") |
86 | 32 | shortcut: "Escape" | 35 | shortcut: "Escape" |
87 | 33 | onTriggered: { | 36 | onTriggered: { |
90 | 34 | mainPageStack.pop(nearbyPage) | 37 | mainPageStack.pop() |
89 | 35 | mainPageStack.push(Qt.resolvedUrl("RoutePage.qml")) | ||
91 | 36 | } | 38 | } |
92 | 37 | } | 39 | } |
93 | 38 | } | 40 | } |
94 | @@ -68,11 +70,12 @@ | |||
95 | 68 | icon.source: model.source | 70 | icon.source: model.source |
96 | 69 | 71 | ||
97 | 70 | onClicked: { | 72 | onClicked: { |
98 | 71 | mainPageStack.pop(nearbyPage); | ||
99 | 72 | if (model.mode === "CURRENT") { | 73 | if (model.mode === "CURRENT") { |
100 | 73 | mainPageStack.push(Qt.resolvedUrl("./PoiPage.qml"), {"fromPage": "Nearby.qml", "lat": mainPageStack.currentLat, "lng": mainPageStack.currentLng}) | 74 | mainPageStack.push(Qt.resolvedUrl("./PoiPage.qml"), {"fromPage": "Nearby.qml", "lat": mainPageStack.currentLat, "lng": mainPageStack.currentLng}) |
101 | 74 | } else if (model.mode === "DESTINATION") { | 75 | } else if (model.mode === "DESTINATION") { |
102 | 75 | mainPageStack.push(Qt.resolvedUrl("./PoiPage.qml"), {"fromPage": "Nearby.qml", "lat": mainPageStack.endLat, "lng": mainPageStack.endLng}) | 76 | mainPageStack.push(Qt.resolvedUrl("./PoiPage.qml"), {"fromPage": "Nearby.qml", "lat": mainPageStack.endLat, "lng": mainPageStack.endLng}) |
103 | 77 | } else if (model.mode === "MAP") { | ||
104 | 78 | mainPageStack.clear(); // Show map | ||
105 | 76 | } | 79 | } |
106 | 77 | } | 80 | } |
107 | 78 | } | 81 | } |
108 | 79 | 82 | ||
109 | === modified file 'qml/PoiListPage.qml' | |||
110 | --- qml/PoiListPage.qml 2016-04-03 11:11:50 +0000 | |||
111 | +++ qml/PoiListPage.qml 2016-04-05 19:49:15 +0000 | |||
112 | @@ -44,8 +44,7 @@ | |||
113 | 44 | if (mainPageStack.center_onpos === 2) | 44 | if (mainPageStack.center_onpos === 2) |
114 | 45 | mainPageStack.center_onpos = 1; | 45 | mainPageStack.center_onpos = 1; |
115 | 46 | mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(sortedPoiModel.allPOI()) + ");") | 46 | mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(sortedPoiModel.allPOI()) + ");") |
118 | 47 | mainPageStack.pop(poiListPage.fromPage) | 47 | mainPageStack.clear() |
117 | 48 | mainPageStack.pop(poiListPage) | ||
119 | 49 | } | 48 | } |
120 | 50 | } | 49 | } |
121 | 51 | } | 50 | } |
122 | @@ -259,8 +258,7 @@ | |||
123 | 259 | Action { | 258 | Action { |
124 | 260 | iconName: "send" | 259 | iconName: "send" |
125 | 261 | onTriggered: { | 260 | onTriggered: { |
128 | 262 | mainPageStack.pop(poiListPage.fromPage) | 261 | mainPageStack.clear() |
127 | 263 | mainPageStack.pop(poiListPage) | ||
129 | 264 | mainPageStack.center_onpos = 2; | 262 | mainPageStack.center_onpos = 2; |
130 | 265 | mainPageStack.routeState = 'yes' | 263 | mainPageStack.routeState = 'yes' |
131 | 266 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); | 264 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); |
132 | @@ -269,8 +267,6 @@ | |||
133 | 269 | Action { | 267 | Action { |
134 | 270 | iconName: "non-starred" | 268 | iconName: "non-starred" |
135 | 271 | onTriggered: { | 269 | onTriggered: { |
136 | 272 | mainPageStack.pop(poiListPage.fromPage) | ||
137 | 273 | mainPageStack.pop(poiListPage) | ||
138 | 274 | mainPageStack.push(Qt.resolvedUrl("FavoritesPage.qml"), {isAddedFromPopup: true, lat: model.lat, lng: model.lng, favName: model.name}) | 270 | mainPageStack.push(Qt.resolvedUrl("FavoritesPage.qml"), {isAddedFromPopup: true, lat: model.lat, lng: model.lng, favName: model.name}) |
139 | 275 | } | 271 | } |
140 | 276 | }, | 272 | }, |
141 | @@ -298,8 +294,7 @@ | |||
142 | 298 | } | 294 | } |
143 | 299 | 295 | ||
144 | 300 | onClicked: { | 296 | onClicked: { |
147 | 301 | mainPageStack.pop(poiListPage.fromPage) | 297 | mainPageStack.clear() |
146 | 302 | mainPageStack.pop(poiListPage); | ||
148 | 303 | mainPageStack.executeJavaScript("ui.markers_POI_set([{title: \"" + model.name + "\", lat: " + model.lat + ", lng: " + model.lng + ", website: \"" + model.website + "\", phone: \"" + model.phone + "\"}]);"); | 298 | mainPageStack.executeJavaScript("ui.markers_POI_set([{title: \"" + model.name + "\", lat: " + model.lat + ", lng: " + model.lng + ", website: \"" + model.website + "\", phone: \"" + model.phone + "\"}]);"); |
149 | 304 | } | 299 | } |
150 | 305 | 300 | ||
151 | 306 | 301 | ||
152 | === modified file 'qml/PoiPage.qml' | |||
153 | --- qml/PoiPage.qml 2016-03-31 18:20:06 +0000 | |||
154 | +++ qml/PoiPage.qml 2016-04-05 19:49:15 +0000 | |||
155 | @@ -35,14 +35,6 @@ | |||
156 | 35 | header: standardHeader | 35 | header: standardHeader |
157 | 36 | anchors.fill: parent | 36 | anchors.fill: parent |
158 | 37 | 37 | ||
159 | 38 | function goBackStandardMode() { | ||
160 | 39 | mainPageStack.pop(poiPage); | ||
161 | 40 | if (poiPage.fromPage === "RoutePage.qml") | ||
162 | 41 | mainPageStack.push(Qt.resolvedUrl("RoutePage.qml")); | ||
163 | 42 | if (poiPage.fromPage === "Nearby.qml") | ||
164 | 43 | mainPageStack.push(Qt.resolvedUrl("Nearby.qml")); | ||
165 | 44 | } | ||
166 | 45 | |||
167 | 46 | function goBackSearchMode() { | 38 | function goBackSearchMode() { |
168 | 47 | categoryList.forceActiveFocus() | 39 | categoryList.forceActiveFocus() |
169 | 48 | poiPage.header = standardHeader | 40 | poiPage.header = standardHeader |
170 | @@ -62,7 +54,7 @@ | |||
171 | 62 | iconName: "back" | 54 | iconName: "back" |
172 | 63 | text: i18n.tr("Back") | 55 | text: i18n.tr("Back") |
173 | 64 | onTriggered: { | 56 | onTriggered: { |
175 | 65 | goBackStandardMode() | 57 | mainPageStack.pop() |
176 | 66 | } | 58 | } |
177 | 67 | } | 59 | } |
178 | 68 | 60 | ||
179 | 69 | 61 | ||
180 | === modified file 'qml/RoutePage.qml' | |||
181 | --- qml/RoutePage.qml 2016-04-01 14:18:40 +0000 | |||
182 | +++ qml/RoutePage.qml 2016-04-05 19:49:15 +0000 | |||
183 | @@ -62,7 +62,6 @@ | |||
184 | 62 | visible: model.visible | 62 | visible: model.visible |
185 | 63 | 63 | ||
186 | 64 | onClicked: { | 64 | onClicked: { |
187 | 65 | mainPageStack.pop(routePage) | ||
188 | 66 | if (model.mode === "FAVORITES") { | 65 | if (model.mode === "FAVORITES") { |
189 | 67 | mainPageStack.push(Qt.resolvedUrl("FavoritesPage.qml")) | 66 | mainPageStack.push(Qt.resolvedUrl("FavoritesPage.qml")) |
190 | 68 | } else if (model.mode === "SEARCH") { | 67 | } else if (model.mode === "SEARCH") { |
191 | @@ -76,6 +75,7 @@ | |||
192 | 76 | } else if (model.mode === "CANCEL") { | 75 | } else if (model.mode === "CANCEL") { |
193 | 77 | mainPageStack.routeState = 'no'; | 76 | mainPageStack.routeState = 'no'; |
194 | 78 | mainPageStack.executeJavaScript("click_cancel_route();") | 77 | mainPageStack.executeJavaScript("click_cancel_route();") |
195 | 78 | mainPageStack.pop() | ||
196 | 79 | } | 79 | } |
197 | 80 | } | 80 | } |
198 | 81 | } | 81 | } |
199 | 82 | 82 | ||
200 | === modified file 'qml/SearchPage.qml' | |||
201 | --- qml/SearchPage.qml 2016-03-30 01:01:54 +0000 | |||
202 | +++ qml/SearchPage.qml 2016-04-05 19:49:15 +0000 | |||
203 | @@ -30,12 +30,14 @@ | |||
204 | 30 | header: PageHeader { | 30 | header: PageHeader { |
205 | 31 | title: i18n.tr("Search") | 31 | title: i18n.tr("Search") |
206 | 32 | flickable: statusLabel.visible ? resultsListView : historyListView | 32 | flickable: statusLabel.visible ? resultsListView : historyListView |
207 | 33 | // #FIXME: This back button is only here to allow the user to press Escape keyboard key to go back. | ||
208 | 34 | // This feature will be implemented upstream by the SDK devs when they add keyboard shortcuts to pages, | ||
209 | 35 | // at which point this back button can be removed. | ||
210 | 33 | leadingActionBar.actions: Action { | 36 | leadingActionBar.actions: Action { |
211 | 34 | iconName: "back" | 37 | iconName: "back" |
212 | 35 | text: i18n.tr("Back") | 38 | text: i18n.tr("Back") |
213 | 36 | onTriggered: { | 39 | onTriggered: { |
216 | 37 | mainPageStack.pop(searchPage) | 40 | mainPageStack.pop() |
215 | 38 | mainPageStack.push(Qt.resolvedUrl("RoutePage.qml")) | ||
217 | 39 | } | 41 | } |
218 | 40 | } | 42 | } |
219 | 41 | 43 | ||
220 | @@ -261,7 +263,7 @@ | |||
221 | 261 | iconName: "send" | 263 | iconName: "send" |
222 | 262 | visible: model.title !== i18n.tr("Nearby history") | 264 | visible: model.title !== i18n.tr("Nearby history") |
223 | 263 | onTriggered: { | 265 | onTriggered: { |
225 | 264 | mainPageStack.pop(searchPage); | 266 | mainPageStack.clear(); |
226 | 265 | mainPageStack.center_onpos = 2; | 267 | mainPageStack.center_onpos = 2; |
227 | 266 | mainPageStack.routeState = 'yes'; | 268 | mainPageStack.routeState = 'yes'; |
228 | 267 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); | 269 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); |
229 | @@ -307,7 +309,7 @@ | |||
230 | 307 | geoDistFactor: 5 | 309 | geoDistFactor: 5 |
231 | 308 | }) | 310 | }) |
232 | 309 | } else { | 311 | } else { |
234 | 310 | mainPageStack.pop(searchPage); | 312 | mainPageStack.clear(); |
235 | 311 | mainPageStack.executeJavaScript("ui.markers_POI_set([{ title: \"" + | 313 | mainPageStack.executeJavaScript("ui.markers_POI_set([{ title: \"" + |
236 | 312 | model.name + "\", lat: " + | 314 | model.name + "\", lat: " + |
237 | 313 | model.lat + ", lng: " + | 315 | model.lat + ", lng: " + |
238 | @@ -336,7 +338,7 @@ | |||
239 | 336 | if (navApp.settings.saveHistory) { | 338 | if (navApp.settings.saveHistory) { |
240 | 337 | UnavDB.saveToSearchHistory(model.name, model.lat, model.lng) | 339 | UnavDB.saveToSearchHistory(model.name, model.lat, model.lng) |
241 | 338 | } | 340 | } |
243 | 339 | mainPageStack.pop(searchPage); | 341 | mainPageStack.clear(); |
244 | 340 | mainPageStack.center_onpos = 2; | 342 | mainPageStack.center_onpos = 2; |
245 | 341 | mainPageStack.routeState = 'yes' | 343 | mainPageStack.routeState = 'yes' |
246 | 342 | mainPageStack.executeJavaScript("calc2coord(" + model.lat + "," + model.lng + ");") | 344 | mainPageStack.executeJavaScript("calc2coord(" + model.lat + "," + model.lng + ");") |
247 | @@ -351,7 +353,6 @@ | |||
248 | 351 | Action { | 353 | Action { |
249 | 352 | iconName: "non-starred" | 354 | iconName: "non-starred" |
250 | 353 | onTriggered: { | 355 | onTriggered: { |
251 | 354 | mainPageStack.pop(searchPage) | ||
252 | 355 | mainPageStack.push(Qt.resolvedUrl("FavoritesPage.qml"), {isAddedFromPopup:true, lat: model.lat, lng: model.lng, favName: model.name}) | 356 | mainPageStack.push(Qt.resolvedUrl("FavoritesPage.qml"), {isAddedFromPopup:true, lat: model.lat, lng: model.lng, favName: model.name}) |
253 | 356 | } | 357 | } |
254 | 357 | } | 358 | } |
255 | @@ -362,7 +363,7 @@ | |||
256 | 362 | if (navApp.settings.saveHistory) { | 363 | if (navApp.settings.saveHistory) { |
257 | 363 | UnavDB.saveToSearchHistory(model.name, model.lat, model.lng); | 364 | UnavDB.saveToSearchHistory(model.name, model.lat, model.lng); |
258 | 364 | } | 365 | } |
260 | 365 | mainPageStack.pop(searchPage); | 366 | mainPageStack.clear(); |
261 | 366 | mainPageStack.executeJavaScript("ui.markers_POI_set([{title: \"" + model.name + "\", lat: " + model.lat + ", lng: " + model.lng + "}]);"); | 367 | mainPageStack.executeJavaScript("ui.markers_POI_set([{title: \"" + model.name + "\", lat: " + model.lat + ", lng: " + model.lng + "}]);"); |
262 | 367 | } | 368 | } |
263 | 368 | 369 | ||
264 | 369 | 370 | ||
265 | === modified file 'qml/SharePage.qml' | |||
266 | --- qml/SharePage.qml 2016-04-01 14:18:40 +0000 | |||
267 | +++ qml/SharePage.qml 2016-04-05 19:49:15 +0000 | |||
268 | @@ -27,13 +27,15 @@ | |||
269 | 27 | title: i18n.tr("Share Position") | 27 | title: i18n.tr("Share Position") |
270 | 28 | flickable: flickable | 28 | flickable: flickable |
271 | 29 | 29 | ||
272 | 30 | // #FIXME: This back button is only here to allow the user to press Escape keyboard key to go back. | ||
273 | 31 | // This feature will be implemented upstream by the SDK devs when they add keyboard shortcuts to pages, | ||
274 | 32 | // at which point this back button can be removed. | ||
275 | 30 | leadingActionBar.actions: Action { | 33 | leadingActionBar.actions: Action { |
276 | 31 | iconName: "back" | 34 | iconName: "back" |
277 | 32 | text: i18n.tr("Back") | 35 | text: i18n.tr("Back") |
278 | 33 | shortcut: "Escape" | 36 | shortcut: "Escape" |
279 | 34 | onTriggered: { | 37 | onTriggered: { |
282 | 35 | mainPageStack.pop(sharePage) | 38 | mainPageStack.pop() |
281 | 36 | mainPageStack.push(Qt.resolvedUrl("RoutePage.qml")) | ||
283 | 37 | } | 39 | } |
284 | 38 | } | 40 | } |
285 | 39 | } | 41 | } |
286 | @@ -74,7 +76,7 @@ | |||
287 | 74 | } else if (model.model === "DESTINATION") { | 76 | } else if (model.model === "DESTINATION") { |
288 | 75 | PopupUtils.open(Qt.resolvedUrl("./Share.qml"), navApp, {"lat": mainPageStack.endLat, "lon": mainPageStack.endLng}) | 77 | PopupUtils.open(Qt.resolvedUrl("./Share.qml"), navApp, {"lat": mainPageStack.endLat, "lon": mainPageStack.endLng}) |
289 | 76 | } else if (model.mode === "MAP") { | 78 | } else if (model.mode === "MAP") { |
291 | 77 | mainPageStack.pop(sharePage); // Show map | 79 | mainPageStack.clear(); // Show map |
292 | 78 | } | 80 | } |
293 | 79 | } | 81 | } |
294 | 80 | } | 82 | } |
Great work :)