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



commit 2f97cd9ce38c92b72c6aa13f187adc0954bdfa74
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 b572a3d..cd5a1b1 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -227,6 +227,7 @@ gpk_watch_task_list_to_status_bitfield (GpkWatch *watch)
 {
 	gboolean ret;
 	gboolean active;
+	gboolean watch_active;
 	guint i;
 	guint length;
 	PkBitfield status = 0;
@@ -239,6 +240,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);
@@ -256,7 +260,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]