# HG changeset patch # User Andre Heinecke # Date 1404310552 -7200 # Node ID 77c9c2dfc8ac41246835f6d8e4ce1551053d710e # Parent 929c3db85eb77fc10c5231fa6071eb30a5f306f4 (Issue26) Hide update lists if no updates are available diff -r 929c3db85eb7 -r 77c9c2dfc8ac ui/mainwindow.cpp --- a/ui/mainwindow.cpp Wed Jul 02 16:09:19 2014 +0200 +++ b/ui/mainwindow.cpp Wed Jul 02 16:15:52 2014 +0200 @@ -853,16 +853,31 @@ ""); } - mUpdatesNewCertificates->setText("

" + - tr("Install new trusted certificates (%1/%2)") - .arg(mUpdatesNew->selectedCertCount()) - .arg(mUpdatesNew->certificates().size()) + - "

"); - mUpdatesRemoveCertificates->setText("

" + - tr("Remove revoked certificates (%1/%2)") - .arg(mUpdatesRemove->selectedCertCount()) - .arg(mUpdatesRemove->certificates().size()) + - "

"); + if (mUpdatesNew->certificates().size()) { + mUpdatesNewCertificates->setText("

" + + tr("Install new trusted certificates (%1/%2)") + .arg(mUpdatesNew->selectedCertCount()) + .arg(mUpdatesNew->certificates().size()) + + "

"); + mUpdatesDetailsNew->show(); + mUpdatesNewCertificates->show(); + } else { + mUpdatesDetailsNew->hide(); + mUpdatesNewCertificates->hide(); + } + + if (mUpdatesRemove->certificates().size()) { + mUpdatesRemoveCertificates->setText("

" + + tr("Remove revoked certificates (%1/%2)") + .arg(mUpdatesRemove->selectedCertCount()) + .arg(mUpdatesRemove->certificates().size()) + + "

"); + mUpdatesRemoveCertificates->show(); + mUpdatesDetailsRemove->show(); + } else { + mUpdatesRemoveCertificates->hide(); + mUpdatesDetailsRemove->hide(); + } } void MainWindow::loadCertificateList()