Merge lp:~joergberroth/unav/WebViewCrashHandling into lp:unav

Proposed by JkB
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
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 WebProcessMonitor.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)

Description of the change

* added WebProcessMonitor.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)

To post a comment you must log in.
Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

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.

review: Needs Fixing
Revision history for this message
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.set_route_status('yes');
    ui.update();
    qml_set_center_onpos(2);
+ qml_set_route_status();
   }
  </script>

Thanks |o/

Revision history for this message
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_route_status('yes');
> ui.update();
> qml_set_center_onpos(2);
> + qml_set_route_status();
> }
> </script>
>
> Thanks |o/

--
Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
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!

Revision history for this message
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

77. By JkB

*merge with costales branch

78. By JkB

* modified notification text

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 WebProcessMonitor.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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Favorites.qml'
--- qml/Favorites.qml 2016-05-05 19:21:33 +0000
+++ qml/Favorites.qml 2016-06-14 19:54:18 +0000
@@ -114,6 +114,8 @@
114 mainPageStack.removePages(mainPageStack.primaryPage)114 mainPageStack.removePages(mainPageStack.primaryPage)
115 mainPageStack.center_onpos = 2;115 mainPageStack.center_onpos = 2;
116 mainPageStack.routeState = 'yes';116 mainPageStack.routeState = 'yes';
117 mainPageStack.endLat = model.lat;
118 mainPageStack.endLng = model.lng;
117 mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");");119 mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");");
118 }120 }
119 },121 },
120122
=== modified file 'qml/Location.qml'
--- qml/Location.qml 2016-06-03 13:52:53 +0000
+++ qml/Location.qml 2016-06-14 19:54:18 +0000
@@ -256,6 +256,8 @@
256 mainPageStack.removePages(mainPageStack.primaryPage)256 mainPageStack.removePages(mainPageStack.primaryPage)
257 mainPageStack.center_onpos = 2;257 mainPageStack.center_onpos = 2;
258 mainPageStack.routeState = 'yes'258 mainPageStack.routeState = 'yes'
259 mainPageStack.endLat = model.lat;
260 mainPageStack.endLng = model.lng;
259 mainPageStack.executeJavaScript("calc2coord(" + model.lat + "," + model.lng + ");")261 mainPageStack.executeJavaScript("calc2coord(" + model.lat + "," + model.lng + ");")
260 }262 }
261 },263 },
@@ -341,6 +343,8 @@
341 mainPageStack.removePages(mainPageStack.primaryPage)343 mainPageStack.removePages(mainPageStack.primaryPage)
342 mainPageStack.center_onpos = 2;344 mainPageStack.center_onpos = 2;
343 mainPageStack.routeState = 'yes';345 mainPageStack.routeState = 'yes';
346 mainPageStack.endLat = model.lat;
347 mainPageStack.endLng = model.lng;
344 mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");");348 mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");");
345 }349 }
346 },350 },
347351
=== modified file 'qml/Main.qml'
--- qml/Main.qml 2016-06-08 17:16:09 +0000
+++ qml/Main.qml 2016-06-14 19:54:18 +0000
@@ -150,6 +150,7 @@
150 property int center_onpos: 0 // 0 GPS off, 1 GPS on + not center, 2 GPS on + center150 property int center_onpos: 0 // 0 GPS off, 1 GPS on + not center, 2 GPS on + center
151 property bool favPopup: false151 property bool favPopup: false
152 property bool onLoadingExecuted: false152 property bool onLoadingExecuted: false
153 property bool forcedReload: false
153154
154 property string usContext: "messaging://"155 property string usContext: "messaging://"
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.
@@ -368,19 +369,18 @@
368 369
369 case "http://show_notification/":370 case "http://show_notification/":
370 if (params[1] === "speed_camera_error") {371 if (params[1] === "speed_camera_error") {
371 notifiactionBar.text = i18n.tr("Error getting speed cameras!");372 notificationBar.text = i18n.tr("Error getting speed cameras!");
372 }373 }
373 switch (params[0]) {374 switch (params[0]) {
374 case "info":375 case "info":
375 notifiactionBar.info();376 notificationBar.info();
376 break;377 break;
377 case "warning":378 case "warning":
378 notifiactionBar.warning();379 notificationBar.warning();
379 break;380 break;
380 case "critical":381 case "critical":
381 notifiactionBar.critical();382 notificationBar.critical();
382 }383 }
383 notificationBarTimer.start();
384 }384 }
385 request.action = Oxide.NavigationRequest.ActionReject;385 request.action = Oxide.NavigationRequest.ActionReject;
386 }386 }
@@ -424,12 +424,31 @@
424 goThereActionPopover.show();424 goThereActionPopover.show();
425 }425 }
426 }426 }
427
428 if (mainPageStack.forcedReload === true && mainPageStack.routeState === "yes") {
429 mainPageStack.forcedReload = false
430 notificationBar.close()
431
432 if ( mainPageStack.endLat !== "null" && mainPageStack.endLng !== "null") {
433 mainPageStack.center_onpos = 2;
434 mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.endLat + "," + mainPageStack.endLng + ");");
435 notificationBar.text = i18n.tr("Active route lost. Recalculating it…");
436 notificationBar.warning();
437 } else {
438 notificationBar.text = i18n.tr("Sorry, route info could not be retrieved. Please, re-set the route.");
439 notificationBar.warning();
440 }
441 }
427 }442 }
428 }443 }
429444
430 onGeolocationPermissionRequested: { request.allow() }445 onGeolocationPermissionRequested: { request.allow() }
431 }446 }
432447
448 WebProcessMonitor{
449 webview: webview
450 }
451
433 Connections {452 Connections {
434 target: UriHandler453 target: UriHandler
435 onOpened: {454 onOpened: {
@@ -522,17 +541,8 @@
522 }541 }
523 }542 }
524543
525 Timer {
526 id: notificationBarTimer
527 interval: 8000
528 repeat: false
529 onTriggered: {
530 notifiactionBar.visible = false
531 }
532 }
533
534 NotificationBar {544 NotificationBar {
535 id: notifiactionBar545 id: notificationBar
536 }546 }
537547
538 XmlListModel {548 XmlListModel {
@@ -648,9 +658,8 @@
648 Column {658 Column {
649 height: routePageGrid.height659 height: routePageGrid.height
650 spacing: 0660 spacing: 0
651 Component.onCompleted: {661
652 mainPageStack.executeJavaScript("qml_set_route_status();")662 Component.onCompleted: mainPageStack.executeJavaScript("qml_set_route_status()")
653 }
654663
655 Row {664 Row {
656 id: gridRow665 id: gridRow
@@ -731,6 +740,8 @@
731 goThereActionPopover.hide();740 goThereActionPopover.hide();
732 mainPageStack.center_onpos = 2;741 mainPageStack.center_onpos = 2;
733 mainPageStack.routeState = 'yes';742 mainPageStack.routeState = 'yes';
743 mainPageStack.endLat = mainPageStack.clickedLat;
744 mainPageStack.endLng = mainPageStack.clickedLng;
734 mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");");745 mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");");
735 }746 }
736 }747 }
@@ -830,6 +841,8 @@
830 goThereActionPopover.hide();841 goThereActionPopover.hide();
831 mainPageStack.center_onpos = 2;842 mainPageStack.center_onpos = 2;
832 mainPageStack.routeState = 'yes';843 mainPageStack.routeState = 'yes';
844 mainPageStack.endLat = mainPageStack.clickedLat;
845 mainPageStack.endLng = mainPageStack.clickedLng;
833 mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");");846 mainPageStack.executeJavaScript("calc2coord(" + mainPageStack.clickedLat + ", " + mainPageStack.clickedLng + ");");
834 }847 }
835 }848 }
836849
=== modified file 'qml/PoiDetailsPage.qml'
--- qml/PoiDetailsPage.qml 2016-06-03 13:50:14 +0000
+++ qml/PoiDetailsPage.qml 2016-06-14 19:54:18 +0000
@@ -199,6 +199,8 @@
199 }199 }
200 mainPageStack.center_onpos = 2;200 mainPageStack.center_onpos = 2;
201 mainPageStack.routeState = 'yes'201 mainPageStack.routeState = 'yes'
202 mainPageStack.endLat = mainPageStack.clickedLat;
203 mainPageStack.endLng = mainPageStack.clickedLng;
202 mainPageStack.executeJavaScript("calc2coord("+ mainPageStack.clickedLat + "," + mainPageStack.clickedLng + ");");204 mainPageStack.executeJavaScript("calc2coord("+ mainPageStack.clickedLat + "," + mainPageStack.clickedLng + ");");
203 } else if (model.mode === "SAVE") {205 } else if (model.mode === "SAVE") {
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});
205207
=== modified file 'qml/PoiListPage.qml'
--- qml/PoiListPage.qml 2016-05-05 19:21:33 +0000
+++ qml/PoiListPage.qml 2016-06-14 19:54:18 +0000
@@ -273,6 +273,8 @@
273 mainPageStack.removePages(mainPageStack.primaryPage)273 mainPageStack.removePages(mainPageStack.primaryPage)
274 mainPageStack.center_onpos = 2;274 mainPageStack.center_onpos = 2;
275 mainPageStack.routeState = 'yes'275 mainPageStack.routeState = 'yes'
276 mainPageStack.endLat = model.lat;
277 mainPageStack.endLng = model.lng;
276 mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");");278 mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");");
277 }279 }
278 },280 },
279281
=== modified file 'qml/SearchPage.qml'
--- qml/SearchPage.qml 2016-05-05 19:21:33 +0000
+++ qml/SearchPage.qml 2016-06-14 19:54:18 +0000
@@ -27,9 +27,7 @@
27 property string favLng27 property string favLng
28 property string favName28 property string favName
2929
30 Component.onCompleted: {30 Component.onCompleted: mainPageStack.executeJavaScript("qml_set_route_status()")
31 mainPageStack.executeJavaScript("qml_set_route_status();")
32 }
3331
34 Component.onDestruction: {32 Component.onDestruction: {
35 // Hide 2nd column when returning to the map to avoid an empty white column33 // Hide 2nd column when returning to the map to avoid an empty white column
3634
=== modified file 'qml/components/NotificationBar.qml'
--- qml/components/NotificationBar.qml 2016-05-22 17:20:29 +0000
+++ qml/components/NotificationBar.qml 2016-06-14 19:54:18 +0000
@@ -25,30 +25,41 @@
25 signal info()25 signal info()
26 signal warning()26 signal warning()
27 signal critical()27 signal critical()
28 signal close()
29
30 onClose: {
31 notificationBar.visible = false
32 }
2833
29 onInfo: {34 onInfo: {
35 close()
30 notificationLabel.color = UbuntuColors.slate36 notificationLabel.color = UbuntuColors.slate
31 notificationRectangle.color = "#FFFFFF"37 notificationRectangle.color = "#FFFFFF"
32 notificationRectangle.visible = true;38 notificationRectangle.visible = true;
33 notificationIcon.name = ""39 notificationIcon.name = ""
34 notificationLabel.fontSize = "medium"40 notificationLabel.fontSize = "medium"
35 notificationRectangle.height = notificationLabel.height + units.gu(1)41 notificationRectangle.height = notificationLabel.height + units.gu(1)
42 notificationBarTimer.restart()
36 }43 }
37 onWarning: {44 onWarning: {
45 close()
38 notificationLabel.color = "#FFFFFF"46 notificationLabel.color = "#FFFFFF"
39 notificationRectangle.color = UbuntuColors.orange;47 notificationRectangle.color = UbuntuColors.orange;
40 notificationRectangle.visible = true;48 notificationRectangle.visible = true;
41 notificationLabel.fontSize = "large"49 notificationLabel.fontSize = "large"
42 notificationIcon.name = "dialog-warning-symbolic"50 notificationIcon.name = "dialog-warning-symbolic"
43 notificationRectangle.height = notificationLabel.height + units.gu(4)51 notificationRectangle.height = notificationLabel.height + units.gu(4)
52 notificationBarTimer.restart()
44 }53 }
45 onCritical: {54 onCritical: {
55 close()
46 notificationLabel.color = "#FFFFFF"56 notificationLabel.color = "#FFFFFF"
47 notificationRectangle.color = UbuntuColors.red57 notificationRectangle.color = UbuntuColors.red
48 notificationRectangle.visible = true;58 notificationRectangle.visible = true;
49 notificationLabel.fontSize = "large"59 notificationLabel.fontSize = "large"
50 notificationIcon.name = "dialog-error-symbolic"60 notificationIcon.name = "dialog-error-symbolic"
51 notificationRectangle.height = notificationLabel.height + units.gu(4)61 notificationRectangle.height = notificationLabel.height + units.gu(4)
62 notificationBarTimer.restart()
52 }63 }
5364
54 width: parent.width65 width: parent.width
@@ -58,6 +69,14 @@
58 top: goThereActionPopover.isShown ? goThereActionPopover.bottom : navigationPage.header.bottom69 top: goThereActionPopover.isShown ? goThereActionPopover.bottom : navigationPage.header.bottom
59 }70 }
6071
72 MouseArea {
73 anchors.fill: parent
74 onClicked: {
75 notificationBarTimer.stop()
76 notificationBar.visible = false
77 }
78 }
79
61 Icon {80 Icon {
62 id: notificationIcon81 id: notificationIcon
63 width: units.gu(3.5)82 width: units.gu(3.5)
@@ -80,9 +99,18 @@
80 right: parent.right99 right: parent.right
81 verticalCenter: parent.verticalCenter100 verticalCenter: parent.verticalCenter
82 }101 }
83 horizontalAlignment: Text.AlignHCenter102 horizontalAlignment: notificationIcon.visible ? Text.AlignLeft : Text.AlignHCenter
84 maximumLineCount: 3103 maximumLineCount: 6
85 wrapMode: Text.WordWrap104 wrapMode: Text.WordWrap
86 elide: Text.ElideRight105 elide: Text.ElideRight
87 }106 }
107
108 Timer {
109 id: notificationBarTimer
110 interval: 8000
111 repeat: false
112 onTriggered: {
113 notificationBar.close()
114 }
115 }
88}116}
89117
=== modified file 'qml/components/POIQuickAccessGridView.qml'
--- qml/components/POIQuickAccessGridView.qml 2016-05-22 18:08:53 +0000
+++ qml/components/POIQuickAccessGridView.qml 2016-06-14 19:54:18 +0000
@@ -87,17 +87,15 @@
87 if (status === XmlListModel.Error) {87 if (status === XmlListModel.Error) {
88 console.log(errorString());88 console.log(errorString());
89 source = "";89 source = "";
90 notificationBarTimer.start();90 notificationBar.text = i18n.tr("Error getting results. Please, check your data connection.");
91 notifiactionBar.text = i18n.tr("Error getting results. Please, check your data connection.");91 notificationBar.critical();
92 notifiactionBar.critical();
93 }92 }
94 if (status === XmlListModel.Ready && count === 0) {93 if (status === XmlListModel.Ready && count === 0) {
95 notificationBarTimer.start();94 notificationBar.text = i18n.tr("Sorry, no results found nearby.");
96 notifiactionBar.text = i18n.tr("Sorry, no results found nearby.");95 notificationBar.info();
97 notifiactionBar.info();
98 }96 }
99 if (status === XmlListModel.Ready && count >> 0) {97 if (status === XmlListModel.Ready && count >> 0) {
100 notifiactionBar.visible = false;98 notificationBar.close()
101 mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(poiXmlModel.allPOI()) + ")");99 mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(poiXmlModel.allPOI()) + ")");
102 mainPageStack.center_onpos = 1;100 mainPageStack.center_onpos = 1;
103 goThereActionPopover.hide();101 goThereActionPopover.hide();
@@ -170,13 +168,13 @@
170 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("../PoiQuickAccessPage.qml"))168 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("../PoiQuickAccessPage.qml"))
171 } else {169 } else {
172 if (mainPageStack.currentLat === 'null' || mainPageStack.currentLng === 'null') {170 if (mainPageStack.currentLat === 'null' || mainPageStack.currentLng === 'null') {
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.");
174 notifiactionBar.info();172 notificationBar.info();
175 }173 }
176 else {174 else {
177 poiXmlModel.clear();175 poiXmlModel.clear();
178 notifiactionBar.text = i18n.tr("Searching…");176 notificationBar.text = i18n.tr("Searching…");
179 notifiactionBar.info();177 notificationBar.info();
180 poiXmlModel.distance = model.distance;178 poiXmlModel.distance = model.distance;
181 poiXmlModel.clause = model.clause;179 poiXmlModel.clause = model.clause;
182 poiXmlModel.search();180 poiXmlModel.search();
183181
=== added file 'qml/components/WebProcessMonitor.qml'
--- qml/components/WebProcessMonitor.qml 1970-01-01 00:00:00 +0000
+++ qml/components/WebProcessMonitor.qml 2016-06-14 19:54:18 +0000
@@ -0,0 +1,92 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This file is part of webbrowser-app.
5 *
6 * webbrowser-app is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * webbrowser-app is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import com.canonical.Oxide 1.9 as Oxide
21
22Item {
23 id: monitor
24
25 visible: false
26
27 property var webview: null
28
29 readonly property bool killed: webview &&
30 (webview.webProcessStatus === Oxide.WebView.WebProcessKilled)
31 readonly property bool crashed: webview &&
32 (webview.webProcessStatus === Oxide.WebView.WebProcessCrashed)
33
34 // When the renderer process is killed (most likely by the system’s
35 // OOM killer), try to reload the page once, and if this results in
36 // the process being killed again within one minute, then display
37 // the sad tab.
38
39 readonly property int killedRetries: internal.killedRetries
40
41 QtObject {
42 id: internal
43 property int killedRetries: 0
44 }
45
46 Connections {
47 target: webview
48 onWebProcessStatusChanged: {
49 if (webview.webProcessStatus === Oxide.WebView.WebProcessKilled) {
50 if (internal.killedRetries == 0) {
51 // Do not attempt reloading right away, this would result in a crash
52 delayedReload.restart()
53 console.log("Webview was killed!")
54 if (mainPageStack.routeState === "yes" ) {
55 notificationBar.text = i18n.tr("Something went wrong.")
56 + "\n" + i18n.tr("Reloading the map and the last active route…")
57 } else {
58 notificationBar.text = i18n.tr("Something went wrong.")
59 + "\n" + i18n.tr("Reloading the map…")
60 }
61 notificationBar.critical()
62 }
63 }
64 }
65 }
66
67 Timer {
68 id: delayedReload
69 interval: 100
70 onTriggered: {
71 monitorTimer.restart()
72 mainPageStack.onLoadingExecuted = false
73 mainPageStack.forcedReload = true
74 navigationPage.buttonsEnabled = false
75 monitor.webview.reload()
76 console.log("Trying to reload the webview…")
77 internal.killedRetries++
78 }
79 }
80
81 Timer {
82 id: monitorTimer
83 interval: 60000 // 1 minute
84 onTriggered: internal.killedRetries = 0
85 }
86
87 onWebviewChanged: {
88 internal.killedRetries = 0
89 delayedReload.stop()
90 monitorTimer.stop()
91 }
92}

Subscribers

People subscribed via source and target branches