From 787c22894ea8a6d4d15ee67051bc1779b577dc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonah=20Br=C3=BCchert?= Date: Mon, 30 Mar 2020 01:03:48 +0200 Subject: [PATCH] ErrorHandler: Add retry button --- angelfish-webapp/contents/ui/webapp.qml | 1 + src/contents/ui/ErrorHandler.qml | 8 ++++++++ src/contents/ui/webbrowser.qml | 2 ++ 3 files changed, 11 insertions(+) diff --git a/angelfish-webapp/contents/ui/webapp.qml b/angelfish-webapp/contents/ui/webapp.qml index 0f26556..d3af451 100644 --- a/angelfish-webapp/contents/ui/webapp.qml +++ b/angelfish-webapp/contents/ui/webapp.qml @@ -70,6 +70,7 @@ Kirigami.ApplicationWindow { anchors.fill: parent visible: webView.errorCode !== "" + onRefreshRequested: webView.reload() } Loader { diff --git a/src/contents/ui/ErrorHandler.qml b/src/contents/ui/ErrorHandler.qml index 0186ba6..1810415 100644 --- a/src/contents/ui/ErrorHandler.qml +++ b/src/contents/ui/ErrorHandler.qml @@ -29,6 +29,8 @@ import org.kde.kirigami 2.0 as Kirigami Item { id: errorHandler + signal refreshRequested + property string errorCode: "" property alias errorString: errorDescription.text @@ -58,5 +60,11 @@ Item { Item { Layout.fillHeight: true } + Controls.ToolButton { + Layout.alignment: Qt.AlignHCenter + text: i18n("Retry") + icon.name: "view-refresh" + onClicked: errorHandler.refreshRequested() + } } } diff --git a/src/contents/ui/webbrowser.qml b/src/contents/ui/webbrowser.qml index c8c43d2..ee27470 100644 --- a/src/contents/ui/webbrowser.qml +++ b/src/contents/ui/webbrowser.qml @@ -175,6 +175,8 @@ Kirigami.ApplicationWindow { bottom: navigation.top } visible: currentWebView.errorCode !== "" + + onRefreshRequested: currentWebView.reload() } Loader { -- GitLab