aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/webpage.cpp9
-rw-r--r--src/webengine/webpage.h3
-rw-r--r--src/webengine/webview.cpp8
-rw-r--r--src/webengine/webview.h1
4 files changed, 8 insertions, 13 deletions
diff --git a/src/webengine/webpage.cpp b/src/webengine/webpage.cpp
index b2f8c43..7a2a5e7 100644
--- a/src/webengine/webpage.cpp
+++ b/src/webengine/webpage.cpp
@@ -8,6 +8,7 @@
#include "webpage.h"
+#include <QMessageBox>
#include <QWebEngineFullScreenRequest>
WebPage::WebPage(QWebEngineProfile *profile, QObject *parent)
@@ -25,6 +26,10 @@ WebPage::WebPage(QWebEngineProfile *profile, QObject *parent)
bool WebPage::certificateError(const QWebEngineCertificateError &certificateError)
{
- emit certificateErrorMessage(certificateError.errorDescription());
- return certificateError.isOverridable();
+ auto resp = QMessageBox::warning(nullptr,
+ tr("SSL error"),
+ tr("An SSL error has occurred:<br>%1").arg(certificateError.errorDescription()),
+ QMessageBox::Ignore, QMessageBox::Abort);
+
+ return resp == QMessageBox::Ignore;
}
diff --git a/src/webengine/webpage.h b/src/webengine/webpage.h
index 0c7c3b9..674f278 100644
--- a/src/webengine/webpage.h
+++ b/src/webengine/webpage.h
@@ -17,9 +17,6 @@ class WebPage : public QWebEnginePage
public:
explicit WebPage(QWebEngineProfile *profile, QObject *parent = nullptr);
-signals:
- void certificateErrorMessage(const QString &message);
-
protected:
bool certificateError(const QWebEngineCertificateError &certificateError);
};
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index fa03dd4..263fb67 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -30,7 +30,7 @@
#include <QStatusBar>
// ssl errors
-#include "lib/navigation/urllineedit.h"
+#include "src/addressbar/urllineedit.h"
WebView::WebView(MainWindow *parentMainWindow, QWidget *parent)
: QWebEngineView(parent)
@@ -144,7 +144,6 @@ void WebView::setPage(WebPage *page)
// make sure the page gets cleaned up if we replace it by taking ownership
page->setParent(this);
connect(page, &WebPage::linkHovered, this, &WebView::handleLinkHovered);
- connect(page, &WebPage::certificateErrorMessage, this, &WebView::handleCertificateError);
QWebEngineView::setPage(page);
}
@@ -192,8 +191,3 @@ void WebView::handleLinkHovered(const QString &url)
m_parent->statusBar()->showMessage(url);
}
}
-
-void WebView::handleCertificateError(const QString &message)
-{
- m_parent->m_addressBar->showSslError(message);
-}
diff --git a/src/webengine/webview.h b/src/webengine/webview.h
index 5242d0d..957d181 100644
--- a/src/webengine/webview.h
+++ b/src/webengine/webview.h
@@ -35,7 +35,6 @@ protected:
private slots:
void handleLinkHovered(const QString &url);
- void handleCertificateError(const QString &message);
private:
MainWindow *m_parent = nullptr;