gnome-packagekit r247 - trunk/src



Author: rhughes
Date: Tue Jul 15 17:45:43 2008
New Revision: 247
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=247&view=rev

Log:
from git

Modified:
   trunk/src/gpk-animated-icon.c
   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-firmware.c
   trunk/src/gpk-interface.h
   trunk/src/gpk-smart-icon.c
   trunk/src/gpk-watch.c

Modified: trunk/src/gpk-animated-icon.c
==============================================================================
--- trunk/src/gpk-animated-icon.c	(original)
+++ trunk/src/gpk-animated-icon.c	Tue Jul 15 17:45:43 2008
@@ -123,6 +123,9 @@
 static gboolean
 gpk_animated_icon_update (GpkAnimatedIcon *icon)
 {
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	/* have we loaded a file */
 	if (icon->frames == NULL) {
 		pk_warning ("no frames to process");
@@ -191,11 +194,11 @@
 }
 
 /**
- * gpk_image_finalize:
- * @object: The object to finalize
+ * gpk_animated_icon_destroy:
+ * @object: The object to destroy
  **/
 static void
-gpk_image_finalize (GObject *object)
+gpk_animated_icon_destroy (GtkObject *object)
 {
 	GpkAnimatedIcon *icon;
 	icon = GPK_ANIMATED_ICON (object);
@@ -207,15 +210,15 @@
 	g_free (icon->filename);
 	gpk_animated_icon_free_pixbufs (icon);
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+	GTK_OBJECT_CLASS (parent_class)->destroy (object);
 }
 
 static void
 gpk_animated_icon_class_init (GpkAnimatedIconClass *class)
 {
 	GtkImageClass *image_class;
-	GObjectClass *object_class = G_OBJECT_CLASS (class);
-	object_class->finalize = gpk_image_finalize;
+	GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+	object_class->destroy = gpk_animated_icon_destroy;
 
 	parent_class = g_type_class_peek_parent (class);
 	image_class = GTK_IMAGE_CLASS (class);

Modified: trunk/src/gpk-auto-refresh.c
==============================================================================
--- trunk/src/gpk-auto-refresh.c	(original)
+++ trunk/src/gpk-auto-refresh.c	Tue Jul 15 17:45:43 2008
@@ -380,6 +380,9 @@
 
 	g_return_val_if_fail (GPK_IS_AUTO_REFRESH (arefresh), FALSE);
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	/* triggered once an hour */
 	gpk_auto_refresh_change_state (arefresh);
 
@@ -397,6 +400,9 @@
 
 	g_return_val_if_fail (GPK_IS_AUTO_REFRESH (arefresh), FALSE);
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	/* we have waited enough */
 	if (arefresh->priv->session_delay == FALSE) {
 		pk_debug ("setting session delay TRUE");

Modified: trunk/src/gpk-check-update.c
==============================================================================
--- trunk/src/gpk-check-update.c	(original)
+++ trunk/src/gpk-check-update.c	Tue Jul 15 17:45:43 2008
@@ -286,6 +286,10 @@
 gpk_check_update_get_updates_post_update_cb (GpkCheckUpdate *cupdate)
 {
 	g_return_val_if_fail (GPK_IS_CHECK_UPDATE (cupdate), FALSE);
+
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	gpk_check_update_query_updates (cupdate);
 	return FALSE;
 }

Modified: trunk/src/gpk-client-run.c
==============================================================================
--- trunk/src/gpk-client-run.c	(original)
+++ trunk/src/gpk-client-run.c	Tue Jul 15 17:45:43 2008
@@ -328,12 +328,6 @@
 		goto out;
 	}
 
-	/* just one, so shortcut the UI */
-	if (len == 1) {
-		full_path = g_strdup (last_tryexec);
-		goto out;
-	}
-
 	/* show window */
 	widget = glade_xml_get_widget (glade_xml, "window_simple");
 	gtk_widget_show (widget);

Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c	(original)
+++ trunk/src/gpk-client.c	Tue Jul 15 17:45:43 2008
@@ -62,6 +62,7 @@
 static void     gpk_client_class_init	(GpkClientClass *klass);
 static void     gpk_client_init		(GpkClient      *gclient);
 static void     gpk_client_finalize	(GObject	*object);
+static void	gpk_client_done		(GpkClient	*gclient);
 
 #define GPK_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPK_TYPE_CLIENT, GpkClientPrivate))
 #define PK_STOCK_WINDOW_ICON		"system-software-installer"
@@ -224,6 +225,7 @@
 	/* go! */
 	widget = glade_xml_get_widget (gclient->priv->glade_xml, "window_updates");
 	gtk_widget_hide (widget);
+	gpk_client_done (gclient);
 	g_signal_emit (gclient, signals [GPK_CLIENT_QUIT], 0);
 }
 
@@ -259,6 +261,9 @@
 	GtkWidget *widget;
 	GpkClient *gclient = (GpkClient *) data;
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	/* hide window manually to get it out of the way */
 	widget = glade_xml_get_widget (gclient->priv->glade_xml, "window_updates");
 	gtk_widget_hide (widget);
@@ -444,13 +449,16 @@
 gpk_client_finished_cb (PkClient *client, PkExitEnum exit, guint runtime, GpkClient *gclient)
 {
 	GtkWidget *widget;
-	PkRoleEnum role;
+	PkRoleEnum role = PK_ROLE_ENUM_UNKNOWN;
 
 	g_return_if_fail (GPK_IS_CLIENT (gclient));
 
 	/* save this so we can return a proper error value */
 	gclient->priv->exit = exit;
 
+	/* stop timers, animations and that sort of thing */
+	gpk_client_done (gclient);
+
 	pk_client_get_role (client, &role, NULL, NULL);
 	/* do nothing */
 	if (role == PK_ROLE_ENUM_GET_UPDATES) {
@@ -494,6 +502,9 @@
 
 	g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	widget = glade_xml_get_widget (gclient->priv->glade_xml, "progressbar_percent");
 	gtk_progress_bar_pulse (GTK_PROGRESS_BAR (widget));
 	return TRUE;
@@ -895,7 +906,11 @@
 static void
 gpk_client_done (GpkClient *gclient)
 {
+	GtkWidget *widget;
+
 	/* we're done */
+	widget = glade_xml_get_widget (gclient->priv->glade_xml, "image_status");
+	gpk_animated_icon_enable_animation (GPK_ANIMATED_ICON (widget), FALSE);
 	if (gclient->priv->pulse_timer_id != 0) {
 		g_source_remove (gclient->priv->pulse_timer_id);
 		gclient->priv->pulse_timer_id = 0;
@@ -1072,9 +1087,8 @@
 	/* fail the transaction and set the correct error */
 	ret = gpk_client_set_error_from_exit_enum (gclient->priv->exit, error);
 
-	/* we're done */
-	gpk_client_done (gclient);
 out:
+	gpk_client_done (gclient);
 	return ret;
 }
 
@@ -1162,9 +1176,8 @@
 	/* fail the transaction and set the correct error */
 	ret = gpk_client_set_error_from_exit_enum (gclient->priv->exit, error);
 
-	/* we're done */
-	gpk_client_done (gclient);
 out:
+	gpk_client_done (gclient);
 	return ret;
 }
 
@@ -1260,9 +1273,8 @@
 	/* fail the transaction and set the correct error */
 	ret = gpk_client_set_error_from_exit_enum (gclient->priv->exit, error);
 
-	/* we're done */
-	gpk_client_done (gclient);
 out:
+	gpk_client_done (gclient);
 	return ret;
 }
 
@@ -2198,6 +2210,7 @@
 	gboolean ret;
 	gboolean allow_cancel;
 	gchar *text;
+	gchar *package_id = NULL;
 	guint percentage;
 	guint subpercentage;
 	guint elapsed;
@@ -2247,18 +2260,19 @@
 	}
 
 	/* do the best we can */
-	ret = pk_client_get_package (gclient->priv->client_action, &text, NULL);
-
-	PkPackageId *id;
-	PkPackageObj *obj;
-
-	id = pk_package_id_new_from_string (text);
-	obj = pk_package_obj_new (PK_INFO_ENUM_UNKNOWN, id, NULL);
-	pk_package_id_free (id);
+	ret = pk_client_get_package (gclient->priv->client_action, &package_id, NULL);
 	if (ret) {
-		gpk_client_package_cb (gclient->priv->client_action, obj, gclient);
+		PkPackageId *id;
+		PkPackageObj *obj;
+
+		id = pk_package_id_new_from_string (package_id);
+		if (id != NULL) {
+			obj = pk_package_obj_new (PK_INFO_ENUM_UNKNOWN, id, NULL);
+			gpk_client_package_cb (gclient->priv->client_action, obj, gclient);
+			pk_package_obj_free (obj);
+		}
+		pk_package_id_free (id);
 	}
-	pk_package_obj_free (obj);
 
 	/* get the role */
 	ret = pk_client_get_role (gclient->priv->client_action, &role, NULL, &error);
@@ -2281,6 +2295,7 @@
 	gpk_client_set_page (gclient, GPK_CLIENT_PAGE_PROGRESS);
 
 	gpk_client_main_wait (gclient);
+	gpk_client_done (gclient);
 
 	return TRUE;
 }

Modified: trunk/src/gpk-firmware.c
==============================================================================
--- trunk/src/gpk-firmware.c	(original)
+++ trunk/src/gpk-firmware.c	Tue Jul 15 17:45:43 2008
@@ -105,6 +105,9 @@
 	GpkFirmware *firmware = GPK_FIRMWARE (data);
 	NotifyNotification *notification;
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	message = _("Additional firmware is required to make hardware in this computer function correctly.");
 	notification = notify_notification_new (_("Additional firmware required"), message, "help-browser", NULL);
 	notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);

Modified: trunk/src/gpk-interface.h
==============================================================================
--- trunk/src/gpk-interface.h	(original)
+++ trunk/src/gpk-interface.h	Tue Jul 15 17:45:43 2008
@@ -53,7 +53,7 @@
 #endif /* !G_ENABLE_DEBUG */
 
 
-/* NONE:STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.YRR1DU:1) */
+/* NONE:STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.7UDDEU:1) */
 extern void dbus_glib_marshal_gpk_dbus_VOID__STRING_POINTER (GClosure     *closure,
                                                              GValue       *return_value,
                                                              guint         n_param_values,

Modified: trunk/src/gpk-smart-icon.c
==============================================================================
--- trunk/src/gpk-smart-icon.c	(original)
+++ trunk/src/gpk-smart-icon.c	Tue Jul 15 17:45:43 2008
@@ -112,6 +112,9 @@
 
 	g_return_val_if_fail (GPK_IS_SMART_ICON (sicon), FALSE);
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	/* have we hidden the icon already? */
 	if (sicon->priv->current == NULL || sicon->priv->new == NULL) {
 		pk_debug ("not pulsing as icon cleared");
@@ -174,6 +177,9 @@
 {
 	GpkSmartIcon *sicon = (GpkSmartIcon *) data;
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	/* no point setting the same */
 	if (sicon->priv->new != NULL &&
 	    sicon->priv->current != NULL &&

Modified: trunk/src/gpk-watch.c
==============================================================================
--- trunk/src/gpk-watch.c	(original)
+++ trunk/src/gpk-watch.c	Tue Jul 15 17:45:43 2008
@@ -284,7 +284,7 @@
 	PkRoleEnum role;
 	PkRestartEnum restart;
 	GError *error = NULL;
-	gchar *package_id;
+	gchar *package_id = NULL;
 	gchar *message = NULL;
 	gchar *package;
 	const gchar *restart_message;
@@ -297,7 +297,7 @@
 	ret = pk_client_get_role (client, &role, &package_id, NULL);
 	if (!ret) {
 		pk_warning ("cannot get role");
-		return;
+		goto out;
 	}
 	pk_debug ("role=%s, package=%s", pk_role_enum_to_text (role), package_id);
 
@@ -318,20 +318,20 @@
 	/* is it worth showing a UI? */
 	if (runtime < 3000) {
 		pk_debug ("no notification, too quick");
-		return;
+		goto out;
 	}
 
 	/* is it worth showing a UI? */
 	if (exit != PK_EXIT_ENUM_SUCCESS) {
 		pk_debug ("not notifying, as didn't complete okay");
-		return;
+		goto out;
 	}
 
 	/* are we accepting notifications */
 	value = gconf_client_get_bool (watch->priv->gconf_client, GPK_CONF_NOTIFY_COMPLETED, NULL);
 	if (!value) {
 		pk_debug ("not showing notification as prevented in gconf");
-		return;
+		goto out;
 	}
 
 	/* is caller able to handle the messages itself? */
@@ -339,11 +339,11 @@
 	if (!ret) {
 		pk_warning ("could not get caller active status: %s", error->message);
 		g_error_free (error);
-		return;
+		goto out;
 	}
 	if (value) {
 		pk_debug ("not showing notification as caller is still present");
-		return;
+		goto out;
 	}
 
 	if (role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
@@ -360,7 +360,7 @@
 
 	/* nothing of interest */
 	if (message == NULL) {
-		return;
+		goto out;
 	}
 
 	/* do the bubble */
@@ -375,6 +375,7 @@
 		g_error_free (error);
 	}
 
+out:
 	g_free (message);
 	g_free (package_id);
 }
@@ -1003,6 +1004,9 @@
 
 	g_return_val_if_fail (GPK_IS_WATCH (watch), FALSE);
 
+	/* debug so we can catch polling */
+	pk_debug ("polling check");
+
 	proxy_http = gpk_watch_get_proxy_http (watch);
 	proxy_ftp = gpk_watch_get_proxy_ftp (watch);
 



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