[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_2-32-gc5515cf

Pierre Biava nobody at users.sourceforge.net
Mon Jul 25 13:14:20 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  c5515cf75b928179651850f15e4d0306b0dbcb96 (commit)
       via  c00eba9b377fa6c04255b036b37ed601c8bed55d (commit)
       via  8df8498bbe68c7de6f30590eba5a85a720d8f351 (commit)
       via  12cf817af2b7e761b85b1261616ab8c7379210d1 (commit)
      from  25dab4bf1a94aa7db35f2fb6b99ff7dc7b50ba1f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c5515cf75b928179651850f15e4d0306b0dbcb96
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Jul 25 13:13:10 2011 +0200

    Fixed a bug in the navigation in the left panel of Grisbi

commit c00eba9b377fa6c04255b036b37ed601c8bed55d
Author: pbiava <pierre.biava at nerim.net>
Date:   Fri Jul 22 14:03:38 2011 +0200

    Fixed a display bug in the amounts of categories, payees and budgetary lines.

commit 8df8498bbe68c7de6f30590eba5a85a720d8f351
Author: pbiava <pierre.biava at nerim.net>
Date:   Thu Jul 21 06:41:21 2011 +0200

    minor change in fenetre_principale

commit 12cf817af2b7e761b85b1261616ab8c7379210d1
Author: pbiava <pierre.biava at nerim.net>
Date:   Thu Jul 21 06:38:06 2011 +0200

    deletion of compilation warning

-----------------------------------------------------------------------

Changes:
diff --git a/src/bet_data.c b/src/bet_data.c
index 47f421c..a9e0873 100644
--- a/src/bet_data.c
+++ b/src/bet_data.c
@@ -103,7 +103,6 @@ static gint transfert_number;
 void bet_data_select_bet_pages ( gint account_number )
 {
     GtkWidget *page;
-    GtkWidget *tree_view;
     kind_account kind;
     gint current_page;
     gint bet_use_budget;
@@ -118,8 +117,6 @@ void bet_data_select_bet_pages ( gint account_number )
     else if ( etat.bet_deb_cash_account_option == 1 &&  kind == GSB_TYPE_CASH )
         kind = GSB_TYPE_BANK;
 
-    tree_view = g_object_get_data ( G_OBJECT ( account_page ), "bet_estimate_treeview" );
-
     switch ( kind )
     {
     case GSB_TYPE_BALANCE:
@@ -127,7 +124,6 @@ void bet_data_select_bet_pages ( gint account_number )
     case GSB_TYPE_BANK:
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( account_page ), GSB_ESTIMATE_PAGE );
         gtk_widget_show ( page );
-        bet_array_list_select_path ( tree_view, NULL );
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( account_page ), GSB_HISTORICAL_PAGE );
         gtk_widget_show ( page );
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( account_page ), GSB_FINANCE_PAGE );
@@ -156,7 +152,6 @@ void bet_data_select_bet_pages ( gint account_number )
     case GSB_TYPE_LIABILITIES:
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( account_page ), GSB_ESTIMATE_PAGE );
         gtk_widget_hide ( page );
-        bet_array_list_select_path ( tree_view, NULL );
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( account_page ), GSB_HISTORICAL_PAGE );
         gtk_widget_hide ( page );
         page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( account_page ), GSB_FINANCE_PAGE );
diff --git a/src/categories_onglet.c b/src/categories_onglet.c
index 3cf826b..777abde 100644
--- a/src/categories_onglet.c
+++ b/src/categories_onglet.c
@@ -31,6 +31,7 @@
 /*START_INCLUDE*/
 #include "categories_onglet.h"
 #include "dialog.h"
+#include "fenetre_principale.h"
 #include "gsb_autofunc.h"
 #include "gsb_automem.h"
 #include "gsb_data_category.h"
@@ -338,8 +339,16 @@ void categories_fill_list ( void )
                         NULL, TRUE, 0.5, 0.5 );
     }
     else
+    {
+        gchar *title;
+
         /* on colorise les lignes du tree_view */
         utils_set_tree_view_background_color ( arbre_categ, META_TREE_BACKGROUND_COLOR );
+	    title = g_strdup(_("Categories"));
+        gsb_gui_headings_update_title ( title );
+        g_free ( title );
+        gsb_gui_headings_update_suffix ( "" );
+    }
 }
 
 
diff --git a/src/fenetre_principale.c b/src/fenetre_principale.c
index 653ca96..b1d5cb3 100644
--- a/src/fenetre_principale.c
+++ b/src/fenetre_principale.c
@@ -425,7 +425,7 @@ void gsb_gui_headings_update_suffix ( gchar * suffix )
  *
  * return		FALSE
  */
-gboolean gsb_gui_update_show_headings ()
+gboolean gsb_gui_update_show_headings ( void )
 {
     if ( etat.show_headings_bar )
     {
diff --git a/src/fenetre_principale.h b/src/fenetre_principale.h
index c8c5d50..6226163 100644
--- a/src/fenetre_principale.h
+++ b/src/fenetre_principale.h
@@ -46,7 +46,7 @@ gboolean gsb_gui_on_account_switch_page ( GtkNotebook *notebook,
 void gsb_gui_sensitive_headings ( gboolean sensitive );
 gboolean gsb_gui_set_hpaned_left_width ( gint width );
 void gsb_gui_update_all_toolbars ( void );
-gboolean gsb_gui_update_show_headings ();
+gboolean gsb_gui_update_show_headings ( void );
 /*END_DECLARATION*/
 
 #endif
diff --git a/src/imputation_budgetaire.c b/src/imputation_budgetaire.c
index bd3edaa..d5747ae 100644
--- a/src/imputation_budgetaire.c
+++ b/src/imputation_budgetaire.c
@@ -33,6 +33,7 @@
 /*START_INCLUDE*/
 #include "imputation_budgetaire.h"
 #include "dialog.h"
+#include "fenetre_principale.h"
 #include "gsb_autofunc.h"
 #include "gsb_automem.h"
 #include "gsb_data_budget.h"
@@ -344,8 +345,16 @@ void budgetary_lines_fill_list ( void )
                         NULL, TRUE, 0.5, 0.5 );
     }
     else
+    {
+        gchar *title;
+
         /* on colorise les lignes du tree_view */
         utils_set_tree_view_background_color ( budgetary_line_tree, META_TREE_BACKGROUND_COLOR );
+	    title = g_strdup(_("Budgetary lines"));
+        gsb_gui_headings_update_title ( title );
+        g_free ( title );
+        gsb_gui_headings_update_suffix ( "" );
+    }
 }
 
 
diff --git a/src/metatree.c b/src/metatree.c
index 706e9d0..c89bd8f 100644
--- a/src/metatree.c
+++ b/src/metatree.c
@@ -2280,99 +2280,122 @@ gboolean metatree_selection_changed ( GtkTreeSelection *selection, GtkTreeModel
     GtkTreePath *path;
     gboolean selection_is_set = FALSE;
     gint div_id = 0, sub_div_id = 0, current_number = 0;
+    gint indice;
 
-    iface = g_object_get_data ( G_OBJECT(model), "metatree-interface" );   
-    tree_view = g_object_get_data ( G_OBJECT(model), "tree-view" );
-    if ( !iface || !tree_view || ! model)
-	return FALSE;
+    iface = g_object_get_data ( G_OBJECT ( model ), "metatree-interface" );
+    tree_view = g_object_get_data ( G_OBJECT ( model ), "tree-view" );
+    if ( !iface || !tree_view )
+        return FALSE;
 
     if ( selection && gtk_tree_selection_get_selected ( selection, &model, &iter ) )
     {
-	gchar *text, *balance = "";
+        gchar *text = "";
+        gchar *balance = "";
 
-	if ( !model)
-	    return FALSE;
+        if ( !model)
+            return FALSE;
 
-	gtk_tree_model_get ( GTK_TREE_MODEL(model), &iter,
-			     META_TREE_NO_DIV_COLUMN, &div_id,
-			     META_TREE_NO_SUB_DIV_COLUMN, &sub_div_id,
-			     META_TREE_POINTER_COLUMN, &current_number,
-			     -1);
+        gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter,
+                        META_TREE_NO_DIV_COLUMN, &div_id,
+                        META_TREE_NO_SUB_DIV_COLUMN, &sub_div_id,
+                        META_TREE_POINTER_COLUMN, &current_number,
+                        -1);
 
-    /* save the new_position */
-    path = gtk_tree_model_get_path ( model, &iter );
-    gtk_tree_path_to_string ( path);
-    iface -> hold_position_set_path ( path );
+        /* save the new_position */
+        path = gtk_tree_model_get_path ( model, &iter );
+        iface -> hold_position_set_path ( path );
 
-	/* if we are on a transaction, get the div_id of the transaction */
-	if (!div_id
-	    &&
-	    current_number )
-	{
-	    div_id = iface -> transaction_div_id (current_number);
-	    sub_div_id = iface -> transaction_sub_div_id (current_number);
-        metatree_set_linked_widgets_sensitive ( model, FALSE, "selection" );
-        /* save the new expand */
-        iface -> hold_position_set_expand ( TRUE );
-	}
-    else
-    {
-        metatree_set_linked_widgets_sensitive ( model, TRUE, "selection" );
-        iface -> hold_position_set_expand ( FALSE );
-    }
-	text = g_strconcat ( _(iface -> meta_name),  " : ", 
-			     (div_id ? iface -> div_name ( div_id ) : _(iface->no_div_label) ),
-			     NULL );
+        /* get the indice of the path */
+        indice = gtk_tree_path_get_depth ( path );
+        if ( ( indice == 2 && iface -> content == 0 ) || ( div_id == 0 && current_number > 0 ) )
+            indice = 4; /* the selected line is a transaction */
 
-	if ( div_id ) 
-	{
-	    balance = utils_real_get_string_with_currency ( iface -> div_balance ( div_id ),
-							  iface -> tree_currency (), TRUE );
-	}
+        switch ( indice )
+        {
+            case 1:
+                metatree_set_linked_widgets_sensitive ( model, TRUE, "selection" );
+                iface -> hold_position_set_expand ( FALSE );
 
-	if ( sub_div_id >= 0 )
-	{
-	    gchar* tmpstr = text;
-	    text = g_strconcat ( tmpstr, " : ", 
-				 ( sub_div_id ? iface -> sub_div_name ( div_id, sub_div_id ) :
-				   _(iface->no_sub_div_label) ), NULL );
-            g_free ( tmpstr );
-	    balance = utils_real_get_string_with_currency ( iface -> sub_div_balance ( div_id, sub_div_id ),
-							  iface -> tree_currency (), TRUE );
-	}
+                text = g_strconcat ( _(iface -> meta_name), " : ", iface -> div_name ( div_id ), NULL );
+                balance = utils_real_get_string_with_currency ( iface -> div_balance ( div_id ),
+                                    iface -> tree_currency (), TRUE );
+                break;
+            case 2:
+                metatree_set_linked_widgets_sensitive ( model, TRUE, "selection" );
+                iface -> hold_position_set_expand ( FALSE );
+
+                text = g_strconcat ( _(iface -> meta_name),  " : ",
+                        ( div_id ? iface -> div_name ( div_id ) : _(iface->no_div_label) ),
+                        " : ",
+                        ( sub_div_id ? iface -> sub_div_name ( div_id, sub_div_id ) :
+                         _( iface->no_sub_div_label ) ),
+                        NULL );
+ 
+                balance = utils_real_get_string_with_currency ( iface -> sub_div_balance ( div_id, sub_div_id ),
+                                    iface -> tree_currency (), TRUE );
+                break;
+            case 3:
+                /* if we are on a transaction, get the div_id of the transaction */
+                div_id = iface -> transaction_div_id ( current_number );
+                sub_div_id = iface -> transaction_sub_div_id ( current_number );
+                metatree_set_linked_widgets_sensitive ( model, FALSE, "selection" );
+                /* save the new expand */
+                iface -> hold_position_set_expand ( TRUE );
+
+                text = g_strconcat ( _(iface -> meta_name),  " : ",
+                        ( div_id ? iface -> div_name ( div_id ) : _(iface->no_div_label) ),
+                        " : ",
+                        ( sub_div_id ? iface -> sub_div_name ( div_id, sub_div_id ) :
+                         _( iface->no_sub_div_label ) ),
+                        NULL );
+ 
+                balance = utils_real_get_string_with_currency ( iface -> sub_div_balance ( div_id, sub_div_id ),
+                                    iface -> tree_currency (), TRUE );
+                break;
+            case 4:
+                /* if we are on a transaction, get the div_id of the transaction */
+                div_id = iface -> transaction_div_id ( current_number );
+                metatree_set_linked_widgets_sensitive ( model, FALSE, "selection" );
+                /* save the new expand */
+                iface -> hold_position_set_expand ( TRUE );
+
+                text = g_strconcat ( _(iface -> meta_name), " : ", iface -> div_name ( div_id ), NULL );
+                balance = utils_real_get_string_with_currency ( iface -> div_balance ( div_id ),
+                                    iface -> tree_currency (), TRUE );
+                break;
+        }
 
-	gsb_gui_headings_update_title ( text );
-    gsb_gui_headings_update_suffix ( balance );
-	g_free ( text );
-	selection_is_set = TRUE;
+        gsb_gui_headings_update_title ( text );
+        gsb_gui_headings_update_suffix ( balance );
+        g_free ( text );
+        g_free ( balance );
+        selection_is_set = TRUE;
     }
 
-    if ( ! model )
-	return FALSE;
-
     /* Update sensitiveness of linked widgets. */
     /* metatree_set_linked_widgets_sensitive ( model, selection_is_set, "selection" ); */
-    if ( ! div_id || ( sub_div_id <= 0 && current_number <= 0 ) )
+    if ( !div_id || ( sub_div_id <= 0 && current_number <= 0 ) )
     {
-	metatree_set_linked_widgets_sensitive ( model, FALSE, "selection" );
+        metatree_set_linked_widgets_sensitive ( model, FALSE, "selection" );
     }
 
-    if ( selection_is_set && 
-	 metatree_get_row_type ( model, gtk_tree_model_get_path ( model, &iter ) ) == META_TREE_DIV &&
+    if ( selection_is_set
+     &&
+	 metatree_get_row_type ( model, gtk_tree_model_get_path ( model, &iter ) ) == META_TREE_DIV
+     &&
 	 div_id )
     {
-	metatree_set_linked_widgets_sensitive ( model, TRUE, "sub-division" );
+        metatree_set_linked_widgets_sensitive ( model, TRUE, "sub-division" );
     }
     else
     {
-	metatree_set_linked_widgets_sensitive ( model, FALSE, "sub-division" );
+        metatree_set_linked_widgets_sensitive ( model, FALSE, "sub-division" );
     }
 
     return TRUE;
 }
 
 
-
 /**
  * Link a widget to a metatree.  This means, in some events like
  * selection change, it will be set sensitive or unsensitive.
diff --git a/src/navigation.c b/src/navigation.c
index 07b9bfc..d262f56 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -1089,7 +1089,7 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
 {
     gint account_number, page_number;
     gint report_number;
-    gchar * title = NULL;
+    gchar *title = NULL;
     gboolean clear_suffix = TRUE;
 
     devel_debug (NULL);
@@ -1187,11 +1187,10 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
 	case GSB_PAYEES_PAGE:
 	    notice_debug ("Payee page selected");
 
-	    title = g_strdup(_("Payees"));
-
 	    /* what to be done if switch to that page */
 	    gsb_form_set_expander_visible (FALSE, FALSE );
         payees_fill_list ();
+        clear_suffix = FALSE;
 	    break;
 
 	case GSB_SIMULATOR_PAGE:
@@ -1207,21 +1206,19 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
 	case GSB_CATEGORIES_PAGE:
 	    notice_debug ("Category page selected");
 
-	    title = g_strdup(_("Categories"));
-
 	    /* what to be done if switch to that page */
 	    gsb_form_set_expander_visible (FALSE, FALSE );
         categories_fill_list ();
+        clear_suffix = FALSE;
 	    break;
 
 	case GSB_BUDGETARY_LINES_PAGE:
 	    notice_debug ("Budgetary page selected");
 
-	    title = g_strdup(_("Budgetary lines"));
-
 	    /* what to be done if switch to that page */
 	    gsb_form_set_expander_visible (FALSE, FALSE );
 		budgetary_lines_fill_list ();
+        clear_suffix = FALSE;
 	    break;
 
 	case GSB_REPORTS_PAGE:
@@ -1235,13 +1232,12 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
 		title = g_strdup(_("Reports"));
 
 	    /* what to be done if switch to that page */
-	    gsb_form_set_expander_visible (FALSE,
-					   FALSE );
+	    gsb_form_set_expander_visible ( FALSE, FALSE );
 
 	    if ( report_number > 0 )
-		gsb_gui_update_gui_to_report ( report_number );
+            gsb_gui_update_gui_to_report ( report_number );
 	    else
-		gsb_gui_unsensitive_report_widgets ();
+            gsb_gui_unsensitive_report_widgets ();
 	    break;
 
 	default:
@@ -1250,12 +1246,11 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
 	    break;
     }
 
-    /* title is set here except in GSB_ACCOUNT_PAGE case
-     * because gsb_navigation_update_account_label was called instead */
+    /* title is set here if necessary */
     if (title)
     {
-	gsb_gui_headings_update_title ( title );
-	g_free ( title );
+        gsb_gui_headings_update_title ( title );
+        g_free ( title );
     }
     if (clear_suffix)
         gsb_gui_headings_update_suffix ( "" );
@@ -1365,7 +1360,7 @@ void gsb_gui_navigation_set_selection_branch ( GtkTreeSelection *selection,
  *
  *
  */
-gboolean gsb_gui_navigation_select_prev ()
+gboolean gsb_gui_navigation_select_prev ( void )
 {
     GtkTreeSelection * selection;
     GtkTreePath * path;
@@ -1380,9 +1375,10 @@ gboolean gsb_gui_navigation_select_prev ()
     path = gtk_tree_model_get_path ( model, &iter );
     g_return_val_if_fail ( path, TRUE );
 
-    if ( ! gtk_tree_path_prev ( path ) )
+    if ( !gtk_tree_path_prev ( path ) )
     {
-	gtk_tree_path_up ( path );
+        if ( gtk_tree_path_get_depth ( path ) > 1 )
+            gtk_tree_path_up ( path );
     }
     else
     {
@@ -1412,11 +1408,11 @@ gboolean gsb_gui_navigation_select_prev ()
  *
  *
  */
-gboolean gsb_gui_navigation_select_next ()
+gboolean gsb_gui_navigation_select_next ( void )
 {
-    GtkTreeSelection * selection;
-    GtkTreePath * path;
-    GtkTreeModel * model;
+    GtkTreeSelection *selection;
+    GtkTreePath *path;
+    GtkTreeModel *model;
     GtkTreeIter iter;
 
     selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW(navigation_tree_view) );
@@ -1424,6 +1420,7 @@ gboolean gsb_gui_navigation_select_next ()
     
     if ( !gtk_tree_selection_get_selected ( selection, &model, &iter ) )
         return TRUE;
+
     path = gtk_tree_model_get_path ( model, &iter );
     g_return_val_if_fail ( path, TRUE );
 
@@ -1436,15 +1433,23 @@ gboolean gsb_gui_navigation_select_next ()
     }
     else
     {
-	if ( ! gtk_tree_model_iter_next ( model, &iter ) )
-	{
-	    gtk_tree_path_up ( path );
-	    gtk_tree_path_next ( path );
-	}
-	else
-	{ 
-	    path = gtk_tree_model_get_path ( model, &iter );
-	}
+        if ( !gtk_tree_model_iter_next ( model, &iter ) )
+        {
+            if ( gtk_tree_path_get_depth ( path ) > 1 )
+            {
+                gtk_tree_path_up ( path );
+                gtk_tree_path_next ( path );
+            }
+            else
+            {
+                gtk_tree_path_free ( path );
+                path = gtk_tree_path_new_first ( );
+            }
+        }
+        else
+        {
+            path = gtk_tree_model_get_path ( model, &iter );
+        }
     }
 
     gtk_tree_selection_select_path ( selection, path );
@@ -2316,12 +2321,17 @@ void gsb_gui_navigation_activate_expander ( GtkTreeView *tree_view,
                         GtkTreePath *path,
                         gpointer user_data )
 {
+    GtkTreeSelection *selection;
     GtkTreeModel *model;
+    GtkTreeIter iter_selected;
+    GtkTreePath *path_selected = NULL;
     gint type_page;
     gint etat_expander;
 
     etat_expander = GPOINTER_TO_INT ( user_data );
-    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+    selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+    if ( gtk_tree_selection_get_selected ( selection, &model, &iter_selected ) )
+        path_selected = gtk_tree_model_get_path ( model, &iter_selected);
 
     gtk_tree_model_get ( model, iter, NAVIGATION_PAGE, &type_page, -1 );
 
@@ -2336,8 +2346,8 @@ void gsb_gui_navigation_activate_expander ( GtkTreeView *tree_view,
         break;
     }
 
-    if ( etat_expander == 0 )
-        gtk_tree_selection_select_iter ( gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) ), iter );
+    if ( etat_expander == 0 && path_selected == NULL )
+        gtk_tree_selection_select_iter ( selection, iter );
 }
 
 
diff --git a/src/navigation.h b/src/navigation.h
index 7a70561..57cb335 100644
--- a/src/navigation.h
+++ b/src/navigation.h
@@ -49,8 +49,8 @@ void gsb_gui_navigation_init_pages_list ( void );
 void gsb_gui_navigation_init_tree_view ( void );
 void gsb_gui_navigation_remove_account ( gint account_number );
 void gsb_gui_navigation_remove_report ( gint report_number );
-gboolean gsb_gui_navigation_select_next ();
-gboolean gsb_gui_navigation_select_prev ();
+gboolean gsb_gui_navigation_select_next ( void );
+gboolean gsb_gui_navigation_select_prev ( void );
 gboolean gsb_gui_navigation_set_page_list_order ( const gchar *order_list );
 gboolean gsb_gui_navigation_set_selection ( gint page,
                         gint account_number,
diff --git a/src/tiers_onglet.c b/src/tiers_onglet.c
index 91875ea..1acaf6e 100644
--- a/src/tiers_onglet.c
+++ b/src/tiers_onglet.c
@@ -39,6 +39,7 @@
 
 /*START_INCLUDE*/
 #include "tiers_onglet.h"
+#include "fenetre_principale.h"
 #include "gsb_assistant.h"
 #include "gsb_automem.h"
 #include "gsb_data_form.h"
@@ -278,9 +279,10 @@ GtkWidget *payees_create_list ( void )
 	src_iface -> drag_data_get = &payee_drag_data_get;
     }
 
-    g_signal_connect ( gtk_tree_view_get_selection ( GTK_TREE_VIEW(payee_tree)),
-		       "changed", G_CALLBACK(metatree_selection_changed),
-		       payee_tree_model );
+    g_signal_connect ( gtk_tree_view_get_selection ( GTK_TREE_VIEW ( payee_tree ) ),
+                        "changed",
+                        G_CALLBACK ( metatree_selection_changed ),
+                        payee_tree_model );
 
     /* création de la structure de sauvegarde de la position */
     payee_hold_position = g_malloc0 ( sizeof ( struct metatree_hold_position ) );
@@ -490,6 +492,12 @@ void payees_fill_list ( void )
 
     gsb_status_wait ( FALSE );
 
+    /* on bloque la fonction pendant la mise à jour du model */
+    selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( payee_tree ) );
+    g_signal_handlers_block_by_func ( G_OBJECT ( selection ),
+                        G_CALLBACK ( metatree_selection_changed ),
+                        payee_tree_model );
+
     /* Dettach the model so that insertion will be much faster */
     g_object_ref ( G_OBJECT(payee_tree_model) );
     gtk_tree_view_set_model ( GTK_TREE_VIEW (payee_tree), NULL );
@@ -528,6 +536,11 @@ void payees_fill_list ( void )
     gtk_tree_view_set_model (GTK_TREE_VIEW (payee_tree),
 			     GTK_TREE_MODEL (payee_tree_model));
 
+    /* on débloque la fonction de callback */
+    g_signal_handlers_unblock_by_func ( G_OBJECT ( selection ),
+                        G_CALLBACK ( metatree_selection_changed ),
+                        payee_tree_model );
+
     /* replace le curseur sur la division, sub_division ou opération initiale */
     if ( payee_hold_position -> path )
     {
@@ -540,17 +553,26 @@ void payees_fill_list ( void )
             gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( payee_tree ), ancestor );
             gtk_tree_path_free (ancestor );
         }
+
         /* on colorise les lignes du tree_view */
         utils_set_tree_view_background_color ( payee_tree, META_TREE_BACKGROUND_COLOR );
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( payee_tree ) );
         gtk_tree_selection_select_path ( selection, payee_hold_position -> path );
         gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( payee_tree ),
                         payee_hold_position -> path,
                         NULL, TRUE, 0.5, 0.5 );
     }
     else
+    {
+        gchar *title;
+
         /* on colorise les lignes du tree_view */
         utils_set_tree_view_background_color ( payee_tree, META_TREE_BACKGROUND_COLOR );
+        /* on fixe le titre et le suffixe de la barre d'information */
+	    title = g_strdup(_("Payees"));
+        gsb_gui_headings_update_title ( title );
+        g_free ( title );
+        gsb_gui_headings_update_suffix ( "" );
+    }
 
     g_object_unref ( G_OBJECT ( payee_tree_model ) );
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list