[gnome-software] Fix visibility of the 'Restart & Update' button



commit 4512dbfd2af8d36a88e1e3c771439d60b62b8c07
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 28 21:29:23 2013 -0400

    Fix visibility of the 'Restart & Update' button
    
    When we go back and don't regenerate the list, we need
    to set the visibility according to whether the list
    is empty or not.

 src/gs-shell-updates.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index e35bd21..1c5303d 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -148,6 +148,7 @@ gs_shell_updates_refresh (GsShellUpdates *shell_updates)
        GsShellUpdatesPrivate *priv = shell_updates->priv;
         GtkWidget *widget;
         GtkSpinner *spinner;
+        GList *list;
 
         widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "buttonbox_main"));
         gtk_widget_show (widget);
@@ -155,7 +156,9 @@ gs_shell_updates_refresh (GsShellUpdates *shell_updates)
        /* no need to refresh */
        if (priv->cache_valid) {
                 widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_update_all"));
-                gtk_widget_show (widget);
+                list = gtk_container_get_children (priv->list_box_updates);
+                gtk_widget_set_visible (widget, list != NULL);
+                g_list_free (list);
                return;
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]