[PATCH 1 of 2] (Issue26) Hide update lists if no updates are available

Wald Commits scm-commit at wald.intevation.org
Wed Jul 2 16:27:51 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# 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 @@
                 "</h2>");
     }
 
-    mUpdatesNewCertificates->setText("<h3>" +
-            tr("Install new trusted certificates (%1/%2)")
-            .arg(mUpdatesNew->selectedCertCount())
-            .arg(mUpdatesNew->certificates().size()) +
-            "</h3>");
-    mUpdatesRemoveCertificates->setText("<h3>" +
-            tr("Remove revoked certificates (%1/%2)")
-            .arg(mUpdatesRemove->selectedCertCount())
-            .arg(mUpdatesRemove->certificates().size()) +
-            "</h3>");
+    if (mUpdatesNew->certificates().size()) {
+        mUpdatesNewCertificates->setText("<h3>" +
+                tr("Install new trusted certificates (%1/%2)")
+                .arg(mUpdatesNew->selectedCertCount())
+                .arg(mUpdatesNew->certificates().size()) +
+                "</h3>");
+        mUpdatesDetailsNew->show();
+        mUpdatesNewCertificates->show();
+    } else {
+        mUpdatesDetailsNew->hide();
+        mUpdatesNewCertificates->hide();
+    }
+
+    if (mUpdatesRemove->certificates().size()) {
+        mUpdatesRemoveCertificates->setText("<h3>" +
+                tr("Remove revoked certificates (%1/%2)")
+                .arg(mUpdatesRemove->selectedCertCount())
+                .arg(mUpdatesRemove->certificates().size()) +
+                "</h3>");
+        mUpdatesRemoveCertificates->show();
+        mUpdatesDetailsRemove->show();
+    } else {
+        mUpdatesRemoveCertificates->hide();
+        mUpdatesDetailsRemove->hide();
+    }
 }
 
 void MainWindow::loadCertificateList()


More information about the Trustbridge-commits mailing list