[gnome-packagekit/glib2-merge-candidate] trivial: we have to also check for idle as we might be getting the AllowCancel(false) signal _after_



commit 0451057d906ad6982a496a843f98c9543d49b505
Author: Richard Hughes <richard hughsie com>
Date:   Fri Oct 9 14:36:58 2009 +0100

    trivial: we have to also check for idle as we might be getting the AllowCancel(false) signal _after_ the PkClient has been marked as idle

 src/gpk-update-viewer.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index 6447aae..e58826d 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -901,8 +901,13 @@ gpk_update_viewer_progress_cb (PkProgress *progress, PkProgressType type, GpkUpd
 		gtk_tree_path_free (path);
 
 	} else if (type == PK_PROGRESS_TYPE_ALLOW_CANCEL) {
+		gboolean idle;
 		widget = GTK_WIDGET(gtk_builder_get_object (priv->builder, "button_quit"));
-		gtk_widget_set_sensitive (widget, allow_cancel);
+
+		/* we have to also check for idle as we might be getting the AllowCancel(false)
+		 * signal _after_ the PkClient has been marked as idle */
+		g_object_get (priv->task, "idle", &idle, NULL);
+		gtk_widget_set_sensitive (widget, (allow_cancel || idle));
 	}
 out:
 	g_free (summary);



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