diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2014-06-18 16:30:24 +0200 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2014-06-19 12:18:45 +0300 |
commit | 52f7c8b3c40e0d73200436530e8d91a1c07d61f1 (patch) | |
tree | 1620feefda191e66f31d519c0759f7c7254596fd /basicsuite/webengine/main.qml | |
parent | 79fcd4fefc090c79c4fa088d4d0ba24b60c1b4e7 (diff) |
Add the loading error page
to make it clearer when the connectivity is a problem.
Change-Id: I828d75baf31d5333a3cb727a0baa8447e56f30d4
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'basicsuite/webengine/main.qml')
-rw-r--r-- | basicsuite/webengine/main.qml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/basicsuite/webengine/main.qml b/basicsuite/webengine/main.qml index dcf40d7..30365ce 100644 --- a/basicsuite/webengine/main.qml +++ b/basicsuite/webengine/main.qml @@ -58,15 +58,38 @@ Rectangle { property url defaultUrl: Qt.resolvedUrl("content/index.html") function load(url) { mainWebView.url = url } + ErrorPage { + id: errorPage + anchors.fill: parent + displayingError: false + } + WebEngineView { id: mainWebView anchors.fill: parent url: defaultUrl + visible: !errorPage.displayingError onLoadingChanged: { if (!loading) { addressBar.cursorPosition = 0 toolBar.state = "address" } + var loadError = loadRequest.errorDomain + if (loadError == WebEngineView.NoErrorDomain) { + errorPage.displayingError = false + return; + } + errorPage.displayingError = true + if (loadError == WebEngineView.InternalErrorDomain) + errorPage.mainMessage = "Internal error" + else if (loadError == WebEngineView.ConnectionErrorDomain) + errorPage.mainMessage = "Unable to connect to the Internet" + else if (loadError == WebEngineView.CertificateErrorDomain) + errorPage.mainMessage = "Certificate error" + else if (loadError == WebEngineView.DnsErrorDomain) + errorPage.mainMessage = "Unable to resolve the server's DNS address" + else // HTTP and FTP + errorPage.mainMessage = "Protocol error" } } |