[gnome-packagekit] make apply button insensitive while applying



commit cfdd7d15e0952d7b532a5e1af3296968b1cb1d20
Author: Zhang Qiang <qiang z zhang intel com>
Date:   Sun Sep 26 15:45:35 2010 +0800

    make apply button insensitive while applying
    
    gpk applicaiton: make 'apply' button insensitive while user click the
    apply button, which would sensitive while the transaction return.

 src/gpk-application.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/gpk-application.c b/src/gpk-application.c
index e0bd6f2..6b3f9af 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -698,6 +698,10 @@ 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);
+
 			/* we've not yet shown, so don't bother */
 			if (application->priv->status_id > 0) {
 				g_source_remove (application->priv->status_id);
@@ -2168,6 +2172,10 @@ 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);
+
 	} else if (application->priv->action == GPK_ACTION_REMOVE) {
 
 		autoremove = g_settings_get_boolean (application->priv->settings, GPK_SETTINGS_ENABLE_AUTOREMOVE);
@@ -2180,6 +2188,10 @@ 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);
 	}
 	g_strfreev (package_ids);
 	return;



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