[gnome-software] Show the number of available updates in the button



commit a468f047001a59f2abdc89c59bff956eb9428cec
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 20 16:11:04 2013 -0400

    Show the number of available updates in the button
    
    This is more accessible than the throbbing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708481

 src/gs-shell-updates.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index fa563e4..a1e937e 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -96,6 +96,22 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
        }
 
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates"));
+       if (list != NULL) {
+               gchar *text;
+               /* TRANSLATORS: A label for a button to show only updates
+                * which are available to install. The '%d' refers to the
+                * number of available updates
+                */
+               text = g_strdup_printf (_("_Updates (%d)"), g_list_length (list));
+               gtk_button_set_label (GTK_BUTTON (widget), text);
+               g_free (text);
+       } else {
+               /* TRANSLATORS: A label for a button to show only updates
+                * which are available to install.
+                */
+               gtk_button_set_label (GTK_BUTTON (widget), _("_Updates"));
+       }
+
        if (list != NULL &&
             gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATES &&
             gs_shell_get_mode (priv->shell) != GS_SHELL_MODE_UPDATED)


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