From acad08fb9884541431030a851d587c25d7e9acf0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 9 Jul 2011 17:54:28 +0200 Subject: Improving SSL Widget and Dialog While the widget "copies" and "rethink" Google Chrome actual one, the dialog has been implemented starting from the comparison between the ones we have in KDE, Google Chrome's and Firefox's. I have to start from somewhere... --- src/urlbar/sslwidget.cpp | 40 +++++++++++++++++++++++++++++++++++++--- src/urlbar/sslwidget.h | 5 +++++ 2 files changed, 42 insertions(+), 3 deletions(-) (limited to 'src/urlbar') diff --git a/src/urlbar/sslwidget.cpp b/src/urlbar/sslwidget.cpp index 79194c6f..40532cb3 100644 --- a/src/urlbar/sslwidget.cpp +++ b/src/urlbar/sslwidget.cpp @@ -31,6 +31,7 @@ // Local includes #include "application.h" #include "historymanager.h" +#include "sslinfodialog.h" // KDE Includes @@ -43,6 +44,8 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) : QMenu(parent) + , m_url(url) + , m_info(info) { setAttribute(Qt::WA_DeleteOnClose); setMinimumWidth(400); @@ -54,8 +57,9 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) QLabel *label; + // ------------------------------------------------------------------------------------------------------------------ label = new QLabel(this); - label->setText( QL1S("

") + url.host() + QL1S("

") ); + label->setText( i18n("

Identity

") ); layout->addRow(label); if (firstCA.isNull()) @@ -81,7 +85,13 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) } label = new QLabel(this); - label->setText( QL1S("

") + i18n("Issued to") + QL1S("

") ); // ----------------------------------------------- // + label->setText("Certificate Information"); + connect(label, SIGNAL(linkActivated(const QString &)), this, SLOT(showMoreSslInfos(const QString &))); + layout->addRow(label); + + // ------------------------------------------------------------------------------------------------------------------ + label = new QLabel(this); + label->setText( QL1S("

Encryption

") ); // ----------------------------------------------- // layout->addRow(label); label = new QLabel(this); @@ -145,7 +155,7 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) // ------------------------------------------------------------------------------------------------------------------ label = new QLabel(this); - label->setText( QL1S("

") + i18n("Site Information") + QL1S("

") ); + label->setText( i18n("

Site Information

") ); layout->addRow(label); label = new QLabel(this); @@ -180,3 +190,27 @@ void SSLWidget::accept() close(); } + + +void SSLWidget::showMoreSslInfos(const QString &) +{ + // FIXME: show it every time??? + if (m_info.isValid()) + { + QPointer dlg = new SslInfoDialog(m_url.host(), m_info, this); +// dlg->setSslInfo(m_info.certificateChain(), +// m_info.peerAddress().toString(), +// m_host, +// m_info.protocol(), +// m_info.ciphers(), +// m_info.usedChiperBits(), +// m_info.supportedChiperBits() +// ); + + dlg->exec(); + delete dlg; + + return; + } + +} diff --git a/src/urlbar/sslwidget.h b/src/urlbar/sslwidget.h index 4e36d364..00478f59 100644 --- a/src/urlbar/sslwidget.h +++ b/src/urlbar/sslwidget.h @@ -46,7 +46,12 @@ public: void showAt(const QPoint &pos); private Q_SLOTS: + void showMoreSslInfos(const QString &); void accept(); + +private: + QUrl m_url; + WebSslInfo m_info; }; #endif // SSL_WIDGET_H -- cgit v1.2.1