diff ui/mainwindow.cpp @ 1201:9bdce8d6fd43

(issue144) Handle removal certificates differently in manual changes.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 23 Sep 2014 10:38:11 +0200
parents 2a1206932f53
children 407f2c1286ae
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Tue Sep 23 09:21:01 2014 +0200
+++ b/ui/mainwindow.cpp	Tue Sep 23 10:38:11 2014 +0200
@@ -1493,10 +1493,19 @@
     if (!mUpdatesManual->contains(cert)) {
         QToolButton* actionBtn = new QToolButton();
         QIcon btnIcon;
-        btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::On);
-        btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
-        actionBtn->setProperty("ToolTip_On", tr("Certificate will be installed."));
-        actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed."));
+        if (mRemoveList->contains(cert)) {
+            btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::On);
+            btnIcon.addFile(":/img/cert-is-installed-bad-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
+            actionBtn->setProperty("ToolTip_On", tr("Certificate will be removed."));
+            /* Off should never be possible here
+             * As the manual change of removed certificates is disabled */
+            actionBtn->setProperty("ToolTip_Off", tr("Certificate will not be removed."));
+        } else {
+            btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::On);
+            btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
+            actionBtn->setProperty("ToolTip_On", tr("Certificate will be installed."));
+            actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed."));
+        }
         actionBtn->setIcon(btnIcon);
         mUpdatesManual->addCertificate(cert, state, actionBtn);
     }

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