[nautilus-actions] Reset Save item unsensitive after reload



commit 6429c20a5ac8bc5d47a9034d8dafa9e53a72a20f
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Oct 25 17:49:31 2009 +0100

    Reset Save item unsensitive after reload
    
    The flag level_zero_order_changed is now brought up as a message user data.
    The modified_items list is reset when refilling the Actions list.

 ChangeLog                     |   10 ++++++++++
 src/nact/nact-iactions-list.c |   10 ++++++++++
 src/nact/nact-main-menubar.c  |    2 +-
 src/nact/nact-tree-model.c    |    2 +-
 4 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e1fd54b..e2bbf23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,16 @@
 	* src/runtime/na-iabout.c (na_iabout_display):
 	Do not mark authors names and emails for translating (#599520).
 
+	* src/nact/nact-iactions-list.c
+	(nact_iactions_list_dispose): free list of modified items.
+	(nact_iactions_list_fill): reset level_zero_order_changed flag.
+
+	* src/nact/nact-main-menubar.c (on_level_zero_order_changed):
+	The message now brings up the flag to be set.
+
+	* src/nact/nact-tree-model.c (drop_inside):
+	Set the level_zero_order_changed flag to TRUE.
+
 	* src/nact/nact-preferences-editor.c
 	(on_base_runtime_init_dialog, save_preferences):
 	Let the user edit its preferred export format.
diff --git a/src/nact/nact-iactions-list.c b/src/nact/nact-iactions-list.c
index 6bba5e8..b7fdbfc 100644
--- a/src/nact/nact-iactions-list.c
+++ b/src/nact/nact-iactions-list.c
@@ -635,6 +635,7 @@ nact_iactions_list_dispose( NactIActionsList *instance )
 		model = NACT_TREE_MODEL( gtk_tree_view_get_model( treeview ));
 		ialid = get_instance_data( instance );
 		ialid->selection_changed_send_allowed = FALSE;
+		g_list_free( ialid->modified_items );
 
 		nact_tree_model_dispose( model );
 
@@ -840,11 +841,20 @@ nact_iactions_list_fill( NactIActionsList *instance, GList *items )
 		only_actions = have_only_actions( instance, ialid );
 
 		ialid->selection_changed_send_allowed = FALSE;
+
 		nact_tree_model_fill( model, items, only_actions );
 
+		g_list_free( ialid->modified_items );
+		ialid->modified_items = NULL;
 		ialid->selection_changed_send_allowed = TRUE;
+
 		select_first_row( instance );
 
+		g_signal_emit_by_name(
+				instance,
+				MAIN_WINDOW_SIGNAL_LEVEL_ZERO_ORDER_CHANGED,
+				GINT_TO_POINTER( FALSE ));
+
 		ialid->menus = 0;
 		ialid->actions = 0;
 		ialid->profiles = 0;
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index f141a24..8b2afc4 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -546,7 +546,7 @@ on_level_zero_order_changed( NactMainWindow *window, gpointer user_data )
 	g_return_if_fail( NACT_IS_MAIN_WINDOW( window ));
 
 	mis = ( MenubarIndicatorsStruct * ) g_object_get_data( G_OBJECT( window ), MENUBAR_PROP_INDICATORS );
-	mis->level_zero_order_changed = TRUE;
+	mis->level_zero_order_changed = GPOINTER_TO_INT( user_data );
 	g_signal_emit_by_name( window, MAIN_WINDOW_SIGNAL_UPDATE_ACTION_SENSITIVITIES, NULL );
 }
 
diff --git a/src/nact/nact-tree-model.c b/src/nact/nact-tree-model.c
index 34db836..ca0e5a6 100644
--- a/src/nact/nact-tree-model.c
+++ b/src/nact/nact-tree-model.c
@@ -1510,7 +1510,7 @@ drop_inside( NactTreeModel *model, GtkTreePath *dest, GtkSelectionData  *selecti
 		nact_iactions_list_insert_at_path( NACT_IACTIONS_LIST( main_window ), object_list, new_dest );
 
 		if( !copy_data && gtk_tree_path_get_depth( new_dest ) == 1 ){
-			g_signal_emit_by_name( main_window, MAIN_WINDOW_SIGNAL_LEVEL_ZERO_ORDER_CHANGED, NULL );
+			g_signal_emit_by_name( main_window, MAIN_WINDOW_SIGNAL_LEVEL_ZERO_ORDER_CHANGED, GINT_TO_POINTER( TRUE ));
 		}
 
 		g_list_foreach( object_list, ( GFunc ) na_object_object_unref, NULL );



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