summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-07-11 12:45:20 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-07-18 11:37:08 +0200
commit130ed6c522a148c8bb98a2ece22a3d64be06df7d (patch)
tree87f75a7eec55ca18b858035c52293734907d5972 /src/urlbar
parentSSL rewamp, one step to finish! (diff)
downloadrekonq-130ed6c522a148c8bb98a2ece22a3d64be06df7d.tar.xz
Last fixes for the SSL dialog improvements
Now we are ready for the fight...
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/sslwidget.cpp34
1 files changed, 19 insertions, 15 deletions
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 <QSslError>
-
// Qt Includes
#include <QtGui/QDialogButtonBox>
#include <QtGui/QGridLayout>
@@ -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<QStringList> 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<QSslError::SslError>(s.trimmed().toInt(&didConvert));
- if (didConvert)
+ QStringList sl = errorList.at(0);
+ QString c = QL1S("<ul>");
+ Q_FOREACH(const QString &s, sl)
{
- errors += QSslError(error).errorString() + QL1S("\n");
+ c += QL1S("<li>") + s + QL1S("</li>");
}
+ c += QL1S("</ul>");
+
+ 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));
}
}