gnome-packagekit r333 - in trunk: data src



Author: rhughes
Date: Fri Oct 10 17:39:57 2008
New Revision: 333
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=333&view=rev

Log:
from git

Modified:
   trunk/data/gnome-packagekit.schemas.in
   trunk/src/gpk-application.c
   trunk/src/gpk-auto-refresh.c
   trunk/src/gpk-common.h
   trunk/src/gpk-log.c

Modified: trunk/data/gnome-packagekit.schemas.in
==============================================================================
--- trunk/data/gnome-packagekit.schemas.in	(original)
+++ trunk/data/gnome-packagekit.schemas.in	Fri Oct 10 17:39:57 2008
@@ -206,6 +206,21 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome-packagekit/force_get_updates_login</key>
+      <applyto>/apps/gnome-packagekit/force_get_updates_login</applyto>
+      <owner>gnome-packagekit</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+        <short>If we should get the update list when the session starts</short>
+        <long>
+          If we should get the update list when the session starts, even if we are not scheduled to.
+          This ensures the user has up to date and valid data in the tray at startup.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome-packagekit/frequency_get_updates</key>
       <applyto>/apps/gnome-packagekit/frequency_get_updates</applyto>
       <owner>gnome-packagekit</owner>

Modified: trunk/src/gpk-application.c
==============================================================================
--- trunk/src/gpk-application.c	(original)
+++ trunk/src/gpk-application.c	Fri Oct 10 17:39:57 2008
@@ -508,6 +508,7 @@
 
 	g_return_if_fail (PK_IS_APPLICATION (application));
 
+	gpk_client_set_interaction (application->priv->gclient, GPK_CLIENT_INTERACT_WARNING_CONFIRM_PROGRESS);
 	files = gpk_client_get_file_list (application->priv->gclient, application->priv->package, &error);
 	if (files == NULL) {
 		egg_warning ("could not get file list: %s", error->message);
@@ -2858,7 +2859,7 @@
 	application->priv->search_mode = PK_MODE_UNKNOWN;
 	application->priv->filters_current = PK_FILTER_ENUM_NONE;
 
-	/* watch gnome-power-manager keys */
+	/* watch gnome-packagekit keys */
 	gconf_client_add_dir (application->priv->gconf_client, GPK_CONF_DIR,
 			      GCONF_CLIENT_PRELOAD_NONE, NULL);
 	gconf_client_notify_add (application->priv->gconf_client, GPK_CONF_DIR,

Modified: trunk/src/gpk-auto-refresh.c
==============================================================================
--- trunk/src/gpk-auto-refresh.c	(original)
+++ trunk/src/gpk-auto-refresh.c	Fri Oct 10 17:39:57 2008
@@ -38,6 +38,7 @@
 #include <pk-control.h>
 
 #include "egg-debug.h"
+#include "egg-string.h"
 #include "egg-dbus-monitor.h"
 
 #include "gpk-common.h"
@@ -74,7 +75,7 @@
 	gboolean		 on_battery;
 	gboolean		 network_active;
 	gboolean		 session_delay;
-	gboolean		 sent_get_updates;
+	gboolean		 force_get_updates_login;
 	EggDbusMonitor		*monitor_gs;
 	EggDbusMonitor		*monitor_gpm;
 	GConfClient		*gconf_client;
@@ -346,6 +347,8 @@
 static gboolean
 gpk_auto_refresh_change_state (GpkAutoRefresh *arefresh)
 {
+	gboolean force;
+
 	g_return_val_if_fail (GPK_IS_AUTO_REFRESH (arefresh), FALSE);
 
 	/* we shouldn't do this early in the session startup */
@@ -360,11 +363,16 @@
 		return FALSE;
 	}
 
-	/* we do this to get an icon at startup */
-	if (!arefresh->priv->sent_get_updates) {
-		gpk_auto_refresh_signal_get_updates (arefresh);
-		arefresh->priv->sent_get_updates = TRUE;
-		return TRUE;
+	/* only force a check if the user REALLY, REALLY wants to break
+	 * set policy and have an update at startup */
+	if (!arefresh->priv->force_get_updates_login) {
+		arefresh->priv->force_get_updates_login = TRUE;
+		force = gconf_client_get_bool (arefresh->priv->gconf_client, GPK_CONF_FORCE_GET_UPDATES_LOGIN, NULL);
+		if (force) {
+			egg_debug ("forcing get update due to GConf");
+			gpk_auto_refresh_signal_get_updates (arefresh);
+			return TRUE;
+		}
 	}
 
 	/* try to do both */
@@ -376,6 +384,25 @@
 }
 
 /**
+ * gpk_auto_refresh_gconf_key_changed_cb:
+ *
+ * We might have to do things when the gconf keys change; do them here.
+ **/
+static void
+gpk_auto_refresh_gconf_key_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, GpkAutoRefresh *arefresh)
+{
+	g_return_if_fail (GPK_IS_AUTO_REFRESH (arefresh));
+	if (egg_strequal (entry->key, GPK_CONF_SESSION_STARTUP_TIMEOUT) ||
+	    egg_strequal (entry->key, GPK_CONF_FORCE_GET_UPDATES_LOGIN) ||
+	    egg_strequal (entry->key, GPK_CONF_FREQUENCY_GET_UPDATES) ||
+	    egg_strequal (entry->key, GPK_CONF_FREQUENCY_GET_UPGRADES) ||
+	    egg_strequal (entry->key, GPK_CONF_FREQUENCY_REFRESH_CACHE) ||
+	    egg_strequal (entry->key, GPK_CONF_AUTO_UPDATE) ||
+	    egg_strequal (entry->key, GPK_CONF_UPDATE_BATTERY))
+		gpk_auto_refresh_change_state (arefresh);
+}
+
+/**
  * gpk_auto_refresh_idle_cb:
  **/
 static void
@@ -577,7 +604,7 @@
 	arefresh->priv->session_idle = FALSE;
 	arefresh->priv->network_active = FALSE;
 	arefresh->priv->session_delay = FALSE;
-	arefresh->priv->sent_get_updates = FALSE;
+	arefresh->priv->force_get_updates_login = FALSE;
 
 	arefresh->priv->proxy_gs = NULL;
 	arefresh->priv->proxy_gpm = NULL;
@@ -585,6 +612,13 @@
 	/* we need to know the updates frequency */
 	arefresh->priv->gconf_client = gconf_client_get_default ();
 
+	/* watch gnome-packagekit keys */
+	gconf_client_add_dir (arefresh->priv->gconf_client, GPK_CONF_DIR,
+			      GCONF_CLIENT_PRELOAD_NONE, NULL);
+	gconf_client_notify_add (arefresh->priv->gconf_client, GPK_CONF_DIR,
+				 (GConfClientNotifyFunc) gpk_auto_refresh_gconf_key_changed_cb,
+				 arefresh, NULL, NULL);
+
 	/* we need to query the last cache refresh time */
 	arefresh->priv->control = pk_control_new ();
 	g_signal_connect (arefresh->priv->control, "network-state-changed",

Modified: trunk/src/gpk-common.h
==============================================================================
--- trunk/src/gpk-common.h	(original)
+++ trunk/src/gpk-common.h	Fri Oct 10 17:39:57 2008
@@ -46,6 +46,7 @@
 #define GPK_CONF_NOTIFY_UPDATE_COMPLETE_RESTART	"/apps/gnome-packagekit/notify_update_complete_restart"
 #define GPK_CONF_AUTOCOMPLETE			"/apps/gnome-packagekit/autocomplete"
 #define GPK_CONF_SESSION_STARTUP_TIMEOUT	"/apps/gnome-packagekit/session_startup_timeout"
+#define GPK_CONF_FORCE_GET_UPDATES_LOGIN	"/apps/gnome-packagekit/force_get_updates_login"
 #define GPK_CONF_FREQUENCY_GET_UPDATES		"/apps/gnome-packagekit/frequency_get_updates"
 #define GPK_CONF_FREQUENCY_GET_UPGRADES		"/apps/gnome-packagekit/frequency_get_upgrades"
 #define GPK_CONF_FREQUENCY_REFRESH_CACHE	"/apps/gnome-packagekit/frequency_refresh_cache"

Modified: trunk/src/gpk-log.c
==============================================================================
--- trunk/src/gpk-log.c	(original)
+++ trunk/src/gpk-log.c	Fri Oct 10 17:39:57 2008
@@ -124,6 +124,7 @@
 	guint i;
 	guint size;
 	PkInfoEnum info_local;
+	const gchar *info_text;
 	GString *string;
 	gchar *text;
 	gchar *whole;
@@ -132,6 +133,9 @@
 
 	string = g_string_new ("");
 	size = g_strv_length (array);
+	info_text = gpk_info_enum_to_localised_past (info);
+
+	/* find all of this type */
 	for (i=0; i<size; i++) {
 		sections = g_strsplit (array[i], "\t", 0);
 		info_local = pk_info_enum_from_text (sections[0]);
@@ -156,7 +160,7 @@
 
 	/* add a nice header, and make text italic */
 	text = g_string_free (string, FALSE);
-	whole = g_strdup_printf ("%s: %s\n", gpk_info_enum_to_localised_past (info), text);
+	whole = g_strdup_printf ("<b>%s</b>: %s\n", info_text, text);
 	g_free (text);
 	return whole;
 }
@@ -315,36 +319,40 @@
 	GtkCellRenderer *renderer;
 	GtkTreeViewColumn *column;
 
-	/* column for date */
+	/* --- column for date --- */
 	renderer = gtk_cell_renderer_text_new ();
+	g_object_set (renderer, "yalign", 0.0, NULL);
 	column = gtk_tree_view_column_new_with_attributes (_("Date"), renderer,
 							   "markup", GPK_LOG_COLUMN_DATE, NULL);
 	gtk_tree_view_append_column (treeview, column);
-	gtk_tree_view_column_set_expand (column, TRUE);
+	gtk_tree_view_column_set_expand (column, FALSE);
+
+	/* --- column for image and text --- */
+	column = gtk_tree_view_column_new ();
+	gtk_tree_view_column_set_title (column, _("Action"));
 
 	/* image */
 	renderer = gtk_cell_renderer_pixbuf_new ();
-        g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL);
-	column = gtk_tree_view_column_new_with_attributes ("", renderer,
-							   "icon-name", GPK_LOG_COLUMN_ICON, NULL);
-	gtk_tree_view_append_column (treeview, column);
+	g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL);
+	g_object_set (renderer, "yalign", 0.0, NULL);
+	gtk_tree_view_column_pack_start (column, renderer, FALSE);
+	gtk_tree_view_column_add_attribute (column, renderer, "icon-name", GPK_LOG_COLUMN_ICON);
 
-	/* column for role */
 	renderer = gtk_cell_renderer_text_new ();
-	column = gtk_tree_view_column_new_with_attributes (_("Role"), renderer,
-							   "markup", GPK_LOG_COLUMN_ROLE, NULL);
-	gtk_tree_view_append_column (treeview, column);
-	gtk_tree_view_column_set_expand (column, TRUE);
+	g_object_set (renderer, "yalign", 0.0, NULL);
 
-	/* column for duration */
-	renderer = gtk_cell_renderer_text_new ();
-	column = gtk_tree_view_column_new_with_attributes (_("Duration"), renderer,
-							   "markup", GPK_LOG_COLUMN_DURATION, NULL);
-	gtk_tree_view_append_column (treeview, column);
-	gtk_tree_view_column_set_expand (column, TRUE);
+	/* text */
+	gtk_tree_view_column_pack_start (column, renderer, TRUE);
+	gtk_tree_view_column_add_attribute (column, renderer, "markup", GPK_LOG_COLUMN_ROLE);
+	gtk_tree_view_column_set_expand (column, FALSE);
+
+	gtk_tree_view_append_column (treeview, GTK_TREE_VIEW_COLUMN(column));
 
-	/* column for details */
+	/* --- column for details --- */
 	renderer = gtk_cell_renderer_text_new ();
+	g_object_set (renderer, "yalign", 0.0, NULL);
+	g_object_set(renderer, "wrap-mode", PANGO_WRAP_WORD, NULL);
+	g_object_set(renderer, "wrap-width", 400, NULL);
 	column = gtk_tree_view_column_new_with_attributes (_("Details"), renderer,
 							   "markup", GPK_LOG_COLUMN_DETAILS, NULL);
 	gtk_tree_view_append_column (treeview, column);



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