diff ui/certificateitemwidget.cpp @ 627:566ee111e331 trustbridge-refactor

Added state to certificate list item and updated certificate list widget.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 23 Jun 2014 12:46:53 +0200
parents 88c9bdc74175
children 9d806f140bd5
line wrap: on
line diff
--- a/ui/certificateitemwidget.cpp	Tue May 27 16:25:33 2014 +0200
+++ b/ui/certificateitemwidget.cpp	Mon Jun 23 12:46:53 2014 +0200
@@ -23,6 +23,8 @@
     mLabel = new QLabel(mCertificate.subjectCN());
     mComboBox = new QComboBox;
     mComboBox->setFixedWidth(46);
+    connect(mComboBox, SIGNAL(currentIndexChanged(int)),
+        this, SLOT(currentStateChanged(int)));
 
     if (mCertificate.isInstallCert()) {
         mComboBox->addItem(QIcon(":/img/list-add.png"), tr("add"), QVariant("true"));
@@ -39,3 +41,19 @@
     layout->addWidget(mLabel);
     this->setLayout(layout);
 }
+
+bool CertificateItemWidget::state()
+{
+    return mComboBox->currentData().toBool();
+}
+
+Certificate CertificateItemWidget::certificate()
+{
+    return mCertificate;
+}
+
+void CertificateItemWidget::currentStateChanged(int)
+{
+    bool state = mComboBox->currentData().toBool();
+    emit stateChanged(state, mCertificate);
+}

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