diff options
Diffstat (limited to 'examples/webengine/quicknanobrowser/BrowserWindow.qml')
-rw-r--r-- | examples/webengine/quicknanobrowser/BrowserWindow.qml | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index 3465e0da6..f451c8c07 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -290,10 +290,8 @@ ApplicationWindow { } onCertificateError: { - sslDialog.certError = error - sslDialog.text = "Certificate Error: " + error.description - sslDialog.visible = true error.defer() + sslDialog.enqueue(error) } onNewViewRequested: { @@ -316,14 +314,33 @@ ApplicationWindow { MessageDialog { id: sslDialog - property var certError - - standardButtons: StandardButton.Cancel | StandardButton.Ok - visible: false - title: "Do you want to accept this certificate?" + property var certErrors: [] + icon: StandardIcon.Warning + standardButtons: StandardButton.No | StandardButton.Yes + title: "Server's certificate not trusted" + text: "Do you wish to continue?" + detailedText: "If you wish so, you may continue with an unverified certificate. " + + "Accepting an unverified certificate means " + + "you may not be connected with the host you tried to connect to.\n" + + "Do you wish to override the security check and continue?" + onYes: { + certErrors.shift().ignoreCertificateError() + presentError() + } + onNo: reject() + onRejected: reject() - onAccepted: certError.ignoreCertificateError() - onRejected: certError.rejectCertificate() + function reject(){ + certErrors.shift().rejectCertificate() + presentError() + } + function enqueue(error){ + certErrors.push(error) + presentError() + } + function presentError(){ + visible = certErrors.length > 0 + } } DownloadView { id: downloadView |