[nautilus-actions] Only allow browse folders when editable



commit c5a7525bf032f3717e52ffd9dd876afd03df7893
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Jun 9 23:03:11 2010 +0200

    Only allow browse folders when editable

 src/nact/nact-ifolders-tab.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/nact/nact-ifolders-tab.c b/src/nact/nact-ifolders-tab.c
index 9ca5de1..fac0744 100644
--- a/src/nact/nact-ifolders-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -308,6 +308,24 @@ on_browse_folder_clicked( GtkButton *button, BaseWindow *window )
 static void
 on_tab_updatable_selection_changed( NactIFoldersTab *instance, gint count_selected )
 {
+	NAObjectItem *item;
+	NAObjectProfile *profile;
+	gboolean editable;
+	NAIContext *context;
+	GtkWidget *button;
+
+	g_object_get(
+			G_OBJECT( instance ),
+			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( BASE_WINDOW( instance ), "FolderBrowseButton" );
+	gtk_widget_set_sensitive( button, editable );
+
 	nact_match_list_on_selection_changed( BASE_WINDOW( instance ), ITAB_NAME, count_selected );
 }
 



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