diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-13 20:08:40 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-13 20:08:40 (GMT) |
commit | 0863ece69f6490602e90b22c0dd17189bd8bf5a7 (patch) | |
tree | 640ea400d7b2e8786c6551795e070e0727f3b75e /Swift/QtUI | |
parent | c8603ee2ea4dfe9b881367198dbd259986345412 (diff) | |
download | swift-0863ece69f6490602e90b22c0dd17189bd8bf5a7.zip swift-0863ece69f6490602e90b22c0dd17189bd8bf5a7.tar.bz2 |
Extend the certificate accept dialog & login after accept.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 12 | ||||
-rw-r--r-- | Swift/QtUI/QtLoginWindow.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 42641ba..c1f4f24 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -391,12 +391,18 @@ void QtLoginWindow::moveEvent(QMoveEvent*) { emit geometryChanged(); } -bool QtLoginWindow::askUserToTrustCertificatePermanently(const String& message) { +bool QtLoginWindow::askUserToTrustCertificatePermanently(const String& message, Certificate::ref certificate) { QMessageBox dialog(this); - dialog.setText("Invalid server certificate."); - dialog.setInformativeText("The certificate presented by the server is not valid. " + P2QSTRING(message) + " Would you like to permanently trust this certificate? This must only be done if you know it is correct."); + + dialog.setText("The certificate presented by the server is not valid."); + dialog.setInformativeText(P2QSTRING(message) + "\n\nWould you like to permanently trust this certificate? This must only be done if you know it is correct."); + + QString detailedText = "Subject: " + P2QSTRING(certificate->getSubjectName()); + dialog.setDetailedText(detailedText); + dialog.setStandardButtons(QMessageBox::Yes | QMessageBox::No); dialog.setDefaultButton(QMessageBox::No); + return dialog.exec() == QMessageBox::Yes; } diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h index 3978d73..0efd377 100644 --- a/Swift/QtUI/QtLoginWindow.h +++ b/Swift/QtUI/QtLoginWindow.h @@ -39,7 +39,7 @@ namespace Swift { static QRect defaultPosition(); void setGentleGeometry(const QRect&); void selectUser(const String& user); - bool askUserToTrustCertificatePermanently(const String& message); + bool askUserToTrustCertificatePermanently(const String& message, Certificate::ref certificate); virtual void quit(); |