diff ui/certificatetabledelegate.cpp @ 358:9ba7b4b4c1de

Implemented the load from certificate file and set the edit state of certificates.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 10 Apr 2014 17:06:37 +0200
parents c9315b24b055
children bae8d4a20ef1
line wrap: on
line diff
--- a/ui/certificatetabledelegate.cpp	Thu Apr 10 17:04:41 2014 +0200
+++ b/ui/certificatetabledelegate.cpp	Thu Apr 10 17:06:37 2014 +0200
@@ -38,10 +38,14 @@
 QWidget *CertificateTableDelegate::drawComboBox(QWidget *parent,
     const QStyleOptionViewItem &option, const QModelIndex &index) const
 {
+    bool editable = index.data(Qt::UserRole).toBool();
     // Create a combobox and add two items for install/remove.
     QComboBox *comboBox = new QComboBox(parent);
     comboBox->addItem(QIcon(":/img/list-add.png"), QString(""), QVariant("true"));
-    comboBox->addItem(QIcon(":/img/list-remove.png"), QString(""), QVariant("false"));
+    if (editable) {
+        comboBox->addItem(QIcon(":/img/list-remove.png"),
+            QString(""), QVariant("false"));
+    }
     return comboBox;
 }
 

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