[grisbi-cvs] grisbi/src metatree.c, 1.139, 1.140 tiers_onglet.c, 1.161, 1.162

Pierre Biava pbiava at users.sourceforge.net
Thu Jul 9 20:34:06 CEST 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32230/src

Modified Files:
	metatree.c tiers_onglet.c 
Log Message:
fixed a display bug when deleting a category

Index: metatree.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/metatree.c,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -d -r1.139 -r1.140
--- metatree.c	12 Jun 2009 19:06:56 -0000	1.139
+++ metatree.c	9 Jul 2009 18:34:04 -0000	1.140
@@ -895,7 +895,7 @@
 {
     devel_debug (NULL);
 
-    GtkTreeIter iter, * it;
+    GtkTreeIter iter, *parent_iter, * it;
     GtkTreePath *path;
 
     if ( find_associated_transactions ( iface, division, 
@@ -958,16 +958,26 @@
 	}
 
 	/* Fill sub division */
-	it = get_iter_from_div ( model, nouveau_no_division, nouveau_no_sub_division );
+    if ( nouveau_no_division && nouveau_no_sub_division == 0 )
+    {
+        parent_iter = get_iter_from_div ( model, nouveau_no_division, 0 );
+        it = get_iter_from_sub_div_zero ( model, iface, parent_iter, 0 );
+    }
+    else
+        it = get_iter_from_div ( model, nouveau_no_division, nouveau_no_sub_division );
+
 	if ( it )
     {
         GtkTreeIter child_iter;
         gint transaction_number;
-        
-	    fill_sub_division_row ( model, iface, it,
-                        nouveau_no_division,
-                        nouveau_no_sub_division );
-        
+
+        if ( nouveau_no_division && nouveau_no_sub_division == 0 )
+            fill_sub_division_zero ( model, iface, it,nouveau_no_division );
+        else
+            fill_sub_division_row ( model, iface, it,
+                            nouveau_no_division,
+                            nouveau_no_sub_division );
+
         path = gtk_tree_model_get_path ( model, it );
         if ( gtk_tree_view_row_expanded ( tree_view, path ) )
         {

Index: tiers_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- tiers_onglet.c	17 May 2009 15:53:25 -0000	1.161
+++ tiers_onglet.c	9 Jul 2009 18:34:04 -0000	1.162
@@ -380,17 +380,23 @@
 
     if (result == TRUE)
     {
-	gint nb_removed;
-	gchar *tmpstr;
+        gint nb_removed;
+        gchar *tmpstr;
 
-	nb_removed = gsb_data_payee_remove_unused ();
-	payee_fill_tree ();
-	tmpstr = g_strdup_printf ( _("Removed %d payees."),
-				   nb_removed);
-	dialogue (tmpstr);
-	g_free (tmpstr);
-	if ( etat.modification_fichier == 0 )
-        modification_fichier ( TRUE );
+        nb_removed = gsb_data_payee_remove_unused ();
+        if ( nb_removed > 0 )
+        {
+            payee_fill_tree ();
+            tmpstr = g_strdup_printf ( _("Removed %d payees."), nb_removed);
+            if ( etat.modification_fichier == 0 )
+                modification_fichier ( TRUE );
+        }
+        else
+        {
+            tmpstr = g_strdup ( _("There is no payee to remove.") );
+        }
+        dialogue (tmpstr);
+        g_free (tmpstr);
     }
     return FALSE;
 }



More information about the cvs mailing list