[nautilus-actions] Only allow add scheme when item is editable



commit b896b66920c20b4a4f3c38a3cfd65523f1af3824
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Jun 9 23:04:32 2010 +0200

    Only allow add scheme when item is editable

 src/nact/nact-ischemes-tab.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/nact/nact-ischemes-tab.c b/src/nact/nact-ischemes-tab.c
index 5a005a6..d2366b8 100644
--- a/src/nact/nact-ischemes-tab.c
+++ b/src/nact/nact-ischemes-tab.c
@@ -253,6 +253,24 @@ on_add_from_defaults( GtkButton *button, BaseWindow *window )
 static void
 on_tab_updatable_selection_changed( BaseWindow *window, gint count_selected )
 {
+	NAObjectItem *item;
+	NAObjectProfile *profile;
+	gboolean editable;
+	NAIContext *context;
+	GtkWidget *button;
+
+	g_object_get(
+			G_OBJECT( window ),
+			TAB_UPDATABLE_PROP_EDITED_ACTION, &item,
+			TAB_UPDATABLE_PROP_EDITED_PROFILE, &profile,
+			TAB_UPDATABLE_PROP_EDITABLE, &editable,
+			NULL );
+
+	context = ( profile ? NA_ICONTEXT( profile ) : ( NAIContext * ) item );
+
+	button = base_window_get_widget( window, "AddFromDefaultButton" );
+	gtk_widget_set_sensitive( button, editable );
+
 	nact_match_list_on_selection_changed( window, ITAB_NAME, count_selected );
 }
 



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