[grisbi-cvs] grisbi/src barre_outils.c, 1.130, 1.131 barre_outils.h, 1.16, 1.17 etats_gtktable.c, 1.100, 1.101 gsb_data_account.c, 1.98, 1.99 gsb_data_account.h, 1.41, 1.42 gsb_data_archive_store.c, 1.17, 1.18 gsb_data_archive_store.h, 1.5, 1.6 gsb_data_import_rule.c, 1.3, 1.4 gsb_file_load.c, 1.210, 1.211 gsb_file_save.c, 1.156, 1.157 gsb_transactions_list.c, 1.198, 1.199 gsb_transactions_list.h, 1.38, 1.39 menu.c, 1.149, 1.150 menu.h, 1.20, 1.21 transaction_list_select.c, 1.8, 1.9

Pierre Biava pbiava at users.sourceforge.net
Sun Mar 7 16:56:07 CET 2010


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25400/src

Modified Files:
	barre_outils.c barre_outils.h etats_gtktable.c 
	gsb_data_account.c gsb_data_account.h gsb_data_archive_store.c 
	gsb_data_archive_store.h gsb_data_import_rule.c 
	gsb_file_load.c gsb_file_save.c gsb_transactions_list.c 
	gsb_transactions_list.h menu.c menu.h 
	transaction_list_select.c 
Log Message:
Add the option to show or hide the lines archives

Index: gsb_data_import_rule.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_import_rule.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gsb_data_import_rule.c	28 Sep 2008 08:30:41 -0000	1.3
+++ gsb_data_import_rule.c	7 Mar 2010 15:56:04 -0000	1.4
@@ -271,20 +271,17 @@
 gboolean gsb_data_import_rule_remove ( gint import_rule_number )
 {
     struct_import_rule *import_rule;
-    gint account;
 
     import_rule = gsb_data_import_rule_get_structure ( import_rule_number );
 
     if (!import_rule)
-	return FALSE;
+	    return FALSE;
     
     /* remove the import_rule from the list */
     import_rule_list = g_slist_remove ( import_rule_list,
 					import_rule );
 
     _gsb_data_import_rule_free (import_rule);
-    account = gsb_data_import_rule_get_account (import_rule_number);
-    gsb_gui_update_bouton_affiche_ope_r ( gsb_data_account_get_r (account) );
 
     return TRUE;
 }

Index: gsb_transactions_list.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- gsb_transactions_list.h	12 Dec 2009 18:14:39 -0000	1.38
+++ gsb_transactions_list.h	7 Mar 2010 15:56:05 -0000	1.39
@@ -64,6 +64,7 @@
 void gsb_transactions_list_selection_changed ( gint new_selected_transaction );
 gboolean gsb_transactions_list_set_row_align ( gfloat row_align );
 void gsb_transactions_list_set_visible_rows_number ( gint rows_number );
+void gsb_transactions_list_show_archives_lines ( gboolean show_l );
 void gsb_transactions_list_splitted_to_scheduled ( gint transaction_number,
                         gint scheduled_number );
 gboolean gsb_transactions_list_switch_expander ( gint transaction_number );

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -d -r1.210 -r1.211
--- gsb_file_load.c	6 Mar 2010 22:34:12 -0000	1.210
+++ gsb_file_load.c	7 Mar 2010 15:56:04 -0000	1.211
@@ -1533,6 +1533,15 @@
     }
 
     if ( !strcmp ( attribute_names[i],
+                        "Show_archives_lines" ))
+    {
+        gsb_data_account_set_l ( account_number,
+                        utils_str_atoi (attribute_values[i]));
+        i++;
+        continue;
+    }
+
+    if ( !strcmp ( attribute_names[i],
                         "Lines_per_transaction" ))
     {
         gsb_data_account_set_nb_rows ( account_number, 

Index: barre_outils.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/barre_outils.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- barre_outils.h	10 Sep 2008 08:39:53 -0000	1.16
+++ barre_outils.h	7 Mar 2010 15:56:04 -0000	1.17
@@ -7,7 +7,6 @@
 /* START_DECLARATION */
 gboolean change_aspect_liste ( gint demande );
 GtkWidget *creation_barre_outils_echeancier ( void );
-void gsb_gui_update_bouton_affiche_ope_r ( gboolean show_r );
 void gsb_gui_update_transaction_toolbar ( void );
 /* END_DECLARATION */
 #endif

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -d -r1.156 -r1.157
--- gsb_file_save.c	6 Mar 2010 22:34:13 -0000	1.156
+++ gsb_file_save.c	7 Mar 2010 15:56:04 -0000	1.157
@@ -1032,6 +1032,7 @@
 					       "\t\tMinimum_authorised_balance=\"%s\"\n"
 					       "\t\tClosed_account=\"%d\"\n"
 					       "\t\tShow_marked=\"%d\"\n"
+					       "\t\tShow_archives_lines=\"%d\"\n"
 					       "\t\tLines_per_transaction=\"%d\"\n"
 					       "\t\tComment=\"%s\"\n"
 					       "\t\tOwner_address=\"%s\"\n"
@@ -1070,6 +1071,7 @@
 	    my_safe_null_str(mini_auto),
 	    gsb_data_account_get_closed_account (account_number),
 	    gsb_data_account_get_r (account_number),
+	    gsb_data_account_get_l ( account_number ),
 	    gsb_data_account_get_nb_rows (account_number),
 	    my_safe_null_str(gsb_data_account_get_comment (account_number)),
 	    my_safe_null_str(gsb_data_account_get_holder_address (account_number)),

Index: barre_outils.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/barre_outils.c,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- barre_outils.c	28 Jan 2010 20:25:12 -0000	1.130
+++ barre_outils.c	7 Mar 2010 15:56:04 -0000	1.131
@@ -44,6 +44,7 @@
 #include "./utils_buttons.h"
 #include "./structures.h"
 #include "./include.h"
+#include "./erreur.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -59,8 +60,8 @@
 /** Used to display/hide comments in scheduler list */
 static GtkWidget *scheduler_display_hide_comments = NULL;
 
-/* display/hide marked transactions */
-static GtkWidget * bouton_affiche_ope_r = NULL;
+//~ /* display/hide marked transactions */
+//~ static GtkWidget * bouton_affiche_ope_r = NULL;
 
 /** here are the 3 buttons on the scheduler toolbar
  * which can been unsensitive or sensitive */
@@ -216,6 +217,7 @@
 						   gpointer null )
 {
     GtkWidget *menu, *menu_item;
+    gint current_account;
 
     menu = gtk_menu_new ();
 
@@ -241,19 +243,34 @@
 
     gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new ( ) );
 
-    menu_item = gtk_check_menu_item_new_with_label ( _("Display reconciled transactions (Alt+R)") );
+    current_account = gsb_gui_navigation_get_current_account ( );
+
+    menu_item = gtk_check_menu_item_new_with_label ( _("Show reconciled transactions") );
     gtk_check_menu_item_set_active ( GTK_CHECK_MENU_ITEM (menu_item),
-				     gsb_data_account_get_r ( gsb_gui_navigation_get_current_account () ) );
+				        gsb_data_account_get_r ( current_account ) );
     gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
-			       G_CALLBACK (gsb_gui_toggle_show_reconciled), GINT_TO_POINTER (4) );
+    g_signal_connect ( G_OBJECT ( menu_item ),
+                        "activate", 
+			            G_CALLBACK ( gsb_gui_toggle_show_reconciled ),
+                        NULL );
+
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new ( ) );
+
+    menu_item = gtk_check_menu_item_new_with_label ( _("Show lines archives") );
+    gtk_check_menu_item_set_active ( GTK_CHECK_MENU_ITEM (menu_item),
+				        gsb_data_account_get_l ( current_account ) );
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+    g_signal_connect ( G_OBJECT ( menu_item ),
+                        "activate", 
+			            G_CALLBACK ( gsb_gui_toggle_show_archived ),
+                        NULL );
 
     gtk_menu_set_active ( GTK_MENU(menu), 
 			  gsb_data_account_get_nb_rows ( gsb_gui_navigation_get_current_account () ) );
 
     gtk_widget_show_all ( menu );
-    gtk_menu_popup ( GTK_MENU(menu), NULL, button, set_popup_position, button, 1, 
-		     gtk_get_current_event_time());
+    gtk_menu_popup ( GTK_MENU( menu ), NULL, button, set_popup_position, button, 1, 
+		     gtk_get_current_event_time ( ) );
 
     return FALSE;
 }
@@ -323,32 +340,36 @@
 	/* 	1, 2, 3 et 4 sont les nb de lignes qu'on demande à afficher */
 
 	case 1 :
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, 
-											  menu_name ( "ViewMenu", "ShowOneLine", NULL ) ) ), 
-					   TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+					    menu_name ( "ViewMenu", "ShowOneLine", NULL ) ) ), 
+					    TRUE );
 	    gsb_transactions_list_set_visible_rows_number ( demande );
 	    if ( etat.modification_fichier == 0 )
             modification_fichier ( TRUE );
 	    break;
 	case 2 :
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, 
-											  menu_name ( "ViewMenu", "ShowTwoLines", NULL ) ) ), 
-					   TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+					    menu_name ( "ViewMenu", "ShowTwoLines", NULL ) ) ), 
+					    TRUE );
 	    gsb_transactions_list_set_visible_rows_number ( demande );
 	    if ( etat.modification_fichier == 0 )
             modification_fichier ( TRUE );
 	    break;
 	case 3 :
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, 
-											  menu_name ( "ViewMenu", "ShowThreeLines", NULL ) ) ), 
-					   TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+					    menu_name ( "ViewMenu", "ShowThreeLines", NULL ) ) ), 
+					    TRUE );
 	    gsb_transactions_list_set_visible_rows_number ( demande );
 	    if ( etat.modification_fichier == 0 )
             modification_fichier ( TRUE );
 	    break;
 	case 4 :
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, 
-											  menu_name ( "ViewMenu", "ShowFourLines", NULL ) ) ), 
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+					    menu_name ( "ViewMenu", "ShowFourLines", NULL ) ) ), 
 					   TRUE );
 	    gsb_transactions_list_set_visible_rows_number ( demande );
 	    if ( etat.modification_fichier == 0 )
@@ -364,9 +385,10 @@
             modification_fichier ( TRUE );
 
 	    block_menu_cb = TRUE;
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, 
-											  menu_name ( "ViewMenu", "ShowReconciled", NULL ) ) ), 
-					   TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+					    menu_name ( "ViewMenu", "ShowReconciled", NULL ) ) ), 
+					    TRUE );
 	    block_menu_cb = FALSE;
 
 	    break;
@@ -380,9 +402,43 @@
             modification_fichier ( TRUE );
 
 	    block_menu_cb = TRUE;
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, 
-											  menu_name ( "ViewMenu", "ShowReconciled", NULL ) ) ), 
-					   FALSE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+					    menu_name ( "ViewMenu", "ShowReconciled", NULL ) ) ), 
+					    FALSE );
+	    block_menu_cb = FALSE;
+
+	    break;
+	case 7 :
+
+	    /* show archive lines */
+
+	    gsb_transactions_list_show_archives_lines ( 1 );
+	    if ( etat.modification_fichier == 0 )
+            modification_fichier ( TRUE );
+
+	    block_menu_cb = TRUE;
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+						menu_name ( "ViewMenu", "ShowArchived", NULL ) ) ), 
+					    TRUE );
+	    block_menu_cb = FALSE;
+
+	    break;
+
+	case 8 :
+
+	    /* hide archive lines */
+
+	    gsb_transactions_list_show_archives_lines ( 0 );
+	    if ( etat.modification_fichier == 0 )
+            modification_fichier ( TRUE );
+
+	    block_menu_cb = TRUE;
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, 
+					    menu_name ( "ViewMenu", "ShowArchived", NULL ) ) ), 
+					    FALSE );
 	    block_menu_cb = FALSE;
 
 	    break;
@@ -524,38 +580,6 @@
 
 
 
-/* ajouté pour la gestion des boutons afficher/masquer les opérations rapprochées */
-void gsb_gui_update_bouton_affiche_ope_r ( gboolean show_r )
-{
-    if (show_r)
-    {
-	bouton_affiche_ope_r = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-								  _("Mask reconcile"),
-								  "hide_r.png",
-								  G_CALLBACK (gsb_gui_toggle_show_reconciled),
-								  NULL );
-#if GTK_CHECK_VERSION(2,12,0)
-	gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_affiche_ope_r),
-				      SPACIFY(_("Mask reconciled transactions")));
-#endif
-    }
-    else
-    {
-	bouton_affiche_ope_r = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-								  _("Display reconcile"),
-								  "show_r.png",
-								  G_CALLBACK (gsb_gui_toggle_show_reconciled),
-								  NULL );
-#if GTK_CHECK_VERSION(2,12,0)
-	gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_affiche_ope_r),
-				      SPACIFY(_("Display reconciled transactions")));
-#endif
-    }
-    gsb_gui_update_transaction_toolbar ( );
-
-}
-
-
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: gsb_data_archive_store.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_archive_store.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- gsb_data_archive_store.c	12 Dec 2009 18:14:39 -0000	1.17
+++ gsb_data_archive_store.c	7 Mar 2010 15:56:04 -0000	1.18
@@ -490,3 +490,27 @@
 }
 
 
+gsb_real gsb_data_archive_store_get_archives_balance ( gint account_number )
+{
+    GSList *tmp_list;
+    gsb_real balance = null_real;
+
+    tmp_list = gsb_data_archive_store_get_archives_list ( );
+
+    while (tmp_list)
+    {
+        struct_store_archive *archive_store;
+
+        archive_store = tmp_list -> data;
+
+        if ( archive_store -> account_number == account_number )
+            balance = gsb_real_add ( balance, archive_store -> balance );
+
+        tmp_list = tmp_list -> next;
+    }
+
+    return balance;
+}
+/* Local Variables: */
+/* c-basic-offset: 4 */
+/* End: */

Index: etats_gtktable.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_gtktable.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- etats_gtktable.c	29 Aug 2009 08:36:41 -0000	1.100
+++ etats_gtktable.c	7 Mar 2010 15:56:04 -0000	1.101
@@ -312,7 +312,6 @@
 	     !gsb_data_account_get_r ( account_number ) )
     {
         gsb_data_account_set_r ( account_number, TRUE );
-        gsb_gui_update_bouton_affiche_ope_r ( TRUE );
         gsb_menu_update_view_menu ( account_number );
         mise_a_jour_affichage_r ( TRUE );
     }

Index: gsb_data_account.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_account.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- gsb_data_account.c	6 Mar 2010 22:34:12 -0000	1.98
+++ gsb_data_account.c	7 Mar 2010 15:56:04 -0000	1.99
@@ -75,6 +75,7 @@
     /** @name showed list stuff */
     gint 	show_r;                      /**< 1 : reconciled transactions are showed */
     gint 	nb_rows_by_transaction;      /**< 1, 2, 3, 4  */
+    gint    show_l;                     /** 1 archived lines are showed */
 
     /** @name remaining of the balances */
     gsb_real 	init_balance;
@@ -555,6 +556,48 @@
 
 
 /**
+ * return if archives Lines are displayed in the account asked
+ * 
+ * \param account_number no of the account
+ * 
+ * \return boolean show/not show L
+ * */
+gboolean gsb_data_account_get_l ( gint account_number )
+{
+    struct_account *account;
+
+    account = gsb_data_account_get_structure ( account_number );
+
+    if ( !account )
+	    return 0;
+
+    return account -> show_l;
+}
+
+/**
+ * set if archives lines are displayed in the account asked
+ * 
+ * \param account_number no of the account
+ * \param show_l boolean
+ * 
+ * \return TRUE, ok ; FALSE, problem
+ * */
+gboolean gsb_data_account_set_l ( gint account_number,
+                        gboolean show_l )
+{
+    struct_account *account;
+
+    account = gsb_data_account_get_structure ( account_number );
+
+    if ( !account )
+	    return FALSE;
+
+    account -> show_l = show_l;
+    return TRUE;
+}
+
+
+/**
  * return if R are displayed in the account asked
  * 
  * \param account_number no of the account
@@ -592,6 +635,7 @@
 	return FALSE;
 
     account -> show_r = show_r;
+
     return TRUE;
 }
 
@@ -3013,5 +3057,6 @@
 
     return TRUE;
 }
-
-
+/* Local Variables: */
+/* c-basic-offset: 4 */
+/* End: */

Index: menu.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/menu.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- menu.h	10 Sep 2008 08:39:54 -0000	1.20
+++ menu.h	7 Mar 2010 15:56:05 -0000	1.21
@@ -23,7 +23,8 @@
 gboolean gsb_gui_sensitive_menu_item ( gchar * root_menu_name, gchar * submenu_name,
 				       gchar * subsubmenu_name, gboolean state );
 gboolean gsb_gui_sensitive_menu_item_from_string ( gchar * item_name, gboolean state );
-gboolean gsb_gui_toggle_show_reconciled ();
+gboolean gsb_gui_toggle_show_archived ( void );
+gboolean gsb_gui_toggle_show_reconciled ( void );
 gboolean gsb_menu_transaction_operations_set_sensitive ( gboolean sensitive );
 gboolean gsb_menu_update_accounts_in_menus ( void );
 gboolean gsb_menu_update_view_menu ( gint account_number );

Index: menu.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/menu.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -d -r1.149 -r1.150
--- menu.c	4 Feb 2010 20:04:51 -0000	1.149
+++ menu.c	7 Mar 2010 15:56:05 -0000	1.150
@@ -58,13 +58,13 @@
 /*START_STATIC*/
 static void gsb_gui_toggle_line_view_mode ( GtkRadioAction * action, GtkRadioAction *current, 
 				     gpointer user_data );
-static gboolean gsb_gui_toggle_show_closed_accounts ();
-static gboolean gsb_gui_toggle_show_form ();
-static gboolean help_bugreport ();
-static gboolean help_manual ();
-static gboolean help_quick_start ();
-static gboolean help_translation ();
-static gboolean help_website ();
+static gboolean gsb_gui_toggle_show_closed_accounts ( void );
+static gboolean gsb_gui_toggle_show_form ( void );
+static gboolean help_bugreport ( void );
+static gboolean help_manual ( void );
+static gboolean help_quick_start ( void );
+static gboolean help_translation ( void );
+static gboolean help_website ( void );
 static  void menu_add_widget (GtkUIManager * p_uiManager, GtkWidget * p_widget, 
 			     GtkContainer * p_box) ;
 /*END_STATIC*/
@@ -128,6 +128,7 @@
 "    <menu action='ViewMenu'>"
 "      <menuitem action='ShowTransactionForm'/>"
 "      <menuitem action='ShowReconciled'/>"
+"      <menuitem action='ShowArchived'/>"
 "      <menuitem action='ShowClosed'/>"
 "      <separator/>"
 "      <menuitem action='ShowOneLine'/>"
@@ -295,7 +296,11 @@
 	  etat.formulaire_toujours_affiche },
 	{ "ShowReconciled",	NULL,			_("Show _reconciled"),
 	  "<Alt>R", 
-	  NULL,			G_CALLBACK ( gsb_gui_toggle_show_reconciled),
+	  NULL,			G_CALLBACK ( gsb_gui_toggle_show_reconciled ),
+	  0 },
+	{ "ShowArchived",	NULL,			_("Show _lines archives"),
+	  "<Alt>L", 
+	  NULL,			G_CALLBACK ( gsb_gui_toggle_show_archived ),
 	  0 },
 	{ "ShowClosed",		NULL,			_("Show _closed accounts"),
 	  NULL,			NULL,			G_CALLBACK ( gsb_gui_toggle_show_closed_accounts ),
@@ -404,7 +409,7 @@
  *
  * \return FALSE
  */
-gboolean help_manual ()
+gboolean help_manual ( void )
 {
     gchar *lang = _("en");
     gchar *string;
@@ -436,7 +441,7 @@
  *
  * \return FALSE
  */
-gboolean help_quick_start ()
+gboolean help_quick_start ( void )
 {
     gchar *lang = _("en");
 
@@ -456,7 +461,7 @@
  *
  * \return FALSE
  */
-gboolean help_translation ()
+gboolean help_translation ( void )
 {
     gchar *lang = _("en");
 
@@ -475,7 +480,7 @@
  *
  * \return FALSE
  */
-gboolean help_website ()
+gboolean help_website ( void )
 {
     lance_navigateur_web ( "http://www.grisbi.org/" );
 
@@ -489,7 +494,7 @@
  *
  * \return FALSE
  */
-gboolean help_bugreport ()
+gboolean help_bugreport ( void )
 {
     lance_navigateur_web ( "http://www.grisbi.org/bugtracking/" );
 
@@ -601,7 +606,7 @@
  *
  * \return FALSE
  */
-gboolean gsb_gui_toggle_show_form ()
+gboolean gsb_gui_toggle_show_form ( void )
 {
     devel_debug (NULL);
 
@@ -620,27 +625,57 @@
  *
  * \return FALSE
  */
-gboolean gsb_gui_toggle_show_reconciled ()
+gboolean gsb_gui_toggle_show_reconciled ( void )
 {
+    gint current_account;
+
     if ( block_menu_cb )
-	return FALSE;
+	    return FALSE;
 
-    if ( gsb_data_account_get_r ( gsb_gui_navigation_get_current_account () ) )
-	change_aspect_liste(6);
+    current_account = gsb_gui_navigation_get_current_account ( );
+    if ( current_account == -1 )
+        return FALSE;
+
+    if ( gsb_data_account_get_r ( current_account ) )
+	    change_aspect_liste ( 6 );
     else
-	change_aspect_liste(5);
+	    change_aspect_liste ( 5 );
 
     return FALSE;
 }
 
 
+/**
+ * Show or hide display of lines archives.
+ *
+ * \return FALSE
+ */
+gboolean gsb_gui_toggle_show_archived ( void )
+{
+    gint current_account;
+
+    if ( block_menu_cb )
+	    return FALSE;
+
+    current_account = gsb_gui_navigation_get_current_account ( );
+    if ( current_account == -1 )
+        return FALSE;
+
+    if ( gsb_data_account_get_l ( current_account ) )
+	    change_aspect_liste ( 8 );
+    else
+	    change_aspect_liste ( 7 );
+
+    return FALSE;
+}
+
 
 /**
  * Show or hide closed accounts.
  *
  * \return FALSE
  */
-gboolean gsb_gui_toggle_show_closed_accounts ()
+gboolean gsb_gui_toggle_show_closed_accounts ( void )
 {
     etat.show_closed_accounts = ! etat.show_closed_accounts;
 
@@ -673,17 +708,23 @@
 
     /* update the showing of reconciled transactions */
     tmpstr = menu_name ( "ViewMenu", "ShowReconciled", NULL );
-    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, tmpstr)), 
-				   gsb_data_account_get_r (account_number) );
+    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, tmpstr) ), 
+				        gsb_data_account_get_r ( account_number ) );
     g_free ( tmpstr );
 
     tmpstr = menu_name ( "ViewMenu", "ShowTransactionForm", NULL );
-    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, tmpstr)), 
-				   gsb_form_is_visible () );
+    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, tmpstr) ), 
+				        gsb_form_is_visible ( ) );
     g_free ( tmpstr );
 
-    /* update the toggle button to show marked transactions */
-    gsb_gui_update_bouton_affiche_ope_r ( gsb_data_account_get_r (account_number) );
+    /* update the showing of reconciled transactions */
+    tmpstr = menu_name ( "ViewMenu", "ShowArchived", NULL );
+    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, tmpstr) ), 
+				        gsb_data_account_get_l ( account_number ) );
+    g_free ( tmpstr );
 
     /* update the number of line showed */
     switch ( gsb_data_account_get_nb_rows (account_number))
@@ -703,8 +744,9 @@
 	    break;
     }
 
-    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (gtk_ui_manager_get_action ( ui_manager, item_name )),
-				   TRUE );
+    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager, item_name ) ),
+				        TRUE );
     g_free ( item_name );
 
     block_menu_cb = FALSE;

Index: gsb_transactions_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_transactions_list.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -d -r1.198 -r1.199
--- gsb_transactions_list.c	7 Mar 2010 07:58:04 -0000	1.198
+++ gsb_transactions_list.c	7 Mar 2010 15:56:04 -0000	1.199
@@ -1071,32 +1071,38 @@
     gsb_real solde;
     GSList *list_tmp_transactions;
 
-    solde = gsb_data_account_get_init_balance (account_number,
-					       floating_point );
+    solde = gsb_data_account_get_init_balance ( account_number, floating_point );
 
-    if ( gsb_data_account_get_r (account_number) )
-	return solde;
+    if ( gsb_data_account_get_l ( account_number ) == 0 )
+        solde = gsb_real_add ( solde,
+                        gsb_data_archive_store_get_archives_balance ( account_number ) );
+
+    if ( gsb_data_account_get_r ( account_number ) )
+	    return solde;
 
     /* the marked R transactions are not showed, add their balance to the initial balance */
     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);
+        gint transaction_number_tmp;
+        transaction_number_tmp = gsb_data_transaction_get_transaction_number (
+                        list_tmp_transactions -> data);
 
-	/* 	si l'opé est ventilée ou non relevée, on saute */
+        /* 	si l'opé est ventilée ou non relevée, on saute */
 
-	if ( gsb_data_transaction_get_account_number (transaction_number_tmp) == account_number
-	     &&
-	     !gsb_data_transaction_get_mother_transaction_number (transaction_number_tmp)
-	     &&
-	     gsb_data_transaction_get_marked_transaction (transaction_number_tmp) == OPERATION_RAPPROCHEE )
-	    solde = gsb_real_add ( solde,
-				   gsb_data_transaction_get_adjusted_amount (transaction_number_tmp,
-									     floating_point ));
-	list_tmp_transactions = list_tmp_transactions -> next;
+        if ( gsb_data_transaction_get_account_number (transaction_number_tmp) == account_number
+             &&
+             !gsb_data_transaction_get_mother_transaction_number (transaction_number_tmp)
+             &&
+             gsb_data_transaction_get_marked_transaction (transaction_number_tmp) == OPERATION_RAPPROCHEE )
+            solde = gsb_real_add ( solde,
+                        gsb_data_transaction_get_adjusted_amount ( transaction_number_tmp,
+                        floating_point ) );
+
+        list_tmp_transactions = list_tmp_transactions -> next;
     }
+
     return ( solde );
 }
 /******************************************************************************/
@@ -1574,6 +1580,7 @@
         }
 	    else
 	        return FALSE;
+        g_free ( tmp_str );
     }
     else
 	    /* it's a normal transaction, ask to be sure */
@@ -3109,9 +3116,10 @@
     /* 	if etat.retient_affichage_par_compte is set, only gsb_gui_navigation_get_current_account () will change */
     /* 	else, all the accounts change */
 
-    if ( show_r == gsb_data_account_get_r (current_account))
+    if ( show_r == gsb_data_account_get_r ( current_account ) )
     {
         gsb_transactions_list_update_tree_view ( current_account, show_r );
+        gsb_menu_update_view_menu ( current_account );
         return;
     }
 
@@ -3128,20 +3136,68 @@
 	    gint i;
 
 	    i = gsb_data_account_get_no_account ( list_tmp -> data );
-	    gsb_data_account_set_r ( i,
-				     show_r );
+	    gsb_data_account_set_r ( i, show_r );
 
 	    list_tmp = list_tmp -> next;
 	}
     }
     gsb_transactions_list_update_tree_view ( current_account, show_r );
+    gsb_menu_update_view_menu ( current_account );
 
-    /* update the button in toolbar */
-    gsb_gui_update_bouton_affiche_ope_r ( show_r );
     return;
 }
 
 
+/**
+ * switch the view between show the reconciled transactions or not
+ *
+ * \param show_r	TRUE or FALSE
+ *
+ * \return
+ * */
+void gsb_transactions_list_show_archives_lines ( gboolean show_l )
+{
+    gint current_account;
+
+    devel_debug_int ( show_l );
+
+    current_account = gsb_gui_navigation_get_current_account ( );
+
+    /*  we check all the accounts */
+    /* 	if etat.retient_affichage_par_compte is set, only gsb_gui_navigation_get_current_account () will change */
+    /* 	else, all the accounts change */
+
+    if ( show_l == gsb_data_account_get_l ( current_account ) )
+    {
+        gsb_transactions_list_update_tree_view ( current_account, show_l );
+            return;
+    }
+
+    gsb_data_account_set_l ( current_account, show_l );
+
+    if ( !etat.retient_affichage_par_compte )
+    {
+        GSList *list_tmp;
+
+        list_tmp = gsb_data_account_get_list_accounts ( );
+
+        while ( list_tmp )
+        {
+            gint i;
+
+            i = gsb_data_account_get_no_account ( list_tmp -> data );
+            gsb_data_account_set_l ( i, show_l );
+
+            list_tmp = list_tmp -> next;
+        }
+    }
+    gsb_transactions_list_update_tree_view ( current_account, show_l );
+
+    /* update the menu */
+    //~ gsb_gui_update_bouton_affiche_ope_l ( show_l );
+    return;
+}
+
 
 /**
  * called to change the number of visible rows
@@ -3217,7 +3273,13 @@
 
     /* first check if it's an archive, if yes and good account, always show it */
     if (what_is_line == IS_ARCHIVE)
-	return ( gsb_data_archive_store_get_account_number (gsb_data_archive_store_get_number (transaction_ptr)) == account_number);
+    {
+        if ( gsb_data_account_get_l ( account_number ) )
+	        return ( gsb_data_archive_store_get_account_number (
+                        gsb_data_archive_store_get_number (transaction_ptr)) == account_number);
+        else
+            return FALSE;
+    }
 
     /* we don't check now for the separator, because it won't be shown if the transaction
      * is not shown, so check the basics for the transaction, and show or not after the separator */

Index: gsb_data_archive_store.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_archive_store.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gsb_data_archive_store.h	28 Aug 2008 21:49:36 -0000	1.5
+++ gsb_data_archive_store.h	7 Mar 2010 15:56:04 -0000	1.6
@@ -10,6 +10,7 @@
 void gsb_data_archive_store_create_list ( void );
 gint gsb_data_archive_store_get_account_number ( gint archive_store_number );
 gint gsb_data_archive_store_get_archive_number ( gint archive_store_number );
+gsb_real gsb_data_archive_store_get_archives_balance ( gint account_number );
 GSList *gsb_data_archive_store_get_archives_list ( void );
 gsb_real gsb_data_archive_store_get_balance ( gint archive_store_number );
 gint gsb_data_archive_store_get_number ( gpointer archive_ptr );

Index: transaction_list_select.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/transaction_list_select.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- transaction_list_select.c	9 Aug 2009 18:31:42 -0000	1.8
+++ transaction_list_select.c	7 Mar 2010 15:56:05 -0000	1.9
@@ -106,7 +106,6 @@
 
         account_number = gsb_data_transaction_get_account_number ( transaction_number );
         gsb_data_account_set_r ( account_number, TRUE );
-        gsb_gui_update_bouton_affiche_ope_r ( TRUE );
         gsb_menu_update_view_menu ( account_number );
         mise_a_jour_affichage_r ( TRUE );
     }

Index: gsb_data_account.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_account.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- gsb_data_account.h	6 Mar 2010 22:34:12 -0000	1.41
+++ gsb_data_account.h	7 Mar 2010 15:56:04 -0000	1.42
@@ -64,6 +64,7 @@
 gsb_real gsb_data_account_get_init_balance ( gint account_number,
                         gint floating_point );
 kind_account gsb_data_account_get_kind ( gint account_number );
+gboolean gsb_data_account_get_l ( gint account_number );
 GSList *gsb_data_account_get_list_accounts ( void );
 gsb_real gsb_data_account_get_marked_balance ( gint account_number );
 gsb_real gsb_data_account_get_mini_balance_authorized ( gint account_number );
@@ -132,6 +133,8 @@
 					     gsb_real balance );
 gboolean gsb_data_account_set_kind ( gint account_number,
                         kind_account account_kind );
+gboolean gsb_data_account_set_l ( gint account_number,
+                        gboolean show_l );
 gboolean gsb_data_account_set_mini_balance_authorized ( gint account_number,
                         gsb_real balance );
 gboolean gsb_data_account_set_mini_balance_authorized_message ( gint account_number,



More information about the cvs mailing list