[gnome-software] Show a overlay of 'Updates' for updatable applications
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Show a overlay of 'Updates' for updatable applications
- Date: Thu, 26 Sep 2013 16:38:26 +0000 (UTC)
commit 71eba42a4210577e6457e05c34987e4e9dd04e81
Author: Richard Hughes <richard hughsie com>
Date: Thu Sep 26 17:15:17 2013 +0100
Show a overlay of 'Updates' for updatable applications
src/gs-app-tile.c | 24 +++++++++++++++++++-----
src/gs-feature-tile.c | 6 +++++-
src/gs-popular-tile.c | 20 +++++++++++++++++---
3 files changed, 41 insertions(+), 9 deletions(-)
---
diff --git a/src/gs-app-tile.c b/src/gs-app-tile.c
index 6ba86f6..b650126 100644
--- a/src/gs-app-tile.c
+++ b/src/gs-app-tile.c
@@ -59,24 +59,38 @@ gs_app_tile_get_app (GsAppTile *tile)
static void
app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
{
- GsAppTilePrivate *priv;
- AtkObject *accessible;
- gchar *name;
+ AtkObject *accessible;
+ GsAppTilePrivate *priv;
+ GtkWidget *label;
gboolean installed;
+ gchar *name;
priv = gs_app_tile_get_instance_private (tile);
accessible = gtk_widget_get_accessible (priv->button);
+ label = gtk_bin_get_child (GTK_BIN (priv->eventbox));
switch (gs_app_get_state (app)) {
case GS_APP_STATE_INSTALLED:
case GS_APP_STATE_INSTALLING:
case GS_APP_STATE_REMOVING:
- case GS_APP_STATE_UPDATABLE:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
gs_app_get_name (app),
_("Installed"));
- break;
+ /* TRANSLATORS: this is the small blue label on the tile
+ * that tells the user the application is installed */
+ gtk_label_set_label (GTK_LABEL (label), _("Installed"));
+ break;
+ case GS_APP_STATE_UPDATABLE:
+ installed = TRUE;
+ name = g_strdup_printf ("%s (%s)",
+ gs_app_get_name (app),
+ _("Updates"));
+ /* TRANSLATORS: this is the small blue label on the tile
+ * that tells the user there is an update for the installed
+ * application available */
+ gtk_label_set_label (GTK_LABEL (label), _("Updates"));
+ break;
case GS_APP_STATE_AVAILABLE:
default:
installed = FALSE;
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index 642e8ea..feaded5 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -70,11 +70,15 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsFeatureTile *tile)
case GS_APP_STATE_INSTALLED:
case GS_APP_STATE_INSTALLING:
case GS_APP_STATE_REMOVING:
- case GS_APP_STATE_UPDATABLE:
name = g_strdup_printf ("%s (%s)",
gs_app_get_name (app),
_("Installed"));
break;
+ case GS_APP_STATE_UPDATABLE:
+ name = g_strdup_printf ("%s (%s)",
+ gs_app_get_name (app),
+ _("Updates"));
+ break;
case GS_APP_STATE_AVAILABLE:
default:
name = g_strdup (gs_app_get_name (app));
diff --git a/src/gs-popular-tile.c b/src/gs-popular-tile.c
index c272d48..106d478 100644
--- a/src/gs-popular-tile.c
+++ b/src/gs-popular-tile.c
@@ -58,23 +58,37 @@ gs_popular_tile_get_app (GsPopularTile *tile)
static void
app_state_changed (GsApp *app, GParamSpec *pspec, GsPopularTile *tile)
{
- GsPopularTilePrivate *priv;
AtkObject *accessible;
- gchar *name;
+ GsPopularTilePrivate *priv;
+ GtkWidget *label;
gboolean installed;
+ gchar *name;
priv = gs_popular_tile_get_instance_private (tile);
accessible = gtk_widget_get_accessible (priv->button);
+ label = gtk_bin_get_child (GTK_BIN (priv->eventbox));
switch (gs_app_get_state (app)) {
case GS_APP_STATE_INSTALLED:
case GS_APP_STATE_INSTALLING:
case GS_APP_STATE_REMOVING:
- case GS_APP_STATE_UPDATABLE:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
gs_app_get_name (app),
_("Installed"));
+ /* TRANSLATORS: this is the small blue label on the tile
+ * that tells the user the application is installed */
+ gtk_label_set_label (GTK_LABEL (label), _("Installed"));
+ break;
+ case GS_APP_STATE_UPDATABLE:
+ installed = TRUE;
+ name = g_strdup_printf ("%s (%s)",
+ gs_app_get_name (app),
+ _("Updates"));
+ /* TRANSLATORS: this is the small blue label on the tile
+ * that tells the user there is an update for the installed
+ * application available */
+ gtk_label_set_label (GTK_LABEL (label), _("Updates"));
break;
case GS_APP_STATE_AVAILABLE:
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]