From a656e6c5fd5662a3d990115e2b5851570149d594 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 10 Jul 2011 17:21:47 +0200 Subject: WARNING: HISTORY_VERSION upgrade!! This commit changes rekonq history data struct to manage also the first time you visited a site. This way we can "expose" this new info in the SSL widget. (We can obviously do a lot more with it...) --- src/urlbar/sslwidget.cpp | 61 ++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 25 deletions(-) (limited to 'src/urlbar') diff --git a/src/urlbar/sslwidget.cpp b/src/urlbar/sslwidget.cpp index fb0ed493..862bdb3f 100644 --- a/src/urlbar/sslwidget.cpp +++ b/src/urlbar/sslwidget.cpp @@ -100,28 +100,37 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) label->setText( QL1S("

Encryption

") ); // ----------------------------------------------- // layout->addRow(label); - label = new QLabel(this); - label->setWordWrap(true); - label->setText( i18n("Your connection to %1 is encrypted with %2 encryption\n\n", m_url.host(), m_info.supportedChiperBits()) ); - layout->addRow(label); - - QString sslVersion = QL1S("SSLv") + cert.version(); - label = new QLabel(this); - label->setWordWrap(true); - label->setText( i18n("The connection uses %1\n\n", sslVersion) ); - layout->addRow(label); - - const QStringList cipherInfo = m_info.ciphers().split('\n', QString::SkipEmptyParts); - label = new QLabel(this); - label->setWordWrap(true); - label->setText( i18n("The connection is encrypted using %1 at %2 bits with %3 for message authentication and %4 as the key exchange mechanism.\n\n", - cipherInfo[0], - m_info.usedChiperBits(), - cipherInfo[3], - cipherInfo[1]) - - ); - layout->addRow(label); + if (cert.isNull()) + { + label = new QLabel(this); + label->setWordWrap(true); + label->setText( i18n("Your connection to %1 is NOT encrypted!!\n\n", m_url.host()) ); + layout->addRow(label); + } + else + { + label = new QLabel(this); + label->setWordWrap(true); + label->setText( i18n("Your connection to %1 is encrypted with %2 encryption\n\n", m_url.host(), m_info.supportedChiperBits()) ); + layout->addRow(label); + + QString sslVersion = QL1S("SSLv") + cert.version(); + label = new QLabel(this); + label->setWordWrap(true); + label->setText( i18n("The connection uses %1\n\n", sslVersion) ); + layout->addRow(label); + + const QStringList cipherInfo = m_info.ciphers().split('\n', QString::SkipEmptyParts); + label = new QLabel(this); + label->setWordWrap(true); + label->setText( + i18n("The connection is encrypted using %1 at %2 bits with %3 for message authentication and %4 as the key exchange mechanism.\n\n", + cipherInfo[0], + m_info.usedChiperBits(), + cipherInfo[3], + cipherInfo[1]) ); + layout->addRow(label); + } // ------------------------------------------------------------------------------------------------------------------ label = new QLabel(this); @@ -132,13 +141,15 @@ SSLWidget::SSLWidget(const QUrl &url, const WebSslInfo &info, QWidget *parent) label = new QLabel(this); label->setWordWrap(true); - if (rApp->historyManager()->historyContains(url.toString())) //FIXME change with visit count > 1 + HistoryItem firstVisit = rApp->historyManager()->find(url.toString()).first(); + + if (firstVisit.visitCount == 1) { - label->setText( i18n("You just visited this site") ); + label->setText( i18n("It's your first time visiting this site") ); } else { - label->setText( i18n("It's your first time visiting this site") ); + label->setText( i18n("You just visited this site!\nYour first visit was on %1", firstVisit.firstDateTimeVisit.toString()) ); } layout->addRow(label); -- cgit v1.2.1