[nautilus-actions] Review NactIFoldersTab page



commit d89c45d87ab14d2f4ebf03599dfc16c117b503e2
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Jun 16 21:09:08 2010 +0200

    Review NactIFoldersTab page

 ChangeLog                    |    2 ++
 src/nact/nact-iaction-tab.c  |    5 -----
 src/nact/nact-ifolders-tab.c |   40 +++++++++++++++-------------------------
 3 files changed, 17 insertions(+), 30 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8532bd5..eaf36b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2010-06-16 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-ifolders-tab.c: Review NactIFoldersTab page.
+
 	* src/nact/nact-ibasenames-tab.c: Review NactIBasenamesTab page.
 
 	* src/nact/nact-match-list.c:
diff --git a/src/nact/nact-iaction-tab.c b/src/nact/nact-iaction-tab.c
index b4af879..168f787 100644
--- a/src/nact/nact-iaction-tab.c
+++ b/src/nact/nact-iaction-tab.c
@@ -451,7 +451,6 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 			toggle = GTK_TOGGLE_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ToolbarSameLabelButton" ));
 			same_label = item && NA_IS_OBJECT_ACTION( item ) ? na_object_is_toolbar_same_label( NA_OBJECT_ACTION( item )) : FALSE;
 			gtk_toggle_button_set_active( toggle, same_label );
-			toolbar_same_label_set_sensitive( instance, item );
 			nact_gtk_utils_set_editable( GTK_OBJECT( toggle ), editable );
 
 			label_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionToolbarLabelEntry" );
@@ -459,7 +458,6 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 			label = label ? label : g_strdup( "" );
 			gtk_entry_set_text( GTK_ENTRY( label_widget ), label );
 			g_free( label );
-			toolbar_label_set_sensitive( instance, item );
 			nact_gtk_utils_set_editable( GTK_OBJECT( label_widget ), editable );
 
 			tooltip_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionTooltipEntry" );
@@ -467,7 +465,6 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 			tooltip = tooltip ? tooltip : g_strdup( "" );
 			gtk_entry_set_text( GTK_ENTRY( tooltip_widget ), tooltip );
 			g_free( tooltip );
-			gtk_widget_set_sensitive( tooltip_widget, item != NULL );
 			nact_gtk_utils_set_editable( GTK_OBJECT( tooltip_widget ), editable );
 
 			icon_widget = base_window_get_widget( BASE_WINDOW( instance ), "ActionIconComboBoxEntry" );
@@ -475,11 +472,9 @@ on_tab_updatable_selection_changed( NactIActionTab *instance, gint count_selecte
 			icon = icon ? icon : g_strdup( "" );
 			gtk_entry_set_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN( icon_widget ))), icon );
 			g_free( icon );
-			gtk_widget_set_sensitive( icon_widget, item != NULL );
 			nact_gtk_utils_set_editable( GTK_OBJECT( icon_widget ), editable );
 
 			icon_button = GTK_BUTTON( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconBrowseButton" ));
-			gtk_widget_set_sensitive( GTK_WIDGET( icon_button ), item != NULL );
 			nact_gtk_utils_set_editable( GTK_OBJECT( icon_button ), editable );
 
 			st_on_selection_change = FALSE;
diff --git a/src/nact/nact-ifolders-tab.c b/src/nact/nact-ifolders-tab.c
index e3432e3..b823b08 100644
--- a/src/nact/nact-ifolders-tab.c
+++ b/src/nact/nact-ifolders-tab.c
@@ -67,9 +67,9 @@ static GType   register_type( void );
 static void    interface_base_init( NactIFoldersTabInterface *klass );
 static void    interface_base_finalize( NactIFoldersTabInterface *klass );
 
-static void    on_browse_folder_clicked( GtkButton *button, BaseWindow *window );
 static void    on_tab_updatable_selection_changed( NactIFoldersTab *instance, gint count_selected );
 
+static void    on_browse_folder_clicked( GtkButton *button, BaseWindow *window );
 static GSList *get_folders( void *context );
 static void    set_folders( void *context, GSList *filters );
 
@@ -229,6 +229,20 @@ nact_ifolders_tab_dispose( NactIFoldersTab *instance )
 }
 
 static void
+on_tab_updatable_selection_changed( NactIFoldersTab *instance, gint count_selected )
+{
+	NAIContext *context;
+	gboolean editable;
+	GtkWidget *button;
+
+	nact_match_list_on_selection_changed( BASE_WINDOW( instance ), ITAB_NAME, count_selected );
+
+	context = nact_main_tab_get_context( NACT_MAIN_WINDOW( instance ), &editable );
+	button = base_window_get_widget( BASE_WINDOW( instance ), "FolderBrowseButton" );
+	nact_gtk_utils_set_editable( GTK_OBJECT( button ), editable );
+}
+
+static void
 on_browse_folder_clicked( GtkButton *button, BaseWindow *window )
 {
 #if 0
@@ -300,30 +314,6 @@ on_browse_folder_clicked( GtkButton *button, BaseWindow *window )
 	gtk_widget_destroy( dialog );
 }
 
-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_SELECTED_ITEM, &item,
-			TAB_UPDATABLE_PROP_SELECTED_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 );
-}
-
 static GSList *
 get_folders( void *context )
 {



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