[gnome-packagekit/glib2: 29/79] moo



commit 4569d7eb7122c26d13db3e660c39e61258c605f9
Author: Richard Hughes <richard hughsie com>
Date:   Fri Sep 18 15:09:44 2009 +0100

    moo

 src/gpk-watch.c |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index f8f3ea8..4731079 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -227,13 +227,7 @@ gpk_watch_refresh_tooltip (GpkWatch *watch)
 		localised_status = gpk_status_enum_to_localised_text (item->status);
 
 		/* should we display the text */
-		if (item->role == PK_ROLE_ENUM_UPDATE_PACKAGES ||
-		    egg_strzero (item->text)) {
-			g_string_append_printf (status, "%s\n", localised_status);
-		} else {
-			/* display the package name, not the package_id */
-			g_string_append_printf (status, "%s: %s\n", localised_status, item->text);
-		}
+		g_string_append_printf (status, "%s\n", localised_status);
 		/* don't fill the screen with a giant tooltip */
 		if (i > GPK_WATCH_MAXIMUM_TOOLTIP_LINES) {
 			/* TRANSLATORS: if the menu won't fit, inform the user there are a few more things waiting */
@@ -248,11 +242,7 @@ gpk_watch_refresh_tooltip (GpkWatch *watch)
 		g_string_set_size (status, status->len-1);
 
 out:
-#if GTK_CHECK_VERSION(2,15,0)
 	gtk_status_icon_set_tooltip_text (watch->priv->status_icon, status->str);
-#else
-	gtk_status_icon_set_tooltip (watch->priv->status_icon, status->str);
-#endif
 	g_string_free (status, TRUE);
 	return TRUE;
 }
@@ -290,7 +280,7 @@ gpk_watch_task_list_to_status_bitfield (GpkWatch *watch)
 		}
 
 		/* only show an icon for this if the application isn't still on the bus */
-		ret = pk_client_is_caller_active (item->monitor, &active, NULL);
+		g_object_get (item->monitor, "caller-active", &active, NULL);
 
 		/* if we failed to get data, assume bad things happened */
 		if (!ret)
@@ -438,15 +428,10 @@ gpk_watch_task_list_finished_cb (PkTransactionList *tlist, PkClient *client, PkE
 	gchar *text = NULL;
 	gchar *message = NULL;
 	NotifyNotification *notification;
-#if PK_CHECK_VERSION(0,5,0)
 	guint j;
 	const PkItemRequireRestart *item;
 	const PkItemRequireRestart *item_tmp;
 	GPtrArray *array;
-#else
-	gchar *id;
-	const GPtrArray *array;
-#endif
 	gchar **split;
 
 	g_return_if_fail (GPK_IS_WATCH (watch));
@@ -1194,6 +1179,8 @@ gpk_watch_populate_menu_with_jobs (GpkWatch *watch, GtkMenu *menu)
 	PkTransactionListItem *item;
 	GtkWidget *widget;
 	GtkWidget *image;
+	PkRoleEnum role;
+	PkStatusEnum status;
 	const gchar *localised_status;
 	const gchar *localised_role;
 	const gchar *icon_name;
@@ -1213,8 +1200,12 @@ gpk_watch_populate_menu_with_jobs (GpkWatch *watch, GtkMenu *menu)
 			egg_warning ("not found item %i", i);
 			break;
 		}
-		localised_role = gpk_role_enum_to_localised_present (item->role);
-		localised_status = gpk_status_enum_to_localised_text (item->status);
+		g_object_get (item->monitor,
+			      "role", &role,
+			      "status", &status,
+			      NULL_;
+		localised_role = gpk_role_enum_to_localised_present (role);
+		localised_status = gpk_status_enum_to_localised_text (status);
 
 		icon_name = gpk_status_enum_to_icon_name (item->status);
 		text = g_strdup_printf ("%s (%s)", localised_role, localised_status);



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