[packagekit] [PATCH 2/4] make apply button insensitive while applying

Zhang Qiang qiang.z.zhang at intel.com
Sat Sep 25 20:03:52 PDT 2010


gpk applicaiton: make 'apply' button insensitive while user click the
apply button, which would sensitive while the transaction return.
---
 src/gpk-application.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/gpk-application.c b/src/gpk-application.c
index 40207f9..0c32307 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -698,6 +698,14 @@ gpk_application_progress_cb (PkProgress *progress, PkProgressType type, GpkAppli
 			widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "treeview_packages"));
 			gtk_widget_set_sensitive (widget, TRUE);
 
+			/* make apply button sensitive */
+			widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "button_apply"));
+			gtk_widget_set_sensitive (widget, TRUE);
+
+			/* make apply button sensitive */
+			widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "button_apply"));
+			gtk_widget_set_sensitive (widget, TRUE);
+
 			/* we've not yet shown, so don't bother */
 			if (application->priv->status_id > 0) {
 				g_source_remove (application->priv->status_id);
@@ -2148,6 +2156,14 @@ gpk_application_button_apply_cb (GtkWidget *widget, GpkApplication *application)
 		widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "treeview_packages"));
 		gtk_widget_set_sensitive (widget, FALSE);
 
+		/* make apply button insensitive */
+		widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "button_apply"));
+		gtk_widget_set_sensitive (widget, FALSE);
+
+		/* make apply button insensitive */
+		widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "button_apply"));
+		gtk_widget_set_sensitive (widget, FALSE);
+
 	} else if (application->priv->action == GPK_ACTION_REMOVE) {
 
 		autoremove = g_settings_get_boolean (application->priv->settings, GPK_SETTINGS_ENABLE_AUTOREMOVE);
@@ -2160,6 +2176,14 @@ gpk_application_button_apply_cb (GtkWidget *widget, GpkApplication *application)
 		/* make package array insensitive */
 		widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "treeview_packages"));
 		gtk_widget_set_sensitive (widget, FALSE);
+
+		/* make apply button insensitive */
+		widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "button_apply"));
+		gtk_widget_set_sensitive (widget, FALSE);
+
+		/* make apply button insensitive */
+		widget = GTK_WIDGET (gtk_builder_get_object (application->priv->builder, "button_apply"));
+		gtk_widget_set_sensitive (widget, FALSE);
 	}
 	g_strfreev (package_ids);
 	return;
-- 
1.7.2.2




More information about the PackageKit mailing list