Merge lp:~joergberroth/unav/WebViewCrashHandling into lp:unav
- WebViewCrashHandling
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~joergberroth/unav/WebViewCrashHandling |
Merge into: | lp:unav |
Diff against target: |
417 lines (+174/-35) 9 files modified
qml/Favorites.qml (+2/-0) qml/Location.qml (+4/-0) qml/Main.qml (+32/-19) qml/PoiDetailsPage.qml (+2/-0) qml/PoiListPage.qml (+2/-0) qml/SearchPage.qml (+1/-3) qml/components/NotificationBar.qml (+30/-2) qml/components/POIQuickAccessGridView.qml (+9/-11) qml/components/WebProcessMonitor.qml (+92/-0) |
To merge this branch: | bzr merge lp:~joergberroth/unav/WebViewCrashHandling |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
costales | Pending | ||
Review via email: mp+296529@code.launchpad.net |
This proposal supersedes a proposal from 2016-05-27.
Commit message
* added WebProcessMonit
- notification that map crashed.
- try to reload webview if it was killed.
- if a route was active, it will be reloaded again.
* adjusted NotificationBar.qml and some code clean up (NotificationBa
Description of the change
* added WebProcessMonit
- notification that map crashed.
- try to reload webview if it was killed.
- if a route was active, it will be reloaded again.
* adjusted NotificationBar.qml and some code clean up (NotificationBa
costales (costales) wrote : Posted in a previous version of this proposal | # |
costales (costales) wrote : | # |
Hi Joerg. I'm doing tests and this is working :))
Please, one question. Why this?
=== modified file 'nav/index.html'
--- nav/index.html 2016-06-08 17:14:51 +0000
+++ nav/index.html 2016-06-13 18:14:57 +0000
@@ -593,6 +593,7 @@
nav.
ui.update();
qml_
+ qml_set_
}
</script>
Thanks |o/
JkB (joergberroth) wrote : | # |
Hey,
This line is needed to always set the current end coords on qml side.
This enables to set the last active route after an oxide crash again
automtically.
Am Montag, 13. Juni 2016 20:20:31 CEST schrieb costales
<email address hidden>:
> Hi Joerg. I'm doing tests and this is working :))
>
> Please, one question. Why this?
>
> === modified file 'nav/index.html'
> --- nav/index.html 2016-06-08 17:14:51 +0000
> +++ nav/index.html 2016-06-13 18:14:57 +0000
> @@ -593,6 +593,7 @@
> nav.set_
> ui.update();
> qml_set_
> + qml_set_
> }
> </script>
>
> Thanks |o/
--
Versandt, mit Dekko von meinem Ubuntu-Gerät
costales (costales) wrote : | # |
From my knowledge and tests more than 1 call between qml + html
created weird conflicts.
Could be that set in the initialization call on the new .qml?
Best regards!
JkB (joergberroth) wrote : | # |
?
So far i have not experieced any issues with that.
It is important, that qml side is updated with the route details ad soon as
a route starts. Maybe you find a better place for the command....
Am Montag, 13. Juni 2016 21:57:23 CEST schrieb costales
<email address hidden>:
>>From my knowledge and tests more than 1 call between qml + html
> created weird conflicts.
>
> Could be that set in the initialization call on the new .qml?
>
> Best regards!
>
--
Versandt, mit Dekko von meinem Ubuntu-Gerät
Unmerged revisions
- 78. By JkB
-
* modified notification text
- 77. By JkB
-
*merge with costales branch
- 76. By JkB
-
*changed error messages text
- 75. By JkB
-
*removed timer and improved popup handling
- 74. By JkB
-
*merge with trunk
- 73. By JkB
-
*removed typo in id
*added close() signal - 72. By JkB
-
*ensure that endLat/endLng will always be set in Main.qml if route_state changes to "yes"
- 71. By JkB
-
*add another notification
*wait 500ms before recalculating route
*modified a notifiacation in WebProcessMonitor.qml - 70. By JkB
-
* small format fix
- 69. By JkB
-
* added WebProcessMonit
or.qml from webbrowser-app to manage webview kills
- notification that map crashed.
- try to reload webview if it was killed.
- if a route was active, it will be reloaded again.
* adjusted NotificationBar.qml and some code clean up (NotificationBarTimer handling)
Preview Diff
1 | === modified file 'qml/Favorites.qml' | |||
2 | --- qml/Favorites.qml 2016-05-05 19:21:33 +0000 | |||
3 | +++ qml/Favorites.qml 2016-06-14 19:54:18 +0000 | |||
4 | @@ -114,6 +114,8 @@ | |||
5 | 114 | mainPageStack.removePages(mainPageStack.primaryPage) | 114 | mainPageStack.removePages(mainPageStack.primaryPage) |
6 | 115 | mainPageStack.center_onpos = 2; | 115 | mainPageStack.center_onpos = 2; |
7 | 116 | mainPageStack.routeState = 'yes'; | 116 | mainPageStack.routeState = 'yes'; |
8 | 117 | mainPageStack.endLat = model.lat; | ||
9 | 118 | mainPageStack.endLng = model.lng; | ||
10 | 117 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); | 119 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); |
11 | 118 | } | 120 | } |
12 | 119 | }, | 121 | }, |
13 | 120 | 122 | ||
14 | === modified file 'qml/Location.qml' | |||
15 | --- qml/Location.qml 2016-06-03 13:52:53 +0000 | |||
16 | +++ qml/Location.qml 2016-06-14 19:54:18 +0000 | |||
17 | @@ -256,6 +256,8 @@ | |||
18 | 256 | mainPageStack.removePages(mainPageStack.primaryPage) | 256 | mainPageStack.removePages(mainPageStack.primaryPage) |
19 | 257 | mainPageStack.center_onpos = 2; | 257 | mainPageStack.center_onpos = 2; |
20 | 258 | mainPageStack.routeState = 'yes' | 258 | mainPageStack.routeState = 'yes' |
21 | 259 | mainPageStack.endLat = model.lat; | ||
22 | 260 | mainPageStack.endLng = model.lng; | ||
23 | 259 | mainPageStack.executeJavaScript("calc2coord(" + model.lat + "," + model.lng + ");") | 261 | mainPageStack.executeJavaScript("calc2coord(" + model.lat + "," + model.lng + ");") |
24 | 260 | } | 262 | } |
25 | 261 | }, | 263 | }, |
26 | @@ -341,6 +343,8 @@ | |||
27 | 341 | mainPageStack.removePages(mainPageStack.primaryPage) | 343 | mainPageStack.removePages(mainPageStack.primaryPage) |
28 | 342 | mainPageStack.center_onpos = 2; | 344 | mainPageStack.center_onpos = 2; |
29 | 343 | mainPageStack.routeState = 'yes'; | 345 | mainPageStack.routeState = 'yes'; |
30 | 346 | mainPageStack.endLat = model.lat; | ||
31 | 347 | mainPageStack.endLng = model.lng; | ||
32 | 344 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); | 348 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); |
33 | 345 | } | 349 | } |
34 | 346 | }, | 350 | }, |
35 | 347 | 351 | ||
36 | === modified file 'qml/Main.qml' | |||
37 | --- qml/Main.qml 2016-06-08 17:16:09 +0000 | |||
38 | +++ qml/Main.qml 2016-06-14 19:54:18 +0000 | |||
39 | @@ -150,6 +150,7 @@ | |||
40 | 150 | property int center_onpos: 0 // 0 GPS off, 1 GPS on + not center, 2 GPS on + center | 150 | property int center_onpos: 0 // 0 GPS off, 1 GPS on + not center, 2 GPS on + center |
41 | 151 | property bool favPopup: false | 151 | property bool favPopup: false |
42 | 152 | property bool onLoadingExecuted: false | 152 | property bool onLoadingExecuted: false |
43 | 153 | property bool forcedReload: false | ||
44 | 153 | 154 | ||
45 | 154 | property string usContext: "messaging://" | 155 | property string usContext: "messaging://" |
46 | 155 | // Workaround: as long as map keeps a webcontainer this function handles js events to the webview. | 156 | // Workaround: as long as map keeps a webcontainer this function handles js events to the webview. |
47 | @@ -368,19 +369,18 @@ | |||
48 | 368 | 369 | ||
49 | 369 | case "http://show_notification/": | 370 | case "http://show_notification/": |
50 | 370 | if (params[1] === "speed_camera_error") { | 371 | if (params[1] === "speed_camera_error") { |
52 | 371 | notifiactionBar.text = i18n.tr("Error getting speed cameras!"); | 372 | notificationBar.text = i18n.tr("Error getting speed cameras!"); |
53 | 372 | } | 373 | } |
55 | 373 | switch (params[0]) { | 374 | switch (params[0]) { |
56 | 374 | case "info": | 375 | case "info": |
58 | 375 | notifiactionBar.info(); | 376 | notificationBar.info(); |
59 | 376 | break; | 377 | break; |
60 | 377 | case "warning": | 378 | case "warning": |
62 | 378 | notifiactionBar.warning(); | 379 | notificationBar.warning(); |
63 | 379 | break; | 380 | break; |
64 | 380 | case "critical": | 381 | case "critical": |
66 | 381 | notifiactionBar.critical(); | 382 | notificationBar.critical(); |
67 | 382 | } | 383 | } |
68 | 383 | notificationBarTimer.start(); | ||
69 | 384 | } | 384 | } |
70 | 385 | request.action = Oxide.NavigationRequest.ActionReject; | 385 | request.action = Oxide.NavigationRequest.ActionReject; |
71 | 386 | } | 386 | } |
72 | @@ -424,12 +424,31 @@ | |||
73 | 424 | goThereActionPopover.show(); | 424 | goThereActionPopover.show(); |
74 | 425 | } | 425 | } |
75 | 426 | } | 426 | } |
76 | 427 | |||
77 | 428 | if (mainPageStack.forcedReload === true && mainPageStack.routeState === "yes") { | ||
78 | 429 | mainPageStack.forcedReload = false | ||
79 | 430 | notificationBar.close() | ||
80 | 431 | |||
81 | 432 | if ( mainPageStack.endLat !== "null" && mainPageStack.endLng !== "null") { | ||
82 | 433 | mainPageStack.center_onpos = 2; | ||
83 | 434 | mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.endLat + "," + mainPageStack.endLng + ");"); | ||
84 | 435 | notificationBar.text = i18n.tr("Active route lost. Recalculating it…"); | ||
85 | 436 | notificationBar.warning(); | ||
86 | 437 | } else { | ||
87 | 438 | notificationBar.text = i18n.tr("Sorry, route info could not be retrieved. Please, re-set the route."); | ||
88 | 439 | notificationBar.warning(); | ||
89 | 440 | } | ||
90 | 441 | } | ||
91 | 427 | } | 442 | } |
92 | 428 | } | 443 | } |
93 | 429 | 444 | ||
94 | 430 | onGeolocationPermissionRequested: { request.allow() } | 445 | onGeolocationPermissionRequested: { request.allow() } |
95 | 431 | } | 446 | } |
96 | 432 | 447 | ||
97 | 448 | WebProcessMonitor{ | ||
98 | 449 | webview: webview | ||
99 | 450 | } | ||
100 | 451 | |||
101 | 433 | Connections { | 452 | Connections { |
102 | 434 | target: UriHandler | 453 | target: UriHandler |
103 | 435 | onOpened: { | 454 | onOpened: { |
104 | @@ -522,17 +541,8 @@ | |||
105 | 522 | } | 541 | } |
106 | 523 | } | 542 | } |
107 | 524 | 543 | ||
108 | 525 | Timer { | ||
109 | 526 | id: notificationBarTimer | ||
110 | 527 | interval: 8000 | ||
111 | 528 | repeat: false | ||
112 | 529 | onTriggered: { | ||
113 | 530 | notifiactionBar.visible = false | ||
114 | 531 | } | ||
115 | 532 | } | ||
116 | 533 | |||
117 | 534 | NotificationBar { | 544 | NotificationBar { |
119 | 535 | id: notifiactionBar | 545 | id: notificationBar |
120 | 536 | } | 546 | } |
121 | 537 | 547 | ||
122 | 538 | XmlListModel { | 548 | XmlListModel { |
123 | @@ -648,9 +658,8 @@ | |||
124 | 648 | Column { | 658 | Column { |
125 | 649 | height: routePageGrid.height | 659 | height: routePageGrid.height |
126 | 650 | spacing: 0 | 660 | spacing: 0 |
130 | 651 | Component.onCompleted: { | 661 | |
131 | 652 | mainPageStack.executeJavaScript("qml_set_route_status();") | 662 | Component.onCompleted: mainPageStack.executeJavaScript("qml_set_route_status()") |
129 | 653 | } | ||
132 | 654 | 663 | ||
133 | 655 | Row { | 664 | Row { |
134 | 656 | id: gridRow | 665 | id: gridRow |
135 | @@ -731,6 +740,8 @@ | |||
136 | 731 | goThereActionPopover.hide(); | 740 | goThereActionPopover.hide(); |
137 | 732 | mainPageStack.center_onpos = 2; | 741 | mainPageStack.center_onpos = 2; |
138 | 733 | mainPageStack.routeState = 'yes'; | 742 | mainPageStack.routeState = 'yes'; |
139 | 743 | mainPageStack.endLat = mainPageStack.clickedLat; | ||
140 | 744 | mainPageStack.endLng = mainPageStack.clickedLng; | ||
141 | 734 | mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");"); | 745 | mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");"); |
142 | 735 | } | 746 | } |
143 | 736 | } | 747 | } |
144 | @@ -830,6 +841,8 @@ | |||
145 | 830 | goThereActionPopover.hide(); | 841 | goThereActionPopover.hide(); |
146 | 831 | mainPageStack.center_onpos = 2; | 842 | mainPageStack.center_onpos = 2; |
147 | 832 | mainPageStack.routeState = 'yes'; | 843 | mainPageStack.routeState = 'yes'; |
148 | 844 | mainPageStack.endLat = mainPageStack.clickedLat; | ||
149 | 845 | mainPageStack.endLng = mainPageStack.clickedLng; | ||
150 | 833 | mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");"); | 846 | mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");"); |
151 | 834 | } | 847 | } |
152 | 835 | } | 848 | } |
153 | 836 | 849 | ||
154 | === modified file 'qml/PoiDetailsPage.qml' | |||
155 | --- qml/PoiDetailsPage.qml 2016-06-03 13:50:14 +0000 | |||
156 | +++ qml/PoiDetailsPage.qml 2016-06-14 19:54:18 +0000 | |||
157 | @@ -199,6 +199,8 @@ | |||
158 | 199 | } | 199 | } |
159 | 200 | mainPageStack.center_onpos = 2; | 200 | mainPageStack.center_onpos = 2; |
160 | 201 | mainPageStack.routeState = 'yes' | 201 | mainPageStack.routeState = 'yes' |
161 | 202 | mainPageStack.endLat = mainPageStack.clickedLat; | ||
162 | 203 | mainPageStack.endLng = mainPageStack.clickedLng; | ||
163 | 202 | mainPageStack.executeJavaScript("calc2coord("+ mainPageStack.clickedLat + "," + mainPageStack.clickedLng + ");"); | 204 | mainPageStack.executeJavaScript("calc2coord("+ mainPageStack.clickedLat + "," + mainPageStack.clickedLng + ");"); |
164 | 203 | } else if (model.mode === "SAVE") { | 205 | } else if (model.mode === "SAVE") { |
165 | 204 | var incubator = mainPageStack.addPageToCurrentColumn(poiDetailsPage, Qt.resolvedUrl("SearchPage.qml"), {favLat: mainPageStack.clickedLat, favLng: mainPageStack.clickedLng, favName: poiName}); | 206 | var incubator = mainPageStack.addPageToCurrentColumn(poiDetailsPage, Qt.resolvedUrl("SearchPage.qml"), {favLat: mainPageStack.clickedLat, favLng: mainPageStack.clickedLng, favName: poiName}); |
166 | 205 | 207 | ||
167 | === modified file 'qml/PoiListPage.qml' | |||
168 | --- qml/PoiListPage.qml 2016-05-05 19:21:33 +0000 | |||
169 | +++ qml/PoiListPage.qml 2016-06-14 19:54:18 +0000 | |||
170 | @@ -273,6 +273,8 @@ | |||
171 | 273 | mainPageStack.removePages(mainPageStack.primaryPage) | 273 | mainPageStack.removePages(mainPageStack.primaryPage) |
172 | 274 | mainPageStack.center_onpos = 2; | 274 | mainPageStack.center_onpos = 2; |
173 | 275 | mainPageStack.routeState = 'yes' | 275 | mainPageStack.routeState = 'yes' |
174 | 276 | mainPageStack.endLat = model.lat; | ||
175 | 277 | mainPageStack.endLng = model.lng; | ||
176 | 276 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); | 278 | mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");"); |
177 | 277 | } | 279 | } |
178 | 278 | }, | 280 | }, |
179 | 279 | 281 | ||
180 | === modified file 'qml/SearchPage.qml' | |||
181 | --- qml/SearchPage.qml 2016-05-05 19:21:33 +0000 | |||
182 | +++ qml/SearchPage.qml 2016-06-14 19:54:18 +0000 | |||
183 | @@ -27,9 +27,7 @@ | |||
184 | 27 | property string favLng | 27 | property string favLng |
185 | 28 | property string favName | 28 | property string favName |
186 | 29 | 29 | ||
190 | 30 | Component.onCompleted: { | 30 | Component.onCompleted: mainPageStack.executeJavaScript("qml_set_route_status()") |
188 | 31 | mainPageStack.executeJavaScript("qml_set_route_status();") | ||
189 | 32 | } | ||
191 | 33 | 31 | ||
192 | 34 | Component.onDestruction: { | 32 | Component.onDestruction: { |
193 | 35 | // Hide 2nd column when returning to the map to avoid an empty white column | 33 | // Hide 2nd column when returning to the map to avoid an empty white column |
194 | 36 | 34 | ||
195 | === modified file 'qml/components/NotificationBar.qml' | |||
196 | --- qml/components/NotificationBar.qml 2016-05-22 17:20:29 +0000 | |||
197 | +++ qml/components/NotificationBar.qml 2016-06-14 19:54:18 +0000 | |||
198 | @@ -25,30 +25,41 @@ | |||
199 | 25 | signal info() | 25 | signal info() |
200 | 26 | signal warning() | 26 | signal warning() |
201 | 27 | signal critical() | 27 | signal critical() |
202 | 28 | signal close() | ||
203 | 29 | |||
204 | 30 | onClose: { | ||
205 | 31 | notificationBar.visible = false | ||
206 | 32 | } | ||
207 | 28 | 33 | ||
208 | 29 | onInfo: { | 34 | onInfo: { |
209 | 35 | close() | ||
210 | 30 | notificationLabel.color = UbuntuColors.slate | 36 | notificationLabel.color = UbuntuColors.slate |
211 | 31 | notificationRectangle.color = "#FFFFFF" | 37 | notificationRectangle.color = "#FFFFFF" |
212 | 32 | notificationRectangle.visible = true; | 38 | notificationRectangle.visible = true; |
213 | 33 | notificationIcon.name = "" | 39 | notificationIcon.name = "" |
214 | 34 | notificationLabel.fontSize = "medium" | 40 | notificationLabel.fontSize = "medium" |
215 | 35 | notificationRectangle.height = notificationLabel.height + units.gu(1) | 41 | notificationRectangle.height = notificationLabel.height + units.gu(1) |
216 | 42 | notificationBarTimer.restart() | ||
217 | 36 | } | 43 | } |
218 | 37 | onWarning: { | 44 | onWarning: { |
219 | 45 | close() | ||
220 | 38 | notificationLabel.color = "#FFFFFF" | 46 | notificationLabel.color = "#FFFFFF" |
221 | 39 | notificationRectangle.color = UbuntuColors.orange; | 47 | notificationRectangle.color = UbuntuColors.orange; |
222 | 40 | notificationRectangle.visible = true; | 48 | notificationRectangle.visible = true; |
223 | 41 | notificationLabel.fontSize = "large" | 49 | notificationLabel.fontSize = "large" |
224 | 42 | notificationIcon.name = "dialog-warning-symbolic" | 50 | notificationIcon.name = "dialog-warning-symbolic" |
225 | 43 | notificationRectangle.height = notificationLabel.height + units.gu(4) | 51 | notificationRectangle.height = notificationLabel.height + units.gu(4) |
226 | 52 | notificationBarTimer.restart() | ||
227 | 44 | } | 53 | } |
228 | 45 | onCritical: { | 54 | onCritical: { |
229 | 55 | close() | ||
230 | 46 | notificationLabel.color = "#FFFFFF" | 56 | notificationLabel.color = "#FFFFFF" |
231 | 47 | notificationRectangle.color = UbuntuColors.red | 57 | notificationRectangle.color = UbuntuColors.red |
232 | 48 | notificationRectangle.visible = true; | 58 | notificationRectangle.visible = true; |
233 | 49 | notificationLabel.fontSize = "large" | 59 | notificationLabel.fontSize = "large" |
234 | 50 | notificationIcon.name = "dialog-error-symbolic" | 60 | notificationIcon.name = "dialog-error-symbolic" |
235 | 51 | notificationRectangle.height = notificationLabel.height + units.gu(4) | 61 | notificationRectangle.height = notificationLabel.height + units.gu(4) |
236 | 62 | notificationBarTimer.restart() | ||
237 | 52 | } | 63 | } |
238 | 53 | 64 | ||
239 | 54 | width: parent.width | 65 | width: parent.width |
240 | @@ -58,6 +69,14 @@ | |||
241 | 58 | top: goThereActionPopover.isShown ? goThereActionPopover.bottom : navigationPage.header.bottom | 69 | top: goThereActionPopover.isShown ? goThereActionPopover.bottom : navigationPage.header.bottom |
242 | 59 | } | 70 | } |
243 | 60 | 71 | ||
244 | 72 | MouseArea { | ||
245 | 73 | anchors.fill: parent | ||
246 | 74 | onClicked: { | ||
247 | 75 | notificationBarTimer.stop() | ||
248 | 76 | notificationBar.visible = false | ||
249 | 77 | } | ||
250 | 78 | } | ||
251 | 79 | |||
252 | 61 | Icon { | 80 | Icon { |
253 | 62 | id: notificationIcon | 81 | id: notificationIcon |
254 | 63 | width: units.gu(3.5) | 82 | width: units.gu(3.5) |
255 | @@ -80,9 +99,18 @@ | |||
256 | 80 | right: parent.right | 99 | right: parent.right |
257 | 81 | verticalCenter: parent.verticalCenter | 100 | verticalCenter: parent.verticalCenter |
258 | 82 | } | 101 | } |
261 | 83 | horizontalAlignment: Text.AlignHCenter | 102 | horizontalAlignment: notificationIcon.visible ? Text.AlignLeft : Text.AlignHCenter |
262 | 84 | maximumLineCount: 3 | 103 | maximumLineCount: 6 |
263 | 85 | wrapMode: Text.WordWrap | 104 | wrapMode: Text.WordWrap |
264 | 86 | elide: Text.ElideRight | 105 | elide: Text.ElideRight |
265 | 87 | } | 106 | } |
266 | 107 | |||
267 | 108 | Timer { | ||
268 | 109 | id: notificationBarTimer | ||
269 | 110 | interval: 8000 | ||
270 | 111 | repeat: false | ||
271 | 112 | onTriggered: { | ||
272 | 113 | notificationBar.close() | ||
273 | 114 | } | ||
274 | 115 | } | ||
275 | 88 | } | 116 | } |
276 | 89 | 117 | ||
277 | === modified file 'qml/components/POIQuickAccessGridView.qml' | |||
278 | --- qml/components/POIQuickAccessGridView.qml 2016-05-22 18:08:53 +0000 | |||
279 | +++ qml/components/POIQuickAccessGridView.qml 2016-06-14 19:54:18 +0000 | |||
280 | @@ -87,17 +87,15 @@ | |||
281 | 87 | if (status === XmlListModel.Error) { | 87 | if (status === XmlListModel.Error) { |
282 | 88 | console.log(errorString()); | 88 | console.log(errorString()); |
283 | 89 | source = ""; | 89 | source = ""; |
287 | 90 | notificationBarTimer.start(); | 90 | notificationBar.text = i18n.tr("Error getting results. Please, check your data connection."); |
288 | 91 | notifiactionBar.text = i18n.tr("Error getting results. Please, check your data connection."); | 91 | notificationBar.critical(); |
286 | 92 | notifiactionBar.critical(); | ||
289 | 93 | } | 92 | } |
290 | 94 | if (status === XmlListModel.Ready && count === 0) { | 93 | if (status === XmlListModel.Ready && count === 0) { |
294 | 95 | notificationBarTimer.start(); | 94 | notificationBar.text = i18n.tr("Sorry, no results found nearby."); |
295 | 96 | notifiactionBar.text = i18n.tr("Sorry, no results found nearby."); | 95 | notificationBar.info(); |
293 | 97 | notifiactionBar.info(); | ||
296 | 98 | } | 96 | } |
297 | 99 | if (status === XmlListModel.Ready && count >> 0) { | 97 | if (status === XmlListModel.Ready && count >> 0) { |
299 | 100 | notifiactionBar.visible = false; | 98 | notificationBar.close() |
300 | 101 | mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(poiXmlModel.allPOI()) + ")"); | 99 | mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(poiXmlModel.allPOI()) + ")"); |
301 | 102 | mainPageStack.center_onpos = 1; | 100 | mainPageStack.center_onpos = 1; |
302 | 103 | goThereActionPopover.hide(); | 101 | goThereActionPopover.hide(); |
303 | @@ -170,13 +168,13 @@ | |||
304 | 170 | mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("../PoiQuickAccessPage.qml")) | 168 | mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("../PoiQuickAccessPage.qml")) |
305 | 171 | } else { | 169 | } else { |
306 | 172 | if (mainPageStack.currentLat === 'null' || mainPageStack.currentLng === 'null') { | 170 | if (mainPageStack.currentLat === 'null' || mainPageStack.currentLng === 'null') { |
309 | 173 | notifiactionBar.text = i18n.tr("Current position unknown. Try again after a position update."); | 171 | notificationBar.text = i18n.tr("Current position unknown. Try again after a position update."); |
310 | 174 | notifiactionBar.info(); | 172 | notificationBar.info(); |
311 | 175 | } | 173 | } |
312 | 176 | else { | 174 | else { |
313 | 177 | poiXmlModel.clear(); | 175 | poiXmlModel.clear(); |
316 | 178 | notifiactionBar.text = i18n.tr("Searching…"); | 176 | notificationBar.text = i18n.tr("Searching…"); |
317 | 179 | notifiactionBar.info(); | 177 | notificationBar.info(); |
318 | 180 | poiXmlModel.distance = model.distance; | 178 | poiXmlModel.distance = model.distance; |
319 | 181 | poiXmlModel.clause = model.clause; | 179 | poiXmlModel.clause = model.clause; |
320 | 182 | poiXmlModel.search(); | 180 | poiXmlModel.search(); |
321 | 183 | 181 | ||
322 | === added file 'qml/components/WebProcessMonitor.qml' | |||
323 | --- qml/components/WebProcessMonitor.qml 1970-01-01 00:00:00 +0000 | |||
324 | +++ qml/components/WebProcessMonitor.qml 2016-06-14 19:54:18 +0000 | |||
325 | @@ -0,0 +1,92 @@ | |||
326 | 1 | /* | ||
327 | 2 | * Copyright 2015 Canonical Ltd. | ||
328 | 3 | * | ||
329 | 4 | * This file is part of webbrowser-app. | ||
330 | 5 | * | ||
331 | 6 | * webbrowser-app is free software; you can redistribute it and/or modify | ||
332 | 7 | * it under the terms of the GNU General Public License as published by | ||
333 | 8 | * the Free Software Foundation; version 3. | ||
334 | 9 | * | ||
335 | 10 | * webbrowser-app is distributed in the hope that it will be useful, | ||
336 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
337 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
338 | 13 | * GNU General Public License for more details. | ||
339 | 14 | * | ||
340 | 15 | * You should have received a copy of the GNU General Public License | ||
341 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
342 | 17 | */ | ||
343 | 18 | |||
344 | 19 | import QtQuick 2.4 | ||
345 | 20 | import com.canonical.Oxide 1.9 as Oxide | ||
346 | 21 | |||
347 | 22 | Item { | ||
348 | 23 | id: monitor | ||
349 | 24 | |||
350 | 25 | visible: false | ||
351 | 26 | |||
352 | 27 | property var webview: null | ||
353 | 28 | |||
354 | 29 | readonly property bool killed: webview && | ||
355 | 30 | (webview.webProcessStatus === Oxide.WebView.WebProcessKilled) | ||
356 | 31 | readonly property bool crashed: webview && | ||
357 | 32 | (webview.webProcessStatus === Oxide.WebView.WebProcessCrashed) | ||
358 | 33 | |||
359 | 34 | // When the renderer process is killed (most likely by the system’s | ||
360 | 35 | // OOM killer), try to reload the page once, and if this results in | ||
361 | 36 | // the process being killed again within one minute, then display | ||
362 | 37 | // the sad tab. | ||
363 | 38 | |||
364 | 39 | readonly property int killedRetries: internal.killedRetries | ||
365 | 40 | |||
366 | 41 | QtObject { | ||
367 | 42 | id: internal | ||
368 | 43 | property int killedRetries: 0 | ||
369 | 44 | } | ||
370 | 45 | |||
371 | 46 | Connections { | ||
372 | 47 | target: webview | ||
373 | 48 | onWebProcessStatusChanged: { | ||
374 | 49 | if (webview.webProcessStatus === Oxide.WebView.WebProcessKilled) { | ||
375 | 50 | if (internal.killedRetries == 0) { | ||
376 | 51 | // Do not attempt reloading right away, this would result in a crash | ||
377 | 52 | delayedReload.restart() | ||
378 | 53 | console.log("Webview was killed!") | ||
379 | 54 | if (mainPageStack.routeState === "yes" ) { | ||
380 | 55 | notificationBar.text = i18n.tr("Something went wrong.") | ||
381 | 56 | + "\n" + i18n.tr("Reloading the map and the last active route…") | ||
382 | 57 | } else { | ||
383 | 58 | notificationBar.text = i18n.tr("Something went wrong.") | ||
384 | 59 | + "\n" + i18n.tr("Reloading the map…") | ||
385 | 60 | } | ||
386 | 61 | notificationBar.critical() | ||
387 | 62 | } | ||
388 | 63 | } | ||
389 | 64 | } | ||
390 | 65 | } | ||
391 | 66 | |||
392 | 67 | Timer { | ||
393 | 68 | id: delayedReload | ||
394 | 69 | interval: 100 | ||
395 | 70 | onTriggered: { | ||
396 | 71 | monitorTimer.restart() | ||
397 | 72 | mainPageStack.onLoadingExecuted = false | ||
398 | 73 | mainPageStack.forcedReload = true | ||
399 | 74 | navigationPage.buttonsEnabled = false | ||
400 | 75 | monitor.webview.reload() | ||
401 | 76 | console.log("Trying to reload the webview…") | ||
402 | 77 | internal.killedRetries++ | ||
403 | 78 | } | ||
404 | 79 | } | ||
405 | 80 | |||
406 | 81 | Timer { | ||
407 | 82 | id: monitorTimer | ||
408 | 83 | interval: 60000 // 1 minute | ||
409 | 84 | onTriggered: internal.killedRetries = 0 | ||
410 | 85 | } | ||
411 | 86 | |||
412 | 87 | onWebviewChanged: { | ||
413 | 88 | internal.killedRetries = 0 | ||
414 | 89 | delayedReload.stop() | ||
415 | 90 | monitorTimer.stop() | ||
416 | 91 | } | ||
417 | 92 | } |
It didn't work for me.
I used uNav in the morning.
After ~10 hours, I opened and I saw the map and the red popup.
uNav was freezed ~5 seconds and then, the system killed it.