gnome-packagekit r396 - in trunk: data src



Author: rhughes
Date: Mon Oct 27 11:12:56 2008
New Revision: 396
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=396&view=rev

Log:
from git

Modified:
   trunk/data/gnome-packagekit.schemas.in
   trunk/data/gpk-log.glade
   trunk/src/gpk-auto-refresh.c
   trunk/src/gpk-check-update.c
   trunk/src/gpk-client-run.c
   trunk/src/gpk-client.c
   trunk/src/gpk-common.c
   trunk/src/gpk-update-viewer.c

Modified: trunk/data/gnome-packagekit.schemas.in
==============================================================================
--- trunk/data/gnome-packagekit.schemas.in	(original)
+++ trunk/data/gnome-packagekit.schemas.in	Mon Oct 27 11:12:56 2008
@@ -210,7 +210,7 @@
       <applyto>/apps/gnome-packagekit/session_startup_timeout</applyto>
       <owner>gnome-packagekit</owner>
       <type>int</type>
-      <default>60</default>
+      <default>300</default>
       <locale name="C">
         <short>The number of seconds at session startup to wait before we check for updates</short>
         <long>The number of seconds at session startup to wait before we check for updates</long>

Modified: trunk/data/gpk-log.glade
==============================================================================
--- trunk/data/gpk-log.glade	(original)
+++ trunk/data/gpk-log.glade	Mon Oct 27 11:12:56 2008
@@ -12,7 +12,7 @@
         <property name="border_width">10</property>
         <property name="spacing">6</property>
         <child>
-          <widget class="GtkHBox" id="hbox1">
+          <widget class="GtkHBox" id="hbox_filter">
             <property name="visible">True</property>
             <property name="spacing">6</property>
             <child>
@@ -50,7 +50,6 @@
               <widget class="GtkTreeView" id="treeview_simple">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="headers_clickable">True</property>
                 <property name="rules_hint">True</property>
                 <property name="show_expanders">False</property>
               </widget>

Modified: trunk/src/gpk-auto-refresh.c
==============================================================================
--- trunk/src/gpk-auto-refresh.c	(original)
+++ trunk/src/gpk-auto-refresh.c	Mon Oct 27 11:12:56 2008
@@ -74,8 +74,8 @@
 	gboolean		 session_idle;
 	gboolean		 on_battery;
 	gboolean		 network_active;
-	gboolean		 session_delay;
 	gboolean		 force_get_updates_login;
+	guint			 timeout_id;
 	EggDbusMonitor		*monitor_gs;
 	EggDbusMonitor		*monitor_gpm;
 	GConfClient		*gconf_client;
@@ -282,7 +282,7 @@
 	/* get this each time, as it may have changed behind out back */
 	thresh = gpk_auto_refresh_convert_frequency_text (arefresh, GPK_CONF_FREQUENCY_GET_UPDATES);
 	if (thresh == 0) {
-		egg_debug ("not when policy is to never refresh");
+		egg_debug ("not when policy is set to never get updates");
 		return FALSE;
 	}
 
@@ -319,7 +319,7 @@
 	/* get this each time, as it may have changed behind out back */
 	thresh = gpk_auto_refresh_convert_frequency_text (arefresh, GPK_CONF_FREQUENCY_GET_UPGRADES);
 	if (thresh == 0) {
-		egg_debug ("not when policy is to never refresh");
+		egg_debug ("not when policy is set to never check for upgrades");
 		return FALSE;
 	}
 
@@ -342,21 +342,29 @@
 }
 
 /**
+ * gpk_auto_refresh_change_state_cb:
+ **/
+static gboolean
+gpk_auto_refresh_change_state_cb (GpkAutoRefresh *arefresh)
+{
+	/* check all actions */
+	gpk_auto_refresh_maybe_refresh_cache (arefresh);
+	gpk_auto_refresh_maybe_get_updates (arefresh);
+	gpk_auto_refresh_maybe_get_upgrades (arefresh);
+	return FALSE;
+}
+
+/**
  * gpk_auto_refresh_change_state:
  **/
 static gboolean
 gpk_auto_refresh_change_state (GpkAutoRefresh *arefresh)
 {
 	gboolean force;
+	guint value;
 
 	g_return_val_if_fail (GPK_IS_AUTO_REFRESH (arefresh), FALSE);
 
-	/* we shouldn't do this early in the session startup */
-	if (!arefresh->priv->session_delay) {
-		egg_debug ("not when this early in the session");
-		return FALSE;
-	}
-
 	/* no point continuing if we have no network */
 	if (!arefresh->priv->network_active) {
 		egg_debug ("not when no network");
@@ -375,10 +383,12 @@
 		}
 	}
 
-	/* try to do both */
-	gpk_auto_refresh_maybe_refresh_cache (arefresh);
-	gpk_auto_refresh_maybe_get_updates (arefresh);
-	gpk_auto_refresh_maybe_get_upgrades (arefresh);
+	/* wait a little time for things to settle down */
+	if (arefresh->priv->timeout_id != 0)
+		g_source_remove (arefresh->priv->timeout_id);
+	value = gconf_client_get_int (arefresh->priv->gconf_client, GPK_CONF_SESSION_STARTUP_TIMEOUT, NULL);
+	egg_debug ("defering action for %i seconds", value);
+	arefresh->priv->timeout_id = g_timeout_add_seconds (value, (GSourceFunc) gpk_auto_refresh_change_state_cb, arefresh);
 
 	return TRUE;
 }
@@ -412,7 +422,8 @@
 
 	egg_debug ("setting is_idle %i", is_idle);
 	arefresh->priv->session_idle = is_idle;
-	gpk_auto_refresh_change_state (arefresh);
+	if (arefresh->priv->session_idle)
+		gpk_auto_refresh_change_state (arefresh);
 }
 
 /**
@@ -425,7 +436,8 @@
 
 	egg_debug ("setting on_battery %i", on_battery);
 	arefresh->priv->on_battery = on_battery;
-	gpk_auto_refresh_change_state (arefresh);
+	if (!arefresh->priv->on_battery)
+		gpk_auto_refresh_change_state (arefresh);
 }
 
 /**
@@ -448,7 +460,8 @@
 
 	arefresh->priv->network_active = (state == PK_NETWORK_ENUM_ONLINE);
 	egg_debug ("setting online %i", arefresh->priv->network_active);
-	gpk_auto_refresh_change_state (arefresh);
+	if (arefresh->priv->network_active)
+		gpk_auto_refresh_change_state (arefresh);
 }
 
 /**
@@ -472,32 +485,6 @@
 }
 
 /**
- * gpk_auto_refresh_check_delay_cb:
- **/
-static gboolean
-gpk_auto_refresh_check_delay_cb (gpointer user_data)
-{
-	GpkAutoRefresh *arefresh = GPK_AUTO_REFRESH (user_data);
-
-	g_return_val_if_fail (GPK_IS_AUTO_REFRESH (arefresh), FALSE);
-
-	/* debug so we can catch polling */
-	egg_debug ("polling check");
-
-	/* we have waited enough */
-	if (!arefresh->priv->session_delay) {
-		egg_debug ("setting session delay TRUE");
-		arefresh->priv->session_delay = TRUE;
-	}
-
-	/* if we failed to do the refresh cache at first boot, we'll pick up an event */
-	gpk_auto_refresh_change_state (arefresh);
-
-	/* we don't want to do this timer again as we sent the signal */
-	return FALSE;
-}
-
-/**
  * pk_connection_gpm_changed_cb:
  **/
 static void
@@ -595,7 +582,6 @@
 static void
 gpk_auto_refresh_init (GpkAutoRefresh *arefresh)
 {
-	guint value;
 	GError *error = NULL;
 	PkNetworkEnum state;
 
@@ -603,8 +589,8 @@
 	arefresh->priv->on_battery = FALSE;
 	arefresh->priv->session_idle = FALSE;
 	arefresh->priv->network_active = FALSE;
-	arefresh->priv->session_delay = FALSE;
 	arefresh->priv->force_get_updates_login = FALSE;
+	arefresh->priv->timeout_id = 0;
 
 	arefresh->priv->proxy_gs = NULL;
 	arefresh->priv->proxy_gpm = NULL;
@@ -650,9 +636,8 @@
 	/* we check this in case we miss one of the async signals */
 	g_timeout_add_seconds (GPK_AUTO_REFRESH_PERIODIC_CHECK, gpk_auto_refresh_timeout_cb, arefresh);
 
-	/* wait a little bit for login to quiece, even if everything is okay */
-	value = gconf_client_get_int (arefresh->priv->gconf_client, GPK_CONF_SESSION_STARTUP_TIMEOUT, NULL);
-	g_timeout_add_seconds (value, gpk_auto_refresh_check_delay_cb, arefresh);
+	/* check system state */
+	gpk_auto_refresh_change_state (arefresh);
 }
 
 /**
@@ -669,6 +654,9 @@
 	arefresh = GPK_AUTO_REFRESH (object);
 	g_return_if_fail (arefresh->priv != NULL);
 
+	if (arefresh->priv->timeout_id != 0)
+		g_source_remove (arefresh->priv->timeout_id);
+
 	g_object_unref (arefresh->priv->control);
 	g_object_unref (arefresh->priv->monitor_gs);
 	g_object_unref (arefresh->priv->monitor_gpm);

Modified: trunk/src/gpk-check-update.c
==============================================================================
--- trunk/src/gpk-check-update.c	(original)
+++ trunk/src/gpk-check-update.c	Mon Oct 27 11:12:56 2008
@@ -694,6 +694,13 @@
 		return FALSE;
 	}
 
+	/* sort by name */
+	pk_package_list_sort (list);
+
+	/* filter out the same package with multiple architectures */
+	pk_package_list_set_fuzzy_arch (list, TRUE);
+	pk_obj_list_remove_duplicate (PK_OBJ_LIST(list));
+
 	/* we have updates to process */
 	status_security = g_string_new ("");
 	status_tooltip = g_string_new ("");
@@ -744,9 +751,8 @@
 	gpk_smart_icon_pulse (cupdate->priv->sicon);
 
 	/* make tooltip */
-	if (status_security->len != 0) {
+	if (status_security->len != 0)
 		g_string_set_size (status_security, status_security->len-1);
-	}
 	g_string_append_printf (status_tooltip, ngettext ("There is %d update pending",
 							  "There are %d updates pending", length), length);
 	gtk_status_icon_set_tooltip (GTK_STATUS_ICON (cupdate->priv->sicon), status_tooltip->str);

Modified: trunk/src/gpk-client-run.c
==============================================================================
--- trunk/src/gpk-client-run.c	(original)
+++ trunk/src/gpk-client-run.c	Mon Oct 27 11:12:56 2008
@@ -320,6 +320,10 @@
 	g_signal_connect (widget, "clicked", G_CALLBACK (gpk_client_run_button_action_cb), NULL);
 	gtk_widget_show (widget);
 
+	/* hide the filter box */
+	widget = glade_xml_get_widget (glade_xml, "hbox_filter");
+	gtk_widget_hide (widget);
+
 	/* set icon name */
 	widget = glade_xml_get_widget (glade_xml, "window_simple");
 	gtk_window_set_icon_name (GTK_WINDOW (widget), GPK_ICON_SOFTWARE_INSTALLER);

Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c	(original)
+++ trunk/src/gpk-client.c	Mon Oct 27 11:12:56 2008
@@ -2754,6 +2754,11 @@
 		goto out;
 	}
 
+	/* set title */
+	gpk_client_dialog_set_title (gclient->priv->dialog, _("Update packages"));
+	gpk_client_dialog_set_message (gclient->priv->dialog, "");
+	gpk_client_dialog_set_help_id (gclient->priv->dialog, "dialog-update-packages");
+
 	/* wrap update, but handle all the GPG and EULA stuff */
 	ret = pk_client_update_packages (gclient->priv->client_action, package_ids, &error_local);
 	if (!ret) {
@@ -3172,6 +3177,13 @@
 gpk_client_set_parent (GpkClient *gclient, GtkWindow *window)
 {
 	g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
+
+	/* unparent */
+	if (window == NULL) {
+		gpk_client_dialog_set_parent (gclient->priv->dialog, NULL);
+		return TRUE;
+	}
+
 	gclient->priv->parent_window = GTK_WIDGET (window)->window;
 	egg_debug ("parent_window=%p", gclient->priv->parent_window);
 	gpk_client_dialog_set_parent (gclient->priv->dialog, gclient->priv->parent_window);

Modified: trunk/src/gpk-common.c
==============================================================================
--- trunk/src/gpk-common.c	(original)
+++ trunk/src/gpk-common.c	Mon Oct 27 11:12:56 2008
@@ -53,7 +53,6 @@
 	if (gdk_screen_get_width (screen) < width ||
 	    gdk_screen_get_height (screen) < height) {
 		egg_debug ("using small form factor mode");
-		gtk_window_set_resizable (window, FALSE);
 		gtk_window_maximize (window);
 		return FALSE;
 	}

Modified: trunk/src/gpk-update-viewer.c
==============================================================================
--- trunk/src/gpk-update-viewer.c	(original)
+++ trunk/src/gpk-update-viewer.c	Mon Oct 27 11:12:56 2008
@@ -133,9 +133,13 @@
 	widget = glade_xml_get_widget (glade_xml, "window_updates");
 	if (page == PAGE_LAST) {
 		gtk_widget_hide (widget);
+		gpk_client_set_parent (gclient, NULL);
 		return;
 	}
 
+	/* restore modalness */
+	gpk_client_set_parent (gclient, GTK_WINDOW (widget));
+
 	/* some pages are resizeable */
 	if (page == PAGE_DETAILS)
 		gtk_window_set_resizable (GTK_WINDOW (widget), TRUE);



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