From 130ed6c522a148c8bb98a2ece22a3d64be06df7d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 11 Jul 2011 12:45:20 +0200 Subject: Last fixes for the SSL dialog improvements Now we are ready for the fight... --- src/urlbar/sslwidget.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'src/urlbar/sslwidget.cpp') diff --git a/src/urlbar/sslwidget.cpp b/src/urlbar/sslwidget.cpp index 8507aa61..b1819700 100644 --- a/src/urlbar/sslwidget.cpp +++ b/src/urlbar/sslwidget.cpp @@ -33,9 +33,6 @@ #include "historymanager.h" #include "sslinfodialog.h" -// KDE Includes -#include - // Qt Includes #include #include @@ -90,22 +87,29 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) } else { - QString errors; - QStringList sl = m_info.certificateErrors().split("\t", QString::SkipEmptyParts); - Q_FOREACH(const QString &s, sl) + label = new QLabel(this); + label->setWordWrap(true); + + QList errorList = SslInfoDialog::errorsFromString(m_info.certificateErrors()); + if (errorList.at(0).isEmpty()) + { + label->setText( i18n("The certificate for this site is valid, but some on the certificate chain are not!") ); + imageLabel->setPixmap(KIcon("security-medium").pixmap(32)); + } + else { - bool didConvert; - QSslError::SslError error = static_cast(s.trimmed().toInt(&didConvert)); - if (didConvert) + QStringList sl = errorList.at(0); + QString c = QL1S("
    "); + Q_FOREACH(const QString &s, sl) { - errors += QSslError(error).errorString() + QL1S("\n"); + c += QL1S("
  • ") + s + QL1S("
  • "); } + c += QL1S("
"); + + label->setText( i18n("The certificate for this site is NOT valid, for the following reasons:\n%1", c) ); + label->setTextFormat(Qt::RichText); + imageLabel->setPixmap(KIcon("security-low").pixmap(32)); } - label = new QLabel(this); - label->setWordWrap(true); - label->setText( i18n("The certificate for this site is NOT valid for the following reasons:\n%1", errors) ); - - imageLabel->setPixmap(KIcon("security-medium").pixmap(32)); } } -- cgit v1.2.1