comparison ui/mainwindow.cpp @ 1311:135891f1c8f4

(issue154) Do not force the details button to be active if a certificate changes This reuses the activate function to reduce redundancy.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 13 Oct 2014 14:21:27 +0200
parents fce8c122cbc4
children f9f2c92969d2
comparison
equal deleted inserted replaced
1310:60e481aa75ca 1311:135891f1c8f4
1221 mUpdatesNewCertificates->setText("<h3>" + 1221 mUpdatesNewCertificates->setText("<h3>" +
1222 tr("Install new trusted certificates (%1/%2)") 1222 tr("Install new trusted certificates (%1/%2)")
1223 .arg(mUpdatesNew->selectedCertCount()) 1223 .arg(mUpdatesNew->selectedCertCount())
1224 .arg(mUpdatesNew->certificates().size()) + 1224 .arg(mUpdatesNew->certificates().size()) +
1225 "</h3>"); 1225 "</h3>");
1226 mUpdatesDetailsNew->show(); 1226 if (!mUpdatesNew->isVisible()) {
1227 mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png")); 1227 activateDetailsButton(mUpdatesDetailsNew);
1228 mUpdatesDetailsNew->setToolTip(tr("Show details")); 1228 }
1229 mUpdatesNewCertificates->show(); 1229 mUpdatesNewCertificates->show();
1230 } else { 1230 } else {
1231 mUpdatesDetailsNew->hide(); 1231 mUpdatesDetailsNew->hide();
1232 mUpdatesNew->hide(); 1232 mUpdatesNew->hide();
1233 mUpdatesNewCertificates->hide(); 1233 mUpdatesNewCertificates->hide();
1238 tr("Remove revoked certificates (%1/%2)") 1238 tr("Remove revoked certificates (%1/%2)")
1239 .arg(mUpdatesRemove->selectedCertCount()) 1239 .arg(mUpdatesRemove->selectedCertCount())
1240 .arg(mUpdatesRemove->certificates().size()) + 1240 .arg(mUpdatesRemove->certificates().size()) +
1241 "</h3>"); 1241 "</h3>");
1242 mUpdatesRemoveCertificates->show(); 1242 mUpdatesRemoveCertificates->show();
1243 mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png")); 1243 if (!mUpdatesRemove->isVisible()) {
1244 mUpdatesDetailsRemove->setToolTip(tr("Show details")); 1244 activateDetailsButton(mUpdatesDetailsRemove);
1245 mUpdatesDetailsRemove->show(); 1245 }
1246 } else { 1246 } else {
1247 mUpdatesRemoveCertificates->hide(); 1247 mUpdatesRemoveCertificates->hide();
1248 mUpdatesDetailsRemove->hide(); 1248 mUpdatesDetailsRemove->hide();
1249 mUpdatesRemove->hide(); 1249 mUpdatesRemove->hide();
1250 } 1250 }
1674 1674
1675 static void activateDetailsButton(QPushButton *btn) { 1675 static void activateDetailsButton(QPushButton *btn) {
1676 btn->setToolTip(QObject::tr("Show details")); 1676 btn->setToolTip(QObject::tr("Show details"));
1677 btn->setText(" " + QObject::tr("Details")); 1677 btn->setText(" " + QObject::tr("Details"));
1678 btn->setIcon(QIcon(":/img/dialog-information_16px.png")); 1678 btn->setIcon(QIcon(":/img/dialog-information_16px.png"));
1679 btn->show();
1679 } 1680 }
1680 1681
1681 void MainWindow::toggleUpdatesNew() { 1682 void MainWindow::toggleUpdatesNew() {
1682 if (!mUpdatesNew->isVisible()) { 1683 if (!mUpdatesNew->isVisible()) {
1683 mUpdatesNew->show(); 1684 mUpdatesNew->show();

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