[gnome-packagekit] Add preference to be able to see every PackageKit transaction, even if it's active



commit 74394a85baa9b36beb889c16d6f23fc5ce4f20d3
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jun 25 09:43:54 2009 +0100

    Add preference to be able to see every PackageKit transaction, even if it's active

 data/gnome-packagekit.schemas.in |   12 ++++++++++++
 src/gpk-common.h                 |    1 +
 src/gpk-watch.c                  |    6 +++++-
 3 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/data/gnome-packagekit.schemas.in b/data/gnome-packagekit.schemas.in
index 34d10a9..8f3bd0b 100644
--- a/data/gnome-packagekit.schemas.in
+++ b/data/gnome-packagekit.schemas.in
@@ -230,6 +230,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome-packagekit/update-icon/watch_active_transactions</key>
+      <applyto>/apps/gnome-packagekit/update-icon/watch_active_transactions</applyto>
+      <owner>gnome-packagekit</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Show transactions that have the original application running</short>
+        <long>Show the transaction progress icon in the tray when the original applications is still running.</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome-packagekit/autocomplete</key>
       <applyto>/apps/gnome-packagekit/autocomplete</applyto>
       <owner>gnome-packagekit</owner>
diff --git a/src/gpk-common.h b/src/gpk-common.h
index 4a30683..7f558d0 100644
--- a/src/gpk-common.h
+++ b/src/gpk-common.h
@@ -65,6 +65,7 @@ G_BEGIN_DECLS
 #define GPK_CONF_UPDATE_BATTERY			"/apps/gnome-packagekit/update-icon/update_battery"
 #define GPK_CONF_BANNED_FIRMWARE		"/apps/gnome-packagekit/update-icon/banned_firmware"
 #define GPK_CONF_IGNORED_MESSAGES		"/apps/gnome-packagekit/update-icon/ignored_messages"
+#define GPK_CONF_WATCH_ACTIVE_TRANSACTIONS	"/apps/gnome-packagekit/update-icon/watch_active_transactions"
 #define GPK_CONF_APPLICATION_FILTER_BASENAME	"/apps/gnome-packagekit/application/filter_basename"
 #define GPK_CONF_APPLICATION_FILTER_NEWEST	"/apps/gnome-packagekit/application/filter_newest"
 #define GPK_CONF_APPLICATION_CATEGORY_GROUPS	"/apps/gnome-packagekit/application/category_groups"
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index 1ad3a5c..6a25c9d 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -229,6 +229,7 @@ gpk_watch_task_list_to_status_bitfield (GpkWatch *watch)
 {
 	gboolean ret;
 	gboolean active;
+	gboolean watch_active;
 	guint i;
 	guint length;
 	PkBitfield status = 0;
@@ -241,6 +242,9 @@ gpk_watch_task_list_to_status_bitfield (GpkWatch *watch)
 	if (length == 0)
 		goto out;
 
+	/* do we watch active transactions */
+	watch_active = gconf_client_get_bool (watch->priv->gconf_client, GPK_CONF_WATCH_ACTIVE_TRANSACTIONS, NULL);
+
 	/* add each status to a list */
 	for (i=0; i<length; i++) {
 		item = pk_task_list_get_item (watch->priv->tlist, i);
@@ -258,7 +262,7 @@ gpk_watch_task_list_to_status_bitfield (GpkWatch *watch)
 
 		/* add to bitfield calculation */
 		egg_debug ("%s %s (active:%i)", item->tid, pk_status_enum_to_text (item->status), active);
-		if (!active)
+		if (!active || watch_active)
 			pk_bitfield_add (status, item->status);
 	}
 out:



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