[grisbi-cvs] grisbi/src gsb_data_partial_balance.c, NONE, 1.1 gsb_data_partial_balance.h, NONE, 1.1 Makefile.am, 1.158, 1.159 accueil.c, 1.200, 1.201 accueil.h, 1.15, 1.16 categories_onglet.c, 1.194, 1.195 categories_onglet.h, 1.18, 1.19 classement_echeances.c, 1.11, 1.12 classement_echeances.h, 1.6, 1.7 gsb_currency_config.c, 1.52, 1.53 gsb_data_transaction.c, 1.68, 1.69 gsb_data_transaction.h, 1.31, 1.32 gsb_file_load.c, 1.184, 1.185 gsb_file_save.c, 1.134, 1.135 imputation_budgetaire.c, 1.156, 1.157 imputation_budgetaire.h, 1.14, 1.15 meta_budgetary.c, 1.36, 1.37 meta_categories.c, 1.47, 1.48 meta_payee.c, 1.33, 1.34 metatree.c, 1.140, 1.141 metatree.h, 1.46, 1.47 parametres.c, 1.197, 1.198 parametres.h, 1.29, 1.30 structures.h, 1.229, 1.230 tiers_onglet.c, 1.162, 1.163 tiers_onglet.h, 1.19, 1.20 traitement_variables.c, 1.174, 1.175

Pierre Biava pbiava at users.sourceforge.net
Wed Jul 22 21:45:45 CEST 2009


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

Modified Files:
	Makefile.am accueil.c accueil.h categories_onglet.c 
	categories_onglet.h classement_echeances.c 
	classement_echeances.h gsb_currency_config.c 
	gsb_data_transaction.c gsb_data_transaction.h gsb_file_load.c 
	gsb_file_save.c imputation_budgetaire.c 
	imputation_budgetaire.h meta_budgetary.c meta_categories.c 
	meta_payee.c metatree.c metatree.h parametres.c parametres.h 
	structures.h tiers_onglet.c tiers_onglet.h 
	traitement_variables.c 
Added Files:
	gsb_data_partial_balance.c gsb_data_partial_balance.h 
Log Message:
Storing the selection of payee category and budgetary.
Added selection of operations by date for the payees, category and budgetary
Partial implémentation of the partial balances

Index: metatree.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/metatree.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- metatree.h	9 Jun 2009 20:28:17 -0000	1.46
+++ metatree.h	22 Jul 2009 19:45:43 -0000	1.47
@@ -51,8 +51,21 @@
     void (* remove_transaction_from_div) (int);
     void (* remove_transaction_from_sub_div) (int);
 
+    /* sauvegarde dernière sélection */
+    gboolean (* hold_position_set_path) ( GtkTreePath *);
+    gboolean (* hold_position_set_expand) ( gboolean );
+
 } MetatreeInterface;
 
+
+/* structure permettant de mémoriser la dernière sélection dans un metatree */
+struct metatree_hold_position
+{
+    GtkTreePath *path;
+    gboolean expand;
+};
+
+
 enum meta_tree_columns {
     META_TREE_TEXT_COLUMN,
     META_TREE_ACCOUNT_COLUMN,

Index: metatree.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/metatree.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- metatree.c	9 Jul 2009 18:34:04 -0000	1.140
+++ metatree.c	22 Jul 2009 19:45:43 -0000	1.141
@@ -1123,12 +1123,16 @@
 			     META_TREE_NO_DIV_COLUMN, &no_division,
 			     META_TREE_NO_SUB_DIV_COLUMN, &no_sub_division,
 			     -1 );
-	list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
+    if ( etat.metatree_sort_transactions )
+        list_tmp_transactions = gsb_data_transaction_get_transactions_list_by_date ();
+    else
+        list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
 
 	while ( list_tmp_transactions )
 	{
 	    gint transaction_number_tmp;
-	    transaction_number_tmp = gsb_data_transaction_get_transaction_number (list_tmp_transactions -> data);
+	    transaction_number_tmp = gsb_data_transaction_get_transaction_number (
+                        list_tmp_transactions -> data);
 
 	    /* set the transaction if the same div/sub-div
 	     * or if no categ (must check if no transfer or split) */
@@ -2232,6 +2236,7 @@
     MetatreeInterface * iface;
     GtkTreeView * tree_view;
     GtkTreeIter iter;
+    GtkTreePath *path;
     gboolean selection_is_set = FALSE;
     gint div_id, sub_div_id, current_number;
 
@@ -2253,6 +2258,11 @@
 			     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 );
+
 	/* if we are on a transaction, get the div_id of the transaction */
 	if (!div_id
 	    &&
@@ -2261,9 +2271,14 @@
 	    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 );

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- gsb_file_save.c	8 Jul 2009 22:18:21 -0000	1.134
+++ gsb_file_save.c	22 Jul 2009 19:45:43 -0000	1.135
@@ -41,6 +41,7 @@
 #include "./gsb_data_form.h"
 #include "./gsb_data_fyear.h"
 #include "./gsb_data_import_rule.h"
+#include "./gsb_data_partial_balance.h"
 #include "./gsb_data_payee.h"
 #include "./gsb_data_payment.h"
 #include "./gsb_data_print_config.h"
@@ -102,6 +103,9 @@
 static gulong gsb_file_save_logo_part ( gulong iterator,
                         gulong *length_calculated,
                         gchar **file_content );
+static gulong gsb_file_save_partial_balance_part ( gulong iterator,
+                        gulong *length_calculated,
+                        gchar **file_content );
 static gulong gsb_file_save_party_part ( gulong iterator,
                         gulong *length_calculated,
                         gchar **file_content );
@@ -194,6 +198,7 @@
     gint reconcile_part;
     gint report_part;
     gint import_rule_part;
+    gint partial_balance_part;
     gint logo_part;
 
     struct stat buf;
@@ -239,6 +244,7 @@
     reconcile_part = 50;
     report_part = 2500;
     import_rule_part = 50;
+    partial_balance_part = 50;
     logo_part = 65536;
     
     length_calculated = general_part
@@ -255,6 +261,7 @@
 	+ reconcile_part * g_list_length (gsb_data_reconcile_get_reconcile_list ())
 	+ report_part * g_slist_length ( gsb_data_report_get_report_list ())
 	+ import_rule_part * g_slist_length ( gsb_data_import_rule_get_list ())
+    + partial_balance_part * g_slist_length ( gsb_data_partial_balance_get_list ())
     + logo_part;
 
     iterator = 0;
@@ -342,6 +349,10 @@
 						&length_calculated,
 						&file_content );
 
+    iterator = gsb_file_save_partial_balance_part ( iterator,
+						&length_calculated,
+						&file_content );
+
     iterator = gsb_file_save_report_part ( iterator,
 					   &length_calculated,
 					   &file_content,
@@ -663,7 +674,8 @@
 					   "\t\tCombofix_force_category=\"%d\"\n"
 					   "\t\tAutomatic_amount_separator=\"%d\"\n"
 					   "\t\tCSV_separator=\"%s\"\n"
-					   "\t\tCSV_skipped_lines=\"%s\" />\n",
+					   "\t\tCSV_skipped_lines=\"%s\"\n"
+					   "\t\tMetatree_sort_transactions=\"%d\" />\n",
 	my_safe_null_str(VERSION_FICHIER),
 	my_safe_null_str(VERSION),
 	etat.crypt_file,
@@ -699,7 +711,8 @@
 	etat.combofix_force_category,
 	etat.automatic_separator,
 	my_safe_null_str(etat.csv_separator),
-	my_safe_null_str(skipped_lines_string) );
+	my_safe_null_str(skipped_lines_string),
+    etat.metatree_sort_transactions );
 
     g_free (transactions_view);
     g_free (scheduler_column_width_write);
@@ -1868,6 +1881,48 @@
 }
 
 
+/**
+ * save the partial_balance structures
+ *
+ * \param iterator the current iterator
+ * \param length_calculated a pointer to the variable lengh_calculated
+ * \param file_content a pointer to the variable file_content
+ *
+ * \return the new iterator
+ * */
+gulong gsb_file_save_partial_balance_part ( gulong iterator,
+                        gulong *length_calculated,
+                        gchar **file_content )
+{
+    GSList *list_tmp;
+
+    list_tmp = gsb_data_partial_balance_get_list ();
+
+    while ( list_tmp )
+    {
+	gchar *new_string;
+	gint partial_balance_number;
+
+	partial_balance_number = gsb_data_partial_balance_get_number ( list_tmp -> data );
+
+	new_string = g_markup_printf_escaped ( "\t<Partial_balance Nb=\"%d\" Na=\"%s\" Acc=\"%s\" kind=\"%d\" Currency=\"%d\" />\n",
+					       partial_balance_number,
+					       my_safe_null_str(gsb_data_partial_balance_get_name ( partial_balance_number )),
+					       my_safe_null_str(gsb_data_partial_balance_get_liste_cptes ( partial_balance_number )),
+					       gsb_data_partial_balance_get_kind (partial_balance_number),
+					       gsb_data_partial_balance_get_currency (partial_balance_number) );
+
+	/* append the new string to the file content
+	 * and take the new iterator */
+	iterator = gsb_file_save_append_part ( iterator,
+					       length_calculated,
+					       file_content,
+					       new_string );
+	list_tmp = list_tmp -> next;
+    }
+    return iterator;
+}
+
 
 /**
  * save the reports

Index: tiers_onglet.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- tiers_onglet.h	13 Mar 2009 20:15:38 -0000	1.19
+++ tiers_onglet.h	22 Jul 2009 19:45:43 -0000	1.20
@@ -11,5 +11,7 @@
 gboolean gsb_payee_update_combofix ( void );
 GtkWidget *onglet_tiers ( void );
 void payee_fill_tree ( void );
+gboolean payee_hold_position_set_expand ( gboolean expand );
+gboolean payee_hold_position_set_path ( GtkTreePath *path );
 /* END_DECLARATION */
 #endif

Index: gsb_currency_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_currency_config.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- gsb_currency_config.c	10 May 2009 13:06:56 -0000	1.52
+++ gsb_currency_config.c	22 Jul 2009 19:45:42 -0000	1.53
@@ -811,10 +811,11 @@
  */
 GtkWidget *gsb_currency_config_create_totals_page ( void )
 {
-    GtkWidget *vbox_pref, *table, *label;
+    //~ GtkWidget *vbox_pref, *table, *label;
+        GtkWidget *table, *label;
 
-    vbox_pref = new_vbox_with_title_and_icon ( _("Totals currencies"),
-					       "currencies.png" );
+    //~ vbox_pref = new_vbox_with_title_and_icon ( _("Totals currencies"),
+					       //~ "currencies.png" );
 
     table = gtk_table_new ( 2, 2, FALSE );
     gtk_table_set_col_spacings ( GTK_TABLE ( table ), 5 );
@@ -850,9 +851,9 @@
     gtk_table_attach ( GTK_TABLE ( table ), combo_devise_totaux_ib,
 		       1, 2, 2, 3, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
 
-    gtk_box_pack_start ( GTK_BOX ( vbox_pref ), table, TRUE, TRUE, 0);
+    //~ gtk_box_pack_start ( GTK_BOX ( vbox_pref ), table, TRUE, TRUE, 0);
 
-    return ( vbox_pref );
+    return ( table );
 }
 
 /**

Index: tiers_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- tiers_onglet.c	9 Jul 2009 18:34:04 -0000	1.162
+++ tiers_onglet.c	22 Jul 2009 19:45:43 -0000	1.163
@@ -95,8 +95,6 @@
 static gboolean popup_payee_view_mode_menu ( GtkWidget * button );
 /*END_STATIC*/
 
-//~ GtkWidget *arbre_tiers = NULL;
-
 gint no_devise_totaux_tiers;
 
 GtkWidget *payee_tree = NULL;
@@ -105,6 +103,9 @@
 /* variable for the management of the cancelled edition */
 gboolean sortie_edit_payee = FALSE;
 
+/* structure pour la sauvegarde de la position */
+struct metatree_hold_position *payee_hold_position;
+
 /*START_EXTERN*/
 extern GSList *liste_associations_tiers;
 extern MetatreeInterface * payee_interface;
@@ -273,6 +274,9 @@
 		       "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 ) );
+
     return ( onglet );
 }
 
@@ -450,6 +454,7 @@
 {
     GSList *payee_list_tmp;
     GtkTreeIter iter_payee;
+    GtkTreeSelection *selection;
 
     devel_debug (NULL);
 
@@ -485,7 +490,26 @@
     /* Reattach the model */
     gtk_tree_view_set_model (GTK_TREE_VIEW (payee_tree),
 			     GTK_TREE_MODEL (payee_tree_model));
-    g_object_unref ( G_OBJECT(payee_tree_model) );
+
+    /* replace le curseur sur la division, sub_division ou opération initiale */
+    if ( payee_hold_position -> path )
+    {
+        if ( payee_hold_position -> expand )
+        {
+            GtkTreePath *ancestor;
+
+            ancestor = gtk_tree_path_copy ( payee_hold_position -> path );
+            gtk_tree_path_up ( ancestor );
+            gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( payee_tree ), ancestor );
+            gtk_tree_path_free (ancestor );
+        }
+        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 );
+    }
+    g_object_unref ( G_OBJECT ( payee_tree_model ) );
 
     gsb_status_stop_wait ( FALSE );
 }
@@ -717,6 +741,28 @@
 }
 
 
+/**
+ * fonction pour sauvegarder le chemin du dernier tiers sélectionné.
+ *
+ * \param path
+ */
+gboolean payee_hold_position_set_path ( GtkTreePath *path )
+{
+    payee_hold_position -> path = gtk_tree_path_copy ( path );
+
+    return TRUE;
+}
+/**
+ * sauvegarde l'attribut expand.
+ *
+ * \param expand
+ */
+gboolean payee_hold_position_set_expand ( gboolean expand )
+{
+    payee_hold_position -> expand = expand;
+
+    return TRUE;
+}
 /* ******************************************************************************/
 /* assistant de gestion des tiers :                                             */
 /* permet de modifier en masse le nom d'un tiers contenant une chaine           */

Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- gsb_data_transaction.c	5 Jul 2009 09:24:48 -0000	1.68
+++ gsb_data_transaction.c	22 Jul 2009 19:45:42 -0000	1.69
@@ -31,6 +31,7 @@
 
 /*START_INCLUDE*/
 #include "gsb_data_transaction.h"
+#include "./classement_echeances.h"
 #include "./dialog.h"
 #include "./gsb_data_account.h"
 #include "./gsb_data_budget.h"
@@ -45,7 +46,6 @@
 #include "./transaction_list.h"
 #include "./include.h"
 #include "./gsb_real.h"
-#include "./erreur.h"
 /*END_INCLUDE*/
 
 
@@ -2540,6 +2540,27 @@
     }
     return FALSE;
 }
+
+
+/** 
+ * return a copy of the g_slist of transactions structure
+ * sorted by date
+ *  * THIS IS THE LIST WITHOUT THE ARCHIVED TRANSACTIONS
+ *
+ * \param none
+ *
+ * \return the slist of transactions structures
+ * */
+GSList *gsb_data_transaction_get_transactions_list_by_date ( void )
+{
+    GSList *list_tmp;
+
+    list_tmp = g_slist_copy ( transactions_list );
+    list_tmp = g_slist_sort (list_tmp, 
+                        (GCompareFunc) classement_sliste_transactions_par_date );
+    return list_tmp;
+}
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

--- NEW FILE: gsb_data_partial_balance.h ---
#ifndef _GSB_DATA_PARTIAL_BALANCE_H
#define _GSB_DATA_PARTIAL_BALANCE_H (1)


/* START_INCLUDE_H */
#include "././gsb_data_account.h"
/* END_INCLUDE_H */

/* START_DECLARATION */
gint gsb_data_partial_balance_get_currency ( gint partial_balance_number );
gchar *gsb_data_partial_balance_get_current_balance ( gint partial_balance_number );
kind_account gsb_data_partial_balance_get_kind ( gint partial_balance_number );
GSList *gsb_data_partial_balance_get_list ( void );
const gchar *gsb_data_partial_balance_get_liste_cptes ( gint partial_balance_number );
gchar *gsb_data_partial_balance_get_marked_balance ( gint partial_balance_number );
const gchar *gsb_data_partial_balance_get_name ( gint partial_balance_number );
gint gsb_data_partial_balance_get_number ( gpointer balance_ptr );
gboolean gsb_data_partial_balance_init_variables ( void );
gint gsb_data_partial_balance_new ( const gchar *name );
gboolean gsb_data_partial_balance_set_currency ( gint partial_balance_number,
                        gint currency );
gboolean gsb_data_partial_balance_set_kind ( gint partial_balance_number,
                        kind_account kind );
gboolean gsb_data_partial_balance_set_liste_cptes ( gint partial_balance_number,
                        const gchar *liste_cptes );
gboolean gsb_data_partial_balance_set_name ( gint partial_balance_number,
                        const gchar *name );
gint gsb_data_partial_balance_set_new_number ( gint partial_balance_number,
                        gint new_no_partial_balance );
/* END_DECLARATION */
#endif

Index: traitement_variables.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/traitement_variables.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -d -r1.174 -r1.175
--- traitement_variables.c	14 Jun 2009 19:02:20 -0000	1.174
+++ traitement_variables.c	22 Jul 2009 19:45:43 -0000	1.175
@@ -40,6 +40,7 @@
 #include "./gsb_data_currency_link.h"
 #include "./gsb_data_fyear.h"
 #include "./gsb_data_import_rule.h"
+#include "./gsb_data_partial_balance.h"
 #include "./gsb_data_payee.h"
 #include "./gsb_data_payment.h"
 #include "./gsb_data_print_config.h"
@@ -244,6 +245,7 @@
     gsb_data_archive_init_variables ();
     gsb_data_archive_store_init_variables ();
     gsb_data_import_rule_init_variables ();
+    gsb_data_partial_balance_init_variables ( );
 
     gsb_currency_init_variables ();
     gsb_fyear_init_variables ();

Index: gsb_data_transaction.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- gsb_data_transaction.h	17 Jun 2009 19:39:51 -0000	1.31
+++ gsb_data_transaction.h	22 Jul 2009 19:45:42 -0000	1.32
@@ -63,6 +63,7 @@
 const gchar *gsb_data_transaction_get_transaction_id ( gint transaction_number );
 gint gsb_data_transaction_get_transaction_number ( gpointer transaction_pointer );
 GSList *gsb_data_transaction_get_transactions_list ( void );
+GSList *gsb_data_transaction_get_transactions_list_by_date ( void );
 const GDate *gsb_data_transaction_get_value_date ( gint transaction_number );
 const gchar *gsb_data_transaction_get_voucher ( gint transaction_number );
 gint gsb_data_transaction_get_white_line ( gint transaction_number );

Index: imputation_budgetaire.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/imputation_budgetaire.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -d -r1.156 -r1.157
--- imputation_budgetaire.c	27 Apr 2009 19:41:03 -0000	1.156
+++ imputation_budgetaire.c	22 Jul 2009 19:45:43 -0000	1.157
@@ -74,6 +74,9 @@
 /* variable for the management of the cancelled edition */
 gboolean sortie_edit_budgetary_line = FALSE;
 
+/* structure pour la sauvegarde de la position */
+struct metatree_hold_position *budgetary_hold_position;
+
 /*START_EXTERN*/
 extern MetatreeInterface * budgetary_interface;
 extern GtkWidget *window;
@@ -209,6 +212,10 @@
     g_signal_connect ( gtk_tree_view_get_selection ( GTK_TREE_VIEW(budgetary_line_tree)),
 		       "changed", G_CALLBACK(metatree_selection_changed),
 		       budgetary_line_tree_model );
+
+    /* création de la structure de sauvegarde de la position */
+    budgetary_hold_position = g_malloc0 ( sizeof ( struct metatree_hold_position ) );
+
     return ( vbox );
 }
 /* **************************************************************************************************** */
@@ -225,6 +232,7 @@
 {
     GSList *budget_list;
     GtkTreeIter iter_budgetary_line, iter_sub_budgetary_line;
+    GtkTreeSelection *selection;
 
     devel_debug (NULL);
 
@@ -285,6 +293,24 @@
 	}
 	budget_list = budget_list -> next;
     }
+        /* replace le curseur sur la division, sub_division ou opération initiale */
+    if ( budgetary_hold_position -> path )
+    {
+        if ( budgetary_hold_position -> expand )
+        {
+            GtkTreePath *ancestor;
+
+            ancestor = gtk_tree_path_copy ( budgetary_hold_position -> path );
+            gtk_tree_path_up ( ancestor );
+            gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( budgetary_line_tree ), ancestor );
+            gtk_tree_path_free (ancestor );
+        }
+        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( budgetary_line_tree ) );
+        gtk_tree_selection_select_path ( selection, budgetary_hold_position -> path );
+        gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( budgetary_line_tree ),
+                        budgetary_hold_position -> path,
+                        NULL, TRUE, 0.5, 0.5 );
+    }
 }
 
 
@@ -878,6 +904,31 @@
     gtk_tree_path_free ( path );
     g_free ( name );
 }
+
+
+/**
+ * sauvegarde le chemin de la dernière imputation sélectionnée.
+ *
+ * \param path
+ */
+gboolean budgetary_hold_position_set_path ( GtkTreePath *path )
+{
+    budgetary_hold_position -> path = gtk_tree_path_copy ( path );
+
+    return TRUE;
+}
+/**
+ * sauvegarde l'attribut expand.
+ *
+ * \param expand
+ */
+gboolean budgetary_hold_position_set_expand ( gboolean expand )
+{
+    budgetary_hold_position -> expand = expand;
+
+    return TRUE;
+}
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: meta_budgetary.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/meta_budgetary.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- meta_budgetary.c	27 Apr 2009 19:41:03 -0000	1.36
+++ meta_budgetary.c	22 Jul 2009 19:45:43 -0000	1.37
@@ -94,6 +94,8 @@
     gsb_data_budget_add_transaction_to_budget,
     gsb_data_budget_remove_transaction_from_budget,
     gsb_data_budget_remove_transaction_from_budget,
+    budgetary_hold_position_set_path,
+    budgetary_hold_position_set_expand,
 };
 
 MetatreeInterface * budgetary_interface = &_budgetary_interface;

Index: categories_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.c,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -d -r1.194 -r1.195
--- categories_onglet.c	12 Jun 2009 19:06:56 -0000	1.194
+++ categories_onglet.c	22 Jul 2009 19:45:42 -0000	1.195
@@ -66,6 +66,9 @@
 /* variable for the management of the cancelled edition */
 static gboolean sortie_edit_category = FALSE;
 
+/* structure pour la sauvegarde de la position */
+struct metatree_hold_position *category_hold_position;
+
 /*START_EXTERN*/
 extern MetatreeInterface * category_interface;
 extern GtkWidget *window;
@@ -196,6 +199,10 @@
     g_signal_connect ( gtk_tree_view_get_selection ( GTK_TREE_VIEW(arbre_categ)),
 		       "changed", G_CALLBACK(metatree_selection_changed),
 		       categ_tree_model );
+
+    /* création de la structure de sauvegarde de la position */
+    category_hold_position = g_malloc0 ( sizeof ( struct metatree_hold_position ) );
+
     return ( vbox );
 }
 
@@ -208,6 +215,7 @@
 {
     GSList *category_list;
     GtkTreeIter iter_categ, iter_sous_categ;
+    GtkTreeSelection *selection;
 
     devel_debug (NULL);
 
@@ -273,6 +281,24 @@
 
 	category_list = category_list -> next;
     }
+
+    if ( category_hold_position -> path )
+    {
+        if ( category_hold_position -> expand )
+        {
+            GtkTreePath *ancestor;
+
+            ancestor = gtk_tree_path_copy ( category_hold_position -> path );
+            gtk_tree_path_up ( ancestor );
+            gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( arbre_categ ), ancestor );
+            gtk_tree_path_free (ancestor );
+        }
+        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( arbre_categ ) );
+        gtk_tree_selection_select_path ( selection, category_hold_position -> path );
+        gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( arbre_categ ),
+                        category_hold_position -> path,
+                        NULL, TRUE, 0.5, 0.5 );
+    }
 }
 
 
@@ -842,6 +868,31 @@
     gtk_tree_path_free ( path );
     g_free ( name );
 }
+
+
+/**
+ * sauvegarde le chemin de la dernière categorie sélectionnée.
+ *
+ * \param path
+ */
+gboolean category_hold_position_set_path ( GtkTreePath *path )
+{
+    category_hold_position -> path = gtk_tree_path_copy ( path );
+
+    return TRUE;
+}
+/**
+ * sauvegarde l'attribut expand.
+ *
+ * \param expand
+ */
+gboolean category_hold_position_set_expand ( gboolean expand )
+{
+    category_hold_position -> expand = expand;
+
+    return TRUE;
+}
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: Makefile.am
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/Makefile.am,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- Makefile.am	6 Jun 2009 19:28:07 -0000	1.158
+++ Makefile.am	22 Jul 2009 19:45:42 -0000	1.159
@@ -70,6 +70,7 @@
 	gsb_data_fyear.c	\
 	gsb_data_import_rule.c	\
 	gsb_data_mix.c		\
+    gsb_data_partial_balance.c   \
 	gsb_data_payee.c	\
 	gsb_data_payment.c		\
 	gsb_data_print_config.c		\
@@ -198,6 +199,7 @@
 	gsb_data_fyear.h	\
 	gsb_data_import_rule.h	\
 	gsb_data_mix.h		\
+    gsb_data_partial_balance.h   \
 	gsb_data_payee.h	\
 	gsb_data_payment.h		\
 	gsb_data_print_config.h		\
@@ -257,11 +259,11 @@
 	main.h			\
 	main_cunit.h			\
 	menu.h			\
-        meta_budgetary.h        \
-        meta_categories.h       \
-        meta_payee.h            \
-        metatree.h              \
-        mouse.h                 \
+    meta_budgetary.h        \
+    meta_categories.h       \
+    meta_payee.h            \
+    metatree.h              \
+    mouse.h                 \
 	navigation.h		\
 	parametres.h		\
 	parse_cmdline.h		\

Index: categories_onglet.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- categories_onglet.h	19 Sep 2007 10:01:14 -0000	1.18
+++ categories_onglet.h	22 Jul 2009 19:45:42 -0000	1.19
@@ -9,5 +9,7 @@
 /* START_DECLARATION */
 GtkWidget *onglet_categories ( void );
 void remplit_arbre_categ ( void );
+gboolean category_hold_position_set_expand ( gboolean expand );
+gboolean category_hold_position_set_path ( GtkTreePath *path );
 /* END_DECLARATION */
 #endif

Index: structures.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/structures.h,v
retrieving revision 1.229
retrieving revision 1.230
diff -u -d -r1.229 -r1.230
--- structures.h	17 Jun 2009 19:39:51 -0000	1.229
+++ structures.h	22 Jul 2009 19:45:43 -0000	1.230
@@ -141,6 +141,9 @@
                             * skipped lines
                             * in CSV
                             * preview. */
+
+    /* variables pour les metatree */
+    gint metatree_sort_transactions;
 } etat;
 
 

Index: meta_categories.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/meta_categories.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- meta_categories.c	27 Apr 2009 19:41:03 -0000	1.47
+++ meta_categories.c	22 Jul 2009 19:45:43 -0000	1.48
@@ -25,6 +25,7 @@
 
 /*START_INCLUDE*/
 #include "meta_categories.h"
+#include "./categories_onglet.h"
 #include "./gsb_category.h"
 #include "./gsb_data_category.h"
 #include "./gsb_data_scheduled.h"
@@ -96,6 +97,8 @@
     gsb_data_category_add_transaction_to_category,
     gsb_data_category_remove_transaction_from_category,
     gsb_data_category_remove_transaction_from_category,
+    category_hold_position_set_path,
+    category_hold_position_set_expand,
 };
 
 MetatreeInterface * category_interface = &_category_interface;

Index: meta_payee.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/meta_payee.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- meta_payee.c	27 Apr 2009 19:41:03 -0000	1.33
+++ meta_payee.c	22 Jul 2009 19:45:43 -0000	1.34
@@ -31,6 +31,7 @@
 #include "./metatree.h"
 #include "./include.h"
 #include "./gsb_real.h"
+#include "./tiers_onglet.h"
 /*END_INCLUDE*/
 
 
@@ -108,6 +109,8 @@
     payee_add_transaction_to_sub_div,
     gsb_data_payee_remove_transaction_from_payee,
     gsb_data_payee_remove_transaction_from_payee,
+    payee_hold_position_set_path,
+    payee_hold_position_set_expand,
 };
 
 MetatreeInterface * payee_interface = &_payee_interface;

Index: imputation_budgetaire.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/imputation_budgetaire.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- imputation_budgetaire.h	19 Sep 2007 10:01:16 -0000	1.14
+++ imputation_budgetaire.h	22 Jul 2009 19:45:43 -0000	1.15
@@ -8,5 +8,7 @@
 gboolean gsb_budget_update_combofix ( void );
 GtkWidget *onglet_imputations ( void );
 void remplit_arbre_imputation ( void );
+gboolean budgetary_hold_position_set_expand ( gboolean expand );
+gboolean budgetary_hold_position_set_path ( GtkTreePath *path );
 /* END_DECLARATION */
 #endif

Index: accueil.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/accueil.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- accueil.c	28 Jun 2009 16:50:24 -0000	1.200
+++ accueil.c	22 Jul 2009 19:45:42 -0000	1.201
@@ -28,6 +28,7 @@
 #include "./dialog.h"
 #include "./gsb_data_account.h"
 #include "./gsb_data_currency.h"
+#include "./gsb_data_partial_balance.h"
 #include "./gsb_data_payee.h"
 #include "./gsb_data_scheduled.h"
 #include "./gsb_data_transaction.h"
@@ -57,7 +58,10 @@
                         gint currency_number,
                         gsb_real solde_global_courant,
                         gsb_real solde_global_pointe );
-static void gsb_main_page_affiche_table_des_comptes ( GtkWidget *pTable,
+static void affiche_soldes_partiels ( GtkWidget *table,
+                        gint i,
+                        GSList *liste );
+static void gsb_main_page_affiche_ligne_du_compte ( GtkWidget *pTable,
                         gint account_number,
                         gint i );
 static gboolean gsb_main_page_click_on_account ( gint *account_number );
@@ -429,7 +433,7 @@
     }
 
     /* Affichage des comptes bancaires et de caisse */
-    for ( devise = gsb_data_currency_get_currency_list(); devise ; devise = devise->next )
+    for ( devise = gsb_data_currency_get_currency_list (); devise ; devise = devise->next )
     {
         gint currency_number;
 
@@ -447,7 +451,7 @@
         paddingbox = new_paddingbox_with_title ( vbox, FALSE, tmpstr );
         g_free ( tmpstr );
 
-        pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_bancaires + 3, 4 );
+        pTable = gsb_main_page_get_table_for_accounts ( nb_comptes_bancaires + 3, 3 );
         gtk_box_pack_start ( GTK_BOX ( paddingbox ), pTable, FALSE, FALSE, 0 );
 
         /* Affichage des comptes et de leur solde */
@@ -472,7 +476,7 @@
              && gsb_data_account_get_kind (account_number) != GSB_TYPE_ASSET )
             {
                 /* on affiche la ligne du compte avec les soldes pointé et courant */
-                gsb_main_page_affiche_table_des_comptes ( pTable, account_number, i );
+                gsb_main_page_affiche_ligne_du_compte  ( pTable, account_number, i );
 
                 /* ATTENTION : les sommes effectuées ici présupposent que
                    TOUS les comptes sont dans la MÊME DEVISE !!!!!        */
@@ -485,6 +489,15 @@
             list_tmp = list_tmp -> next;
         }
 
+        /* affichage des soldes partiels s'ils existent */
+        list_tmp = gsb_data_partial_balance_get_list ( );
+        if ( list_tmp )
+        {
+            gint nbre_lignes = g_slist_length ( list_tmp) + 2;
+            gtk_table_resize ( GTK_TABLE ( pTable ), nb_comptes_bancaires + 3 + nbre_lignes, 3 );
+            affiche_soldes_partiels ( pTable, i, list_tmp );
+            i += nbre_lignes;
+        }
         /* Création et remplissage de la (nb_comptes + 3)ième ligne du tableau :
            elle contient la somme des soldes de chaque compte */
         affiche_solde_des_comptes ( pTable, i, nb_comptes_bancaires, currency_number, 
@@ -536,7 +549,7 @@
              gsb_data_account_get_kind (account_number) == GSB_TYPE_LIABILITIES )
             {
                 /* on affiche la ligne du compte avec les soldes pointé et courant */
-                gsb_main_page_affiche_table_des_comptes ( pTable, account_number, i );
+                gsb_main_page_affiche_ligne_du_compte  ( pTable, account_number, i );
 
                 /* ATTENTION : les sommes effectuées ici présupposent que
                    TOUS les comptes sont dans la MÊME DEVISE !!!!!        */
@@ -601,7 +614,7 @@
              gsb_data_account_get_kind (account_number) == GSB_TYPE_ASSET )
             {
                 /* on affiche la ligne du compte avec les soldes pointé et courant */
-                gsb_main_page_affiche_table_des_comptes ( pTable, account_number, i );
+                gsb_main_page_affiche_ligne_du_compte ( pTable, account_number, i );
 
                 /* ATTENTION : les sommes effectuées ici présupposent que
                    TOUS les comptes sont dans la MÊME DEVISE !!!!!        */
@@ -712,14 +725,15 @@
 
 }
 /**
+ * Affiche une ligne pour le compte donné en paramètre
  * 
- * 
- *
- * \param
+ * \param table
+ * \param account number
+ * \param ligne dans la table
  *
  * \return FALSE
  * */
-void gsb_main_page_affiche_table_des_comptes ( GtkWidget *pTable,
+void gsb_main_page_affiche_ligne_du_compte ( GtkWidget *pTable,
                         gint account_number,
                         gint i )
 {
@@ -790,7 +804,7 @@
     }
     gtk_widget_set_style ( pLabel, pStyleLabelSoldePointe );
 
-    /* Création d'une boite à évènement qui sera rattachée au solde courant du compte */
+    /* Création d'une boite à évènement qui sera rattachée au solde pointé du compte */
     pEventBox = gtk_event_box_new ();
     g_signal_connect ( G_OBJECT ( pEventBox ),
                  "enter-notify-event",
@@ -842,7 +856,7 @@
     }
     gtk_widget_set_style ( pLabel, pStyleLabelSoldeCourant );
 
-    /* Création d'une boite à évènement qui sera rattachée au solde pointé du compte */
+    /* Création d'une boite à évènement qui sera rattachée au solde courant du compte */
     pEventBox = gtk_event_box_new ();
     g_signal_connect ( G_OBJECT ( pEventBox ),
                  "enter-notify-event",
@@ -857,19 +871,86 @@
                     G_CALLBACK (gsb_main_page_click_on_account),
                     GINT_TO_POINTER (account_number) );
     gtk_table_attach_defaults ( GTK_TABLE ( pTable ), pEventBox,
-                    2, 4, i, i+1 );
+                    2, 3, i, i+1 );
     gtk_widget_show ( pEventBox );
     gtk_container_add ( GTK_CONTAINER ( pEventBox ), pLabel );
     gtk_widget_show ( pLabel );
+}
 
-    //~ /* ATTENTION : les sommes effectuées ici présupposent que
-       //~ TOUS les comptes sont dans la MÊME DEVISE !!!!!        */
-    //~ solde_global_courant = gsb_real_add ( solde_global_courant,
-                          //~ gsb_data_account_get_current_balance (account_number));
-    //~ solde_global_pointe = gsb_real_add ( solde_global_pointe,
-                         //~ gsb_data_account_get_marked_balance (account_number));
 
+/**
+ * Création de ou des lignes de solde partiels 
+ *
+ * */
+void affiche_soldes_partiels ( GtkWidget *table,
+                        gint i,
+                        GSList *liste )
+{
+    GtkWidget *label;
+    gchar *tmpstr;
+
+    /* on commence par une ligne vide */
+    label = gtk_label_new ( chaine_espace );
+    gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group_accueil ), label );
+    gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
+	gtk_widget_show ( label );
+    i ++;
+
+    /* On met les titres du sous ensemble solde(s) partiel(s) */
+    if ( g_slist_length ( liste ) == 1 )
+        label = gtk_label_new ( COLON(_("Partial balance")));
+    else
+        label = gtk_label_new ( COLON(_("Partial balances")));
+	gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_LEFT, MISC_VERT_CENTER );
+    gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group_accueil ), label );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
+	gtk_widget_show ( label );
+    	label = gtk_label_new (_("Reconciled balance"));
+	gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 1, 2, i, i+1 );
+	gtk_widget_show ( label );
+	label = gtk_label_new (_("Current balance"));
+	gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 2, 4, i, i+1 );
+	gtk_widget_show ( label );
+    i ++;
     
+    while ( liste )
+    {
+        gint partial_number;
+
+        partial_number = gsb_data_partial_balance_get_number ( liste -> data );
+
+        /* Première colonne : elle contient le nom du solde partiel */
+        tmpstr = g_strconcat ( gsb_data_partial_balance_get_name ( partial_number ),
+                        " : ", NULL );
+        label = gtk_label_new ( tmpstr );
+        g_free ( tmpstr );
+        gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_LEFT, MISC_VERT_CENTER );
+        gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group_accueil ), label );
+        gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
+        gtk_widget_show ( label );
+
+        /* Deuxième colonne : elle contient le solde pointé du solde partiel */
+        tmpstr = gsb_data_partial_balance_get_marked_balance ( partial_number );
+        label = gtk_label_new ( tmpstr );
+        g_free ( tmpstr );
+        gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
+        gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 1, 2, i, i+1 );
+        gtk_widget_show ( label );
+
+        /* Troisième colonne : elle contient le solde courant du solde partiel */
+        tmpstr = gsb_data_partial_balance_get_current_balance ( partial_number );
+        label = gtk_label_new ( tmpstr );
+        g_free ( tmpstr );
+        gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
+        gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 2, 3, i, i+1 );
+        gtk_widget_show ( label );
+
+        i++;
+        liste = liste -> next;
+    }
 }
 
 
@@ -891,7 +972,7 @@
     label = gtk_label_new ( chaine_espace );
     gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group_accueil ), label );
     gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
-	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i+1, i+2 );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
 	gtk_widget_show ( label );
     i ++;
 
@@ -902,8 +983,7 @@
         label = gtk_label_new ( COLON(_("Global balances")));
 	gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_LEFT, MISC_VERT_CENTER );
     gtk_size_group_add_widget ( GTK_SIZE_GROUP ( size_group_accueil ), label );
-	gtk_table_attach_defaults ( GTK_TABLE ( table ), label,
-				    0, 1, i+1, i+2 );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 0, 1, i, i+1 );
 	gtk_widget_show ( label );
 
 	/* Deuxième colonne : elle contient le solde total pointé des comptes */
@@ -912,8 +992,7 @@
 	label = gtk_label_new ( tmpstr );
 	g_free ( tmpstr );
 	gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
-	gtk_table_attach_defaults ( GTK_TABLE ( table ), label,
-				    1, 2, i+1, i+2 );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 1, 2, i, i+1 );
 	gtk_widget_show ( label );
 
 	/* Troisième colonne : elle contient le solde total courant des comptes */
@@ -921,8 +1000,7 @@
 	label = gtk_label_new ( tmpstr );
 	g_free ( tmpstr );
 	gtk_misc_set_alignment ( GTK_MISC ( label ), MISC_RIGHT, MISC_VERT_CENTER );
-	gtk_table_attach_defaults ( GTK_TABLE ( table ), label,
-				    2, 4, i+1, i+2 );
+	gtk_table_attach_defaults ( GTK_TABLE ( table ), label, 2, 3, i, i+1 );
 	gtk_widget_show ( label );
 }
 /* ************************************************************************* */
@@ -1513,9 +1591,6 @@
 }
 /* ************************************************************************* */
 
-
-
-
 void update_fin_comptes_passifs ( gboolean force )
 {
     GtkWidget *vbox;
@@ -1667,20 +1742,21 @@
 /* *******************************************************************************/
 /* page de configuration pour la page d'accueil */
 /* *******************************************************************************/
-/*GtkWidget *onglet_accueil (void)
+GtkWidget *onglet_accueil (void)
 {
     GtkWidget *vbox_pref, *paddingbox;
 
-    vbox_pref = new_vbox_with_title_and_icon ( _("Main page"), "grisbi.png" );
+    vbox_pref = new_vbox_with_title_and_icon ( _("Configuration of the main page"),
+                        "grisbi.png" );
 
-    !* Data import settings *!
+    /* Data import settings */
     paddingbox = new_paddingbox_with_title (vbox_pref, FALSE, 
-                        _("Preferences from the list of accounts") );
+                        _("Balances partial of the list of bank accounts") );
 
     gtk_widget_show_all ( vbox_pref );
 
     return ( vbox_pref );
-}*/
+}
 
 
 /* Local Variables: */

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -d -r1.184 -r1.185
--- gsb_file_load.c	8 Jul 2009 22:18:21 -0000	1.184
+++ gsb_file_load.c	22 Jul 2009 19:45:42 -0000	1.185
@@ -41,6 +41,7 @@
 #include "./gsb_data_form.h"
 #include "./gsb_data_fyear.h"
 #include "./gsb_data_import_rule.h"
+#include "./gsb_data_partial_balance.h"
 #include "./gsb_data_payee.h"
 #include "./gsb_data_payment.h"
 #include "./gsb_data_print_config.h"
@@ -108,6 +109,8 @@
                         const gchar **attribute_values );
 static void gsb_file_load_logo_accueil ( const gchar **attribute_names,
                         const gchar **attribute_values );
+static void gsb_file_load_partial_balance ( const gchar **attribute_names,
+                        const gchar **attribute_values );
 static void gsb_file_load_party ( const gchar **attribute_names,
                         const gchar **attribute_values );
 static void gsb_file_load_payment_part ( const gchar **attribute_names,
@@ -604,6 +607,14 @@
     }
 
     if ( !strcmp ( element_name,
+                        "Partial_balance" ))
+    {
+    gsb_file_load_partial_balance ( attribute_names,
+                        attribute_values );
+    return;
+    }
+
+    if ( !strcmp ( element_name,
                         "Report" ))
     {
     gsb_file_load_report ( attribute_names,
@@ -971,7 +982,11 @@
         g_strfreev ( pointeur_char );
         }
     }
-
+    else if ( !strcmp ( attribute_names[i],
+                        "Metatree_sort_transactions" ))
+    {
+        etat.metatree_sort_transactions = utils_str_atoi( attribute_values[i]);
+    }
 
     i++;
     }
@@ -3404,6 +3419,89 @@
     while ( attribute_names[i] );
 }
 
+
+/**
+ * load the partial balance structure in the grisbi file
+ *
+ * \param attribute_names
+ * \param attribute_values
+ *
+ * */
+void gsb_file_load_partial_balance ( const gchar **attribute_names,
+                        const gchar **attribute_values )
+{
+    gint i=0;
+    gint partial_balance_number = 0;
+
+    partial_balance_number = gsb_data_partial_balance_new ( NULL );
+
+    if ( !attribute_names[i] )
+    return;
+
+    do
+    {
+    /*     we test at the beginning if the attribute_value is NULL, if yes, */
+    /*        go to the next */
+    if ( !strcmp (attribute_values[i],
+         "(null)"))
+    {
+        i++;
+        continue;
+    }
+
+    if ( !strcmp ( attribute_names[i],
+               "Nb" ))
+    {
+        partial_balance_number = gsb_data_partial_balance_set_new_number (
+                        partial_balance_number,
+                        utils_str_atoi ( attribute_values[i] ) );
+        i++;
+        continue;
+    }
+
+    if ( !strcmp ( attribute_names[i],
+               "Na" ))
+    {
+        gsb_data_partial_balance_set_name ( partial_balance_number,
+                        attribute_values[i]);
+        i++;
+        continue;
+    }
+
+    if ( !strcmp ( attribute_names[i],
+               "Acc" ))
+    {
+        gsb_data_partial_balance_set_liste_cptes ( partial_balance_number,
+                           attribute_values[i] );
+        i++;
+        continue;
+    }
+
+    if ( !strcmp ( attribute_names[i],
+                        "Kind" ))
+    {
+        gsb_data_partial_balance_set_kind ( partial_balance_number,
+                        utils_str_atoi ( attribute_values[i] ) );
+        i++;
+        continue;
+    }
+
+        if ( !strcmp ( attribute_names[i],
+                        "Currency" ))
+    {
+        gsb_data_partial_balance_set_currency ( partial_balance_number,
+                        utils_str_atoi ( attribute_values[i]));
+        i++;
+        continue;
+    }
+
+    /* normally, shouldn't come here */
+    i++;
+    }
+    while ( attribute_names[i] );
+}
+
+
 /**
  * load the report structure in the grisbi file
  *

Index: accueil.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/accueil.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- accueil.h	18 Feb 2007 12:37:12 -0000	1.15
+++ accueil.h	22 Jul 2009 19:45:42 -0000	1.16
@@ -20,5 +20,6 @@
 GtkWidget *creation_onglet_accueil ( void );
 gboolean gsb_main_page_update_finished_scheduled_transactions ( gint scheduled_number );
 void mise_a_jour_accueil ( gboolean force );
+GtkWidget *onglet_accueil (void);
 /* END_DECLARATION */
 #endif

Index: parametres.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parametres.c,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -d -r1.197 -r1.198
--- parametres.c	14 Jun 2009 19:02:20 -0000	1.197
+++ parametres.c	22 Jul 2009 19:45:43 -0000	1.198
@@ -42,26 +42,35 @@
 #include "./gsb_file.h"
 #include "./gsb_form_config.h"
 #include "./gsb_fyear_config.h"
+#include "./navigation.h"
 #include "./import.h"
 #include "./gsb_payment_method_config.h"
 #include "./gsb_reconcile_config.h"
 #include "./gsb_reconcile_sort_config.h"
 #include "./traitement_variables.h"
 #include "./utils_files.h"
+#include "./accueil.h"
 #include "./affichage_liste.h"
 #include "./affichage.h"
+#include "./tiers_onglet.h"
+#include "./categories_onglet.h"
+#include "./imputation_budgetaire.h"
 #include "./structures.h"
+#include "./fenetre_principale.h"
 #include "./include.h"
 #include "./erreur.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
 static GtkWidget * create_preferences_tree ( );
+static gboolean gsb_config_metatree_sort_transactions ( GtkWidget *checkbutton,
+                        gpointer null );
 static  GtkWidget *gsb_config_scheduler_page ( void );
 static gboolean gsb_gui_messages_toggled ( GtkCellRendererToggle *cell, gchar *path_str,
                         GtkTreeModel * model );
 static GtkWidget *onglet_fichier ( void );
 static GtkWidget *onglet_messages_and_warnings ( void );
+static GtkWidget *onglet_metatree ( void );
 static GtkWidget *onglet_programmes (void);
 static gboolean preference_selectable_func (GtkTreeSelection *selection,
                         GtkTreeModel *model,
@@ -313,6 +322,15 @@
                         -1);
     gtk_notebook_append_page (preference_frame, gsb_config_scheduler_page (), NULL);
 
+    gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);
+    gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),
+                        &iter2,
+                        0, _("Main page"),
+                        1, MAIN_PAGE,
+                        2, 400,
+                        -1);
+    gtk_notebook_append_page (preference_frame, onglet_accueil (), NULL);
+
     /* Display subtree */
     gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter, NULL);
     gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),
@@ -352,11 +370,12 @@
     gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);
     gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),
                         &iter2,
-                        0, _("Totals currencies"),
+                        0, _("Payees, categories and budgetaries"),
                         1, TOTALS_PAGE,
                         2, 400,
                         -1);
-    gtk_notebook_append_page (preference_frame, gsb_currency_config_create_totals_page(), NULL);
+    //~ gtk_notebook_append_page (preference_frame, gsb_currency_config_create_totals_page(), NULL);
+    gtk_notebook_append_page ( preference_frame, onglet_metatree (), NULL );
 
     gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter2, &iter);
     gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),
@@ -926,6 +945,67 @@
 }
 
 
+/**
+ * create the metatree config page
+ *
+ * \param
+ *
+ * \return a GtkWidget containing the page of scheduler config
+ * */
+GtkWidget *onglet_metatree ( void )
+{
+    GtkWidget *vbox_pref, *paddingbox, *total_currencies;
+
+    vbox_pref = new_vbox_with_title_and_icon ( 
+                        _("Payees, categories and budgetaries"),
+                        "sort.png" );
+
+    paddingbox = new_paddingbox_with_title ( vbox_pref, FALSE, _("Totals currencies") );
+    total_currencies = gsb_currency_config_create_totals_page ( );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), total_currencies, FALSE, FALSE, 0 );
+
+    /* tri des opérations */
+    gsb_automem_radiobutton_new_with_title ( vbox_pref,
+                        _("Sort option for transactions"),
+                        _("by number"),
+                        _("by date"),
+                        &etat.metatree_sort_transactions,
+                        G_CALLBACK (gsb_config_metatree_sort_transactions), NULL );
+
+    return vbox_pref;
+}
+
+
+gboolean gsb_config_metatree_sort_transactions ( GtkWidget *checkbutton,
+                        gpointer null )
+{
+    gint page_number;
+
+    devel_debug_int (etat.metatree_sort_transactions);
+
+    page_number = gsb_gui_navigation_get_current_page ( );
+    devel_debug_int ( page_number );
+    switch ( page_number )
+    {
+	case GSB_PAYEES_PAGE:
+		payee_fill_tree ();
+	    break;
+
+	case GSB_CATEGORIES_PAGE:
+        remplit_arbre_categ ();
+	    break;
+
+	case GSB_BUDGETARY_LINES_PAGE:
+		remplit_arbre_imputation ();
+	    break;
+
+	default:
+	    notice_debug ("B0rk page selected");
+	    break;
+    }
+
+    return FALSE;
+}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

--- NEW FILE: gsb_data_partial_balance.c ---
(This appears to be a binary file; contents omitted.)

Index: parametres.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parametres.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- parametres.h	25 May 2009 19:42:27 -0000	1.29
+++ parametres.h	22 Jul 2009 19:45:43 -0000	1.30
@@ -10,6 +10,7 @@
     IMPORT_ASSOCIATION_PAGE,
     SOFTWARE_PAGE,
     SCHEDULER_PAGE,
+    MAIN_PAGE,
     FONTS_AND_LOGO_PAGE,
     MESSAGES_AND_WARNINGS_PAGE,
     ADDRESSES_AND_TITLES_PAGE,

Index: classement_echeances.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/classement_echeances.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- classement_echeances.h	28 Jun 2009 06:41:07 -0000	1.6
+++ classement_echeances.h	22 Jul 2009 19:45:42 -0000	1.7
@@ -7,7 +7,7 @@
 /* START_DECLARATION */
 gint classement_sliste_echeance_par_date ( gint scheduled_number_1, 
                         gint scheduled_number_2 );
-gint classement_sliste_transactions_par_date ( gint transaction_number_1, 
-                        gint transaction_number_2 );
+gint classement_sliste_transactions_par_date ( gpointer transaction_pointer_1, 
+                        gpointer transaction_pointer_2 );
 /* END_DECLARATION */
 #endif

Index: classement_echeances.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/classement_echeances.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- classement_echeances.c	28 Jun 2009 06:41:07 -0000	1.11
+++ classement_echeances.c	22 Jul 2009 19:45:42 -0000	1.12
@@ -56,11 +56,23 @@
 /* ************************************************************************* */
 /* Classement de deux opérations par date                                    */
 /* ************************************************************************* */
-gint classement_sliste_transactions_par_date ( gint transaction_number_1, 
-                        gint transaction_number_2 )
+gint classement_sliste_transactions_par_date ( gpointer transaction_pointer_1, 
+                        gpointer transaction_pointer_2 )
 {
-    return ( g_date_compare ( gsb_data_transaction_get_date (transaction_number_1),
+    const GDate *date;
+    gint transaction_number_1;
+    gint transaction_number_2;
+
+    transaction_number_1 = gsb_data_transaction_get_transaction_number (
+                        transaction_pointer_1 );
+    transaction_number_2 = gsb_data_transaction_get_transaction_number (
+                        transaction_pointer_2 );
+    date = gsb_data_transaction_get_date (transaction_number_1);
+    if ( date )
+        return ( g_date_compare ( date,
                         gsb_data_transaction_get_date (transaction_number_2) ));
+    else
+        return -1;
 }
 
 /* Local Variables: */



More information about the cvs mailing list