comparison 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
comparison
equal deleted inserted replaced
1200:7b24109c1a55 1201:9bdce8d6fd43
1491 void MainWindow::toggleInManual(bool state, const Certificate &cert) 1491 void MainWindow::toggleInManual(bool state, const Certificate &cert)
1492 { 1492 {
1493 if (!mUpdatesManual->contains(cert)) { 1493 if (!mUpdatesManual->contains(cert)) {
1494 QToolButton* actionBtn = new QToolButton(); 1494 QToolButton* actionBtn = new QToolButton();
1495 QIcon btnIcon; 1495 QIcon btnIcon;
1496 btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::On); 1496 if (mRemoveList->contains(cert)) {
1497 btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off); 1497 btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::On);
1498 actionBtn->setProperty("ToolTip_On", tr("Certificate will be installed.")); 1498 btnIcon.addFile(":/img/cert-is-installed-bad-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
1499 actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed.")); 1499 actionBtn->setProperty("ToolTip_On", tr("Certificate will be removed."));
1500 /* Off should never be possible here
1501 * As the manual change of removed certificates is disabled */
1502 actionBtn->setProperty("ToolTip_Off", tr("Certificate will not be removed."));
1503 } else {
1504 btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::On);
1505 btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
1506 actionBtn->setProperty("ToolTip_On", tr("Certificate will be installed."));
1507 actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed."));
1508 }
1500 actionBtn->setIcon(btnIcon); 1509 actionBtn->setIcon(btnIcon);
1501 mUpdatesManual->addCertificate(cert, state, actionBtn); 1510 mUpdatesManual->addCertificate(cert, state, actionBtn);
1502 } 1511 }
1503 else { 1512 else {
1504 mUpdatesManual->removeCertificate(cert); 1513 mUpdatesManual->removeCertificate(cert);

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