summaryrefslogtreecommitdiff
path: root/src/urlbar/sslwidget.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-07-10 17:21:47 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-07-18 11:37:08 +0200
commita656e6c5fd5662a3d990115e2b5851570149d594 (patch)
tree06f85884c8c81b1c1d6db697b2f47d4aef779ae8 /src/urlbar/sslwidget.cpp
parentImproving SSL widget & dialog, step 3 (diff)
downloadrekonq-a656e6c5fd5662a3d990115e2b5851570149d594.tar.xz
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...)
Diffstat (limited to 'src/urlbar/sslwidget.cpp')
-rw-r--r--src/urlbar/sslwidget.cpp61
1 files changed, 36 insertions, 25 deletions
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("<hr /><h4>Encryption</h4>") ); // ----------------------------------------------- //
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);