diff ui/listupdatedialog.cpp @ 82:1f27d6db5ee3

Polarssl based certificate handling
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Mar 2014 18:04:14 +0000
parents 01286d0872ca
children e52df5870c4f
line wrap: on
line diff
--- a/ui/listupdatedialog.cpp	Wed Mar 19 16:50:59 2014 +0000
+++ b/ui/listupdatedialog.cpp	Wed Mar 19 18:04:14 2014 +0000
@@ -25,16 +25,27 @@
 
     /* The remove groups */
     QVBoxLayout *removeGroupLayout = new QVBoxLayout;
-    QListWidget *removeListWidget = new QListWidget;
-    removeGroupLayout->addWidget(removeListWidget);
+    mRemoveListWidget = new QListWidget;
+    removeGroupLayout->addWidget(mRemoveListWidget);
     QGroupBox *removeGroup = new QGroupBox(tr("Select certificates to be removed"));
     removeGroup->setLayout(removeGroupLayout);
 
+    foreach (const Certificate& cert, mCertificateList.getRemoveCertificates()) {
+        if (!cert.isValid()) {
+            qWarning() << "Invalid certificate in list";
+            continue;
+        }
+        QListWidgetItem* item = new QListWidgetItem(cert.shortDescription());
+        item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
+        item->setCheckState(Qt::Checked);
+        mRemoveListWidget->addItem(item);
+    }
+
     /* The install group */
     QVBoxLayout *installGroupLayout = new QVBoxLayout;
-    QListWidget *installListWidget = new QListWidget;
+    mInstallListWidget = new QListWidget;
     QGroupBox *installGroup = new QGroupBox(tr("Select certificates to install"));
-    installGroupLayout->addWidget(installListWidget);
+    installGroupLayout->addWidget(mInstallListWidget);
     installGroup->setLayout(installGroupLayout);
 
     foreach (const Certificate& cert, mCertificateList.getInstallCertificates()) {
@@ -45,7 +56,7 @@
         QListWidgetItem* item = new QListWidgetItem(cert.shortDescription());
         item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
         item->setCheckState(Qt::Checked);
-        installListWidget->addItem(item);
+        mInstallListWidget->addItem(item);
     }
 
     /* Add groups to layout */
@@ -60,3 +71,7 @@
 
     return;
 }
+
+void ListUpdateDialog::executeUpdate() {
+
+}

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