[PATCH] (Issue34) Show / hide details area depending on available changes

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


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1404311716 -7200
# Node ID 49bf73b5c7dea7c8b9a3c3f7f59871d67c9e922e
# Parent  e7a070e64b805d1e281b7b8aa8c227a0ff979eaa
(Issue34) Show / hide details area depending on available changes

diff -r e7a070e64b80 -r 49bf73b5c7de ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Wed Jul 02 16:27:46 2014 +0200
+++ b/ui/mainwindow.cpp	Wed Jul 02 16:35:16 2014 +0200
@@ -834,14 +834,6 @@
     mChangeCount = mUpdatesRemove->selectedCertCount() +
         mUpdatesNew->selectedCertCount() + mUpdatesManual->certificates().size();
 
-    if (mUpdatesManual->certificates().size()) {
-        mUpdatesDetailsManual->show();
-        mUpdatesManualCertificates->show();
-    } else {
-        mUpdatesDetailsManual->hide();
-        mUpdatesManualCertificates->hide();
-    }
-
     /* Show a different tip in case of manual changes, updates aviailable, updates and manual
      * changes available */
     if (changeCount() && !mUpdatesManual->certificates().size()) {
@@ -869,6 +861,16 @@
         mInstallButton->setText(" " + tr("Apply changes"));
     }
 
+    if (mUpdatesManual->certificates().size()) {
+        mUpdatesDetailsManual->show();
+        mUpdatesDetailsManual->setText(tr("Show details"));
+        mUpdatesManualCertificates->show();
+    } else {
+        mUpdatesDetailsManual->hide();
+        mUpdatesManualCertificates->hide();
+        mUpdatesManual->hide();
+    }
+
     if (mUpdatesNew->certificates().size()) {
         mUpdatesNewCertificates->setText("<h3>" +
                 tr("Install new trusted certificates (%1/%2)")
@@ -876,9 +878,11 @@
                 .arg(mUpdatesNew->certificates().size()) +
                 "</h3>");
         mUpdatesDetailsNew->show();
+        mUpdatesDetailsNew->setText(tr("Show details"));
         mUpdatesNewCertificates->show();
     } else {
         mUpdatesDetailsNew->hide();
+        mUpdatesNew->hide();
         mUpdatesNewCertificates->hide();
     }
 
@@ -889,10 +893,12 @@
                 .arg(mUpdatesRemove->certificates().size()) +
                 "</h3>");
         mUpdatesRemoveCertificates->show();
+        mUpdatesDetailsRemove->setText(tr("Show details"));
         mUpdatesDetailsRemove->show();
     } else {
         mUpdatesRemoveCertificates->hide();
         mUpdatesDetailsRemove->hide();
+        mUpdatesRemove->hide();
     }
 }
 


More information about the Trustbridge-commits mailing list