diff ui/certificateitemwidget.cpp @ 743:a467204a35f5

Rework User Interface. Certificate lists are now plain lists of widgets and no longer a ListWidget. Details are no longer shown extra but included in the list. List entries are somewhat larger accordingly.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 04 Jul 2014 16:15:59 +0200
parents 86c9ff4cfb02
children b6172b9f885d
line wrap: on
line diff
--- a/ui/certificateitemwidget.cpp	Fri Jul 04 16:13:40 2014 +0200
+++ b/ui/certificateitemwidget.cpp	Fri Jul 04 16:15:59 2014 +0200
@@ -33,7 +33,7 @@
 
 void CertificateItemWidget::setupGUI()
 {
-    mLabel = new QLabel(mCertificate.subjectCN());
+    mLabel = new QLabel;
     mComboBox = new IconOnlyTextPopupBox;
     QStyle *fusionStyle = QStyleFactory::create("Fusion");
     if (!fusionStyle) {
@@ -42,7 +42,17 @@
         mComboBox->setStyle(fusionStyle);
     }
 
-    mComboBox->setFixedWidth(46);
+    mComboBox->setIconSize(QSize(48, 48));
+    mComboBox->setFixedWidth(68);
+
+    const QString validity = tr("Vopalid: %1 until %2").arg(
+            QLocale::system().toString(mCertificate.validFrom().date(), QLocale::ShortFormat)).arg(
+            QLocale::system().toString(mCertificate.validTo().date(), QLocale::ShortFormat));
+    const QString fpstring = tr("Fingerprint (SHA1): &lt;%1&gt;").arg(mCertificate.fingerprint());
+    mLabel->setText(QString::fromLatin1("<big><b>%1</b><br/>%2<br/>%3<br/>%4</big>").arg
+        (mCertificate.subjectCN()).arg(mCertificate.subjectO()).arg(validity).arg
+        (fpstring));
+    mLabel->setTextFormat(Qt::RichText);
 
     mLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
     mComboBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
@@ -64,7 +74,7 @@
         QImage *img = new QImage(":/img/trash-empty.png");
         QLabel *imgLabel = new QLabel;
         imgLabel->setPixmap(QPixmap::fromImage(*img));
-        imgLabel->setFixedSize(28, 28);
+        imgLabel->setFixedSize(48, 48);
         imgLabel->setMargin(2);
         layout->addWidget(imgLabel);
     }

http://wald.intevation.org/projects/trustbridge/