[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-149-g6408487

Pierre Biava nobody at users.sourceforge.net
Sun Apr 24 17:14:52 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  6408487261e8cc1e5083e104081bb48fff39a2df (commit)
       via  0eec46b7429cb4868f38901bf56bdbb5b85c7b42 (commit)
       via  d0eb16b761ef50046bdd8193e19498e1277866bc (commit)
       via  f5003108d9034506636d3a4f376a8040524297db (commit)
       via  06c2f6cf6b9e2fa5606a3a5092e35ce499b95c55 (commit)
      from  55fc0225903133919437c1e476801c88d945fe73 (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 6408487261e8cc1e5083e104081bb48fff39a2df
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Apr 24 16:54:10 2011 +0200

    fixes warnings and refreshing of the toolbar

commit 0eec46b7429cb4868f38901bf56bdbb5b85c7b42
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Apr 24 16:23:51 2011 +0200

    fixes a warning

commit d0eb16b761ef50046bdd8193e19498e1277866bc
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Apr 24 16:04:55 2011 +0200

    Fixed a crash if the number of items to be exported is null

commit f5003108d9034506636d3a4f376a8040524297db
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Apr 24 15:14:09 2011 +0200

    fixed a bug in the refreshing of the toolbar to the reports

commit 06c2f6cf6b9e2fa5606a3a5092e35ce499b95c55
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Apr 24 14:50:38 2011 +0200

    delete of the barre_outils.c file and transfering the toolbars in the build files of the interface.

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

Changes:
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a40d8f6..0594a60 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,7 +8,6 @@ src/bet_finance_ui.c
 src/bet_future.c
 src/bet_hist.c
 src/bet_tab.c
-src/barre_outils.c
 src/categories_onglet.c
 src/classement_echeances.c
 src/csv_parse.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 43e2432..1c25d53 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,6 @@ libgrisbi_la_SOURCES = \
 	accueil.c		\
 	affichage.c		\
 	affichage_liste.c	\
-	barre_outils.c		\
 	categories_onglet.c	\
 	classement_echeances.c	\
 	csv_parse.c		\
@@ -161,7 +160,6 @@ libgrisbi_la_SOURCES = \
 	accueil.h		\
 	affichage.h		\
 	affichage_liste.h	\
-	barre_outils.h		\
     bet_config.h \
     bet_data.h \
     bet_data_finance.h \
diff --git a/src/affichage.c b/src/affichage.c
index c907b74..ec928b0 100644
--- a/src/affichage.c
+++ b/src/affichage.c
@@ -36,7 +36,6 @@
 #include "gsb_file.h"
 #include "navigation.h"
 #include "fenetre_principale.h"
-#include "barre_outils.h"
 #include "accueil.h"
 #include "gsb_scheduler_list.h"
 #include "gsb_select_icon.h"
@@ -707,9 +706,7 @@ gboolean change_toolbar_display_mode ( GtkRadioButton *button )
     etat.display_toolbar = GPOINTER_TO_INT (g_object_get_data ( G_OBJECT(button), "display" ));
 
     /* update toolbars */
-    gsb_gui_update_transaction_toolbar ();
-    gsb_gui_update_scheduler_toolbar ();
-    gsb_gui_update_payee_toolbar ();
+    gsb_gui_update_all_toolbars ( );
 
     return FALSE;
 }
@@ -1032,6 +1029,7 @@ gboolean change_grisbi_title_type ( GtkRadioButton *button, GtkWidget *entry )
     return FALSE;
 }
 
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/barre_outils.c b/src/barre_outils.c
deleted file mode 100644
index 475fb80..0000000
--- a/src/barre_outils.c
+++ /dev/null
@@ -1,696 +0,0 @@
-/* ************************************************************************** */
-/*                                                                            */
-/*     Copyright (C)    2000-2007 Cédric Auger (cedric at grisbi.org)            */
-/*          2004-2008 Benjamin Drieu (bdrieu at april.org)                       */
-/*          http://www.grisbi.org                                             */
-/*                                                                            */
-/*  This program is free software; you can redistribute it and/or modify      */
-/*  it under the terms of the GNU General Public License as published by      */
-/*  the Free Software Foundation; either version 2 of the License, or         */
-/*  (at your option) any later version.                                       */
-/*                                                                            */
-/*  This program is distributed in the hope that it will be useful,           */
-/*  but WITHOUT ANY WARRANTY; without even the implied warranty of            */
-/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
-/*  GNU General Public License for more details.                              */
-/*                                                                            */
-/*  You should have received a copy of the GNU General Public License         */
-/*  along with this program; if not, write to the Free Software               */
-/*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-/*                                                                            */
-/* ************************************************************************** */
-
-/**
- * \file barre_outils.c
- * set up the toolbar
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "include.h"
-#include <glib/gi18n.h>
-
-/*START_INCLUDE*/
-#include "barre_outils.h"
-#include "gsb_automem.h"
-#include "gsb_data_account.h"
-#include "gsb_data_import_rule.h"
-#include "navigation.h"
-#include "menu.h"
-#include "metatree.h"
-#include "import.h"
-#include "gsb_reconcile.h"
-#include "gsb_scheduler_list.h"
-#include "gsb_transactions_list.h"
-#include "tiers_onglet.h"
-#include "traitement_variables.h"
-#include "print_transactions_list.h"
-#include "utils_buttons.h"
-#include "structures.h"
-#include "erreur.h"
-/*END_INCLUDE*/
-
-/*START_STATIC*/
-static GtkWidget *creation_barre_outils ( void );
-static GtkWidget *creation_barre_outils_echeancier ( void );
-static GtkWidget *creation_barre_outils_tiers ( void );
-static gboolean popup_scheduled_view_mode_menu ( GtkWidget * button );
-static gboolean popup_transaction_rules_menu ( GtkWidget * button,
-					gpointer null );
-static gboolean popup_transaction_view_mode_menu ( GtkWidget * button,
-						   gpointer null );
-/*END_STATIC*/
-
-
-/** Used to display/hide comments in scheduler list */
-static GtkWidget *scheduler_display_hide_comments = NULL;
-
-/** here are the 3 buttons on the scheduler toolbar
- * which can been unsensitive or sensitive */
-GtkWidget *scheduler_button_execute = NULL;
-GtkWidget *scheduler_button_delete = NULL;
-GtkWidget *scheduler_button_edit = NULL;
-
-
-/** the import rules button is showed or hidden if account have or no some rules
- * so need to set in global variables */
-GtkWidget *menu_import_rules;
-
-
-/*START_EXTERN*/
-/*END_EXTERN*/
-
-
-
-/*******************************************************************************************/
-GtkWidget *creation_barre_outils ( void )
-{
-    GtkWidget *hbox, *menu, *button;
-
-    /* Hbox */
-    hbox = gtk_hbox_new ( FALSE, 0 );
-
-    /* Add various icons */
-    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("New transaction"),
-					       "new-transaction.png",
-					       G_CALLBACK ( new_transaction ),
-					       GINT_TO_POINTER(-1) );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Blank the form to create a new transaction"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
-
-    button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_DELETE, 
-					   _("Delete"),
-					   G_CALLBACK ( remove_transaction ),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Delete selected transaction"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
-
-    button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_PROPERTIES, 
-					   _("Edit"),
-					   G_CALLBACK ( gsb_transactions_list_edit_current_transaction ),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Edit current transaction"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
-
-    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("Reconcile"),
-					       "reconciliation.png",
-					       G_CALLBACK (gsb_reconcile_run_reconciliation),
-					       GINT_TO_POINTER(-1) );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Start account reconciliation"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
-
-    /* This stuff needs GTK+ 2.10 to work. */
-    button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					    GTK_STOCK_PRINT,
-					    _("Print"),
-					    G_CALLBACK (print_transactions_list),
-					    NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Print the transactions list"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
-
-    menu = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
-					      GTK_STOCK_SELECT_COLOR, _("View"),
-					      G_CALLBACK (popup_transaction_view_mode_menu),
-					      NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (menu),
-				  _("Change display mode of the list"));
-    gtk_box_pack_start ( GTK_BOX(hbox), menu, FALSE, FALSE, 0 );
-
-    menu_import_rules = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
-							    GTK_STOCK_EXECUTE, _("Import rules"),
-							    G_CALLBACK (popup_transaction_rules_menu),
-							    NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (menu_import_rules),
-				  _("Quick file import by rules"));
-    gtk_box_pack_start ( GTK_BOX(hbox), menu_import_rules, FALSE, FALSE, 0 );
-
-    gtk_widget_show_all ( hbox );
-
-    if ( gsb_data_import_rule_account_has_rule ( gsb_gui_navigation_get_current_account ( ) ) )
-	    gtk_widget_show ( menu_import_rules );
-    else
-	    gtk_widget_hide ( menu_import_rules );
-
-    return ( hbox );
-}
-
-
-
-/**
- *
- *
- *
- */
-void gsb_gui_update_transaction_toolbar ( void )
-{
-    GtkWidget *transaction_toolbar;
-    GList * list = NULL;
-
-    transaction_toolbar = gsb_transactions_list_get_toolbar ( );
-
-    list = gtk_container_get_children ( GTK_CONTAINER ( transaction_toolbar ) );
-    
-    if ( list )
-    {
-        gtk_container_remove ( GTK_CONTAINER ( transaction_toolbar ),
-                        GTK_WIDGET ( list -> data ) );
-        g_list_free ( list );
-    }
-    gtk_container_add ( GTK_CONTAINER ( transaction_toolbar ), creation_barre_outils ( ) );
-}
-
-
-/**
- *
- *
- */
-static gboolean popup_transaction_view_mode_menu ( GtkWidget * button,
-						   gpointer null )
-{
-    GtkWidget *menu, *menu_item;
-    gint current_account;
-
-    menu = gtk_menu_new ();
-
-    menu_item = gtk_menu_item_new_with_label ( _("Simple view") );
-    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
-			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (1) );
-
-    menu_item = gtk_menu_item_new_with_label ( _("Two lines view") );
-    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
-			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (2) );
-
-    menu_item = gtk_menu_item_new_with_label ( _("Three lines view") );
-    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
-			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (3) );
-
-    menu_item = gtk_menu_item_new_with_label ( _("Complete view") );
-    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
-			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (4) );
-
-    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new ( ) );
-
-    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 ( current_account ) );
-    if ( etat.equilibrage == 1 )
-        gtk_widget_set_sensitive ( menu_item, FALSE );
-    else
-        gtk_widget_set_sensitive ( menu_item, TRUE );
-
-    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-    g_signal_connect ( G_OBJECT ( menu_item ),
-                        "activate", 
-			            G_CALLBACK ( gsb_gui_toggle_show_reconciled ),
-                        NULL );
-
-    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 ) );
-    if ( etat.equilibrage == 1 )
-        gtk_widget_set_sensitive ( menu_item, FALSE );
-    else
-        gtk_widget_set_sensitive ( menu_item, TRUE );
-
-    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 ( ) );
-
-    return FALSE;
-}
-
-
-/**
- *
- *
- */
-gboolean popup_transaction_rules_menu ( GtkWidget * button,
-					gpointer null )
-{
-    GtkWidget *menu, *menu_item;
-    GSList *tmp_list;
-    gint current_account = gsb_gui_navigation_get_current_account ();
-    gint i = 0;
-
-    menu = gtk_menu_new ();
-
-    tmp_list = gsb_data_import_rule_get_from_account (current_account);
-    
-    while (tmp_list)
-    {
-	gint rule;
-
-	rule = gsb_data_import_rule_get_number (tmp_list -> data);
- 
-	if (i > 0)
-	{ 
-	    menu_item = gtk_separator_menu_item_new ( );
-	    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-	}
-  
-	menu_item = gtk_menu_item_new_with_label (gsb_data_import_rule_get_name (rule));
-	gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-	g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
-				   G_CALLBACK (gsb_import_by_rule), GINT_TO_POINTER (rule) );
-	menu_item = gtk_menu_item_new_with_label (_("Remove the rule"));
-	g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
-				   G_CALLBACK (gsb_data_import_rule_remove), GINT_TO_POINTER (rule) );
-
-	gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-
-    i++;
-
-	tmp_list = tmp_list -> next;
-    }
-
-    gtk_widget_show_all ( menu );
-    gtk_menu_popup ( GTK_MENU(menu), NULL, button, set_popup_position, button, 1, 
-		     gtk_get_current_event_time());
-
-    return FALSE;
-}
-
-
-
-
-/****************************************************************************************************/
-gboolean change_aspect_liste ( gint demande )
-{
-    GtkUIManager *ui_manager = gsb_menu_get_ui_manager ( );
-
-    switch ( demande )
-    {
-	case 0:
-	    /* not used */
-	    break;
-
-	/* 	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,
-					    "/menubar/ViewMenu/ShowOneLine" ) ),
-					    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,
-					    "/menubar/ViewMenu/ShowTwoLines" ) ),
-					    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,
-					    "/menubar/ViewMenu/ShowThreeLines" ) ),
-					    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,
-					    "/menubar/ViewMenu/ShowFourLines" ) ),
-					   TRUE );
-	    gsb_transactions_list_set_visible_rows_number ( demande );
-	    if ( etat.modification_fichier == 0 )
-            modification_fichier ( TRUE );
-	    break;
-
-	case 5 :
-
-	    /* ope avec r */
-
-	    mise_a_jour_affichage_r ( 1 );
-	    if ( etat.modification_fichier == 0 )
-            modification_fichier ( TRUE );
-
-	    gsb_menu_set_block_menu_cb ( TRUE );
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
-                        gtk_ui_manager_get_action ( ui_manager,
-					    "/menubar/ViewMenu/ShowReconciled" ) ),
-					    TRUE );
-	    gsb_menu_set_block_menu_cb ( FALSE );
-
-	    break;
-
-	case 6 :
-
-	    /* ope sans r */
-
-	    mise_a_jour_affichage_r ( 0 );
-	    if ( etat.modification_fichier == 0 )
-            modification_fichier ( TRUE );
-
-	    gsb_menu_set_block_menu_cb ( TRUE );
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
-                        gtk_ui_manager_get_action ( ui_manager,
-					    "/menubar/ViewMenu/ShowReconciled" ) ),
-					    FALSE );
-	    gsb_menu_set_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 );
-
-	    gsb_menu_set_block_menu_cb ( TRUE );
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
-                        gtk_ui_manager_get_action ( ui_manager,
-						"/menubar/ViewMenu/ShowArchived" ) ),
-					    TRUE );
-	    gsb_menu_set_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 );
-
-	    gsb_menu_set_block_menu_cb ( TRUE );
-	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
-                        gtk_ui_manager_get_action ( ui_manager,
-					    "/menubar/ViewMenu/ShowArchived" ) ),
-					    FALSE );
-	    gsb_menu_set_block_menu_cb ( FALSE );
-
-	    break;
-    }
-
-    return ( TRUE );
-}
-
-
-
-/**
- *
- *
- *
- */
-gboolean popup_scheduled_view_mode_menu ( GtkWidget * button )
-{
-    GtkWidget *menu, *item;
-    gchar * names[] = { _("Unique view"), _("Week view"), _("Month view"), 
-			_("Two months view"), _("Quarter view"), 
-			_("Year view"), _("Custom view"), NULL, };
-    int i;
-
-    menu = gtk_menu_new ();
-    
-    for ( i = 0 ; names[i] ; i++ )
-    {
-	item = gtk_menu_item_new_with_label ( names[i] );
-	g_signal_connect_swapped ( G_OBJECT ( item ), "activate",
-				    G_CALLBACK ( gsb_scheduler_list_change_scheduler_view ),
-				    GINT_TO_POINTER(i) );
-	gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), item );
-    }
-
-    gtk_widget_show_all ( menu );
-
-    gtk_menu_popup ( GTK_MENU(menu), NULL, button, set_popup_position, button, 1, 
-		     gtk_get_current_event_time());
-
-    return FALSE;
-}
-
-
-
-/**
- * Create the toolbar that contains all elements needed to manipulate
- * the scheduler.
- *
- * \param 
- *
- * \return A newly created hbox.
- */
-GtkWidget *creation_barre_outils_echeancier ( void )
-{
-    GtkWidget *hbox, *button;
-
-    hbox = gtk_hbox_new ( FALSE, 0 );
-
-    /* Common actions */
-    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("_New scheduled"),
-					       "new-scheduled.png",
-					       G_CALLBACK (gsb_scheduler_list_edit_transaction),
-					       GINT_TO_POINTER(-1) );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Prepare form to create a new scheduled transaction"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
-
-    scheduler_button_delete = gsb_automem_stock_button_new ( etat.display_toolbar,
-							    GTK_STOCK_DELETE, 
-							    _("Delete"),
-							    G_CALLBACK ( gsb_scheduler_list_delete_scheduled_transaction_by_menu ),
-							    NULL );
-    gtk_widget_set_sensitive ( scheduler_button_delete, FALSE );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_button_delete),
-				  _("Delete selected scheduled transaction"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_button_delete, FALSE, FALSE, 0 );
-
-    scheduler_button_edit = gsb_automem_stock_button_new ( etat.display_toolbar,
-							  GTK_STOCK_PROPERTIES, 
-							  _("Edit"),
-							  G_CALLBACK ( gsb_scheduler_list_edit_transaction ),
-							  0 );
-    gtk_widget_set_sensitive ( scheduler_button_edit, FALSE );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_button_edit),
-				_("Edit selected transaction"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_button_edit, FALSE, FALSE, 0 );
-
-    /* Display/hide comments */
-    scheduler_display_hide_comments = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-									_("Comments"),
-									"comments.png",
-									G_CALLBACK ( gsb_scheduler_list_show_notes ),
-									0 );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_display_hide_comments),
-				  _("Display scheduled transactions comments"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_display_hide_comments, 
-			 FALSE, FALSE, 0 );
-
-    /* Execute transaction */
-    scheduler_button_execute = gsb_automem_stock_button_new ( etat.display_toolbar,
-							     GTK_STOCK_EXECUTE, 
-							     _("Execute"),
-							     G_CALLBACK ( gsb_scheduler_list_execute_transaction ),
-							     NULL ); 
-    gtk_widget_set_sensitive ( scheduler_button_execute, FALSE );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_button_execute),
-				  _("Execute current scheduled transaction"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_button_execute, FALSE, FALSE, 0 );
-
-    button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
-						GTK_STOCK_SELECT_COLOR, _("View"),
-						G_CALLBACK (popup_scheduled_view_mode_menu),
-						NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Change display mode of scheduled transaction list"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
-
-    gtk_widget_show_all ( hbox );
-
-    return ( hbox );
-}
-
-
-
-/**
- *
- *
- *
- */
-void gsb_gui_update_scheduler_toolbar ( void )
-{
-    GtkWidget *scheduler_toolbar;
-    GList * list = NULL;
-
-    scheduler_toolbar = gsb_scheduler_list_get_toolbar ( );
-
-    list = gtk_container_get_children ( GTK_CONTAINER ( scheduler_toolbar ) );
-    
-    if ( list )
-    {
-	gtk_container_remove ( GTK_CONTAINER ( scheduler_toolbar ),
-			       GTK_WIDGET ( list -> data ) );
-	g_list_free ( list );
-    }
-    gtk_container_add ( GTK_CONTAINER ( scheduler_toolbar ), creation_barre_outils_echeancier () );
-}
-
-
-
-/**
- * Create a button bar allowing to act on the payee list.  Some of
- * these buttons are "linked" to the selection status of the payee
- * metatree.  That is, if nothing is selected, they will become
- * unsensitive.
- *
- * \return	A newly-allocated widget.
- */
-GtkWidget *creation_barre_outils_tiers ( void )
-{
-    GtkWidget *hbox, *button;
-    GtkWidget *payee_tree;
-    GtkTreeStore *payee_tree_model;
-
-    /* Hbox */
-    hbox = gtk_hbox_new ( FALSE, 0 );
-
-    /* get the tree_model and the tree_view */
-    payee_tree_model = gsb_payee_get_tree_store ( );
-    payee_tree = gsb_payee_get_tree_view ( );
-
-    /* Add various icons */
-    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("New payee"), "new-payee.png",
-					       G_CALLBACK ( appui_sur_ajout_payee ),
-					       payee_tree_model );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
-				  _("Create a new payee"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
-    button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_DELETE, _("Delete"),
-					   G_CALLBACK ( supprimer_division ),
-					   payee_tree );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( payee_tree_model ), button, "selection" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
-				  _("Delete selected payee"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
-    button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_PROPERTIES, _("Properties"),
-					   G_CALLBACK ( edit_payee ),
-					   payee_tree );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( payee_tree_model ), button, "selection" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
-				  _("Edit selected payee"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
-    button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
-						GTK_STOCK_SELECT_COLOR,
-						_("View"),
-						G_CALLBACK ( popup_payee_view_mode_menu ),
-						NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
-				  _("Change view mode"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
-	button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-						_("Manage payees"), "payeesmg.png",
-						G_CALLBACK ( appui_sur_manage_tiers ),
-						NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
-				  _("Manage the payees"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
-    button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_DELETE, _("Remove unused payees"),
-					   G_CALLBACK ( payee_remove_unused ),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
-				  _("Remove orphan payees"));
-    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
-    gtk_widget_show_all ( hbox );
-
-    metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL( payee_tree_model ),
-					    FALSE, "selection" );
-
-    return ( hbox );
-}
-
-
-
-/**
- *
- *
- *
- */
-void gsb_gui_update_payee_toolbar ( void )
-{
-    GtkWidget *payee_toolbar;
-    GList * list = NULL;
-
-    payee_toolbar = gsb_payee_get_toolbar ( );
-
-    list = gtk_container_get_children ( GTK_CONTAINER ( payee_toolbar ) );
-    
-    if ( list )
-    {
-	gtk_container_remove ( GTK_CONTAINER ( payee_toolbar ),
-			       GTK_WIDGET ( list -> data ) );
-	g_list_free ( list );
-    }
-    gtk_container_add ( GTK_CONTAINER ( payee_toolbar ), creation_barre_outils_tiers () );
-}
-
-
-
-/* Local Variables: */
-/* c-basic-offset: 4 */
-/* End: */
diff --git a/src/barre_outils.h b/src/barre_outils.h
deleted file mode 100644
index 79c0f57..0000000
--- a/src/barre_outils.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _BARRE_OUTILS_H
-#define _BARRE_OUTILS_H (1)
-
-#include <gtk/gtk.h>
-
-/* START_INCLUDE_H */
-/* END_INCLUDE_H */
-
-
-/* START_DECLARATION */
-gboolean change_aspect_liste ( gint demande );
-void gsb_gui_update_payee_toolbar ( void );
-void gsb_gui_update_scheduler_toolbar ( void );
-void gsb_gui_update_transaction_toolbar ( void );
-/* END_DECLARATION */
-#endif
diff --git a/src/categories_onglet.c b/src/categories_onglet.c
index 03c7ccf..5114f55 100644
--- a/src/categories_onglet.c
+++ b/src/categories_onglet.c
@@ -68,9 +68,10 @@ static void selectionne_sub_category ( GtkTreeModel * model );
 /*END_STATIC*/
 
 
-/* Category tree model & view */
-GtkTreeStore *categ_tree_model = NULL;
-GtkWidget *arbre_categ = NULL;
+/* Category toolbar, tree model & tree view */
+static GtkWidget *category_toolbar;
+static GtkTreeStore *categ_tree_model = NULL;
+static GtkWidget *arbre_categ = NULL;
 gint no_devise_totaux_categ;
 
 /* variable for the management of the cancelled edition */
@@ -79,6 +80,7 @@ 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 GdkColor couleur_selection;
@@ -114,8 +116,9 @@ GtkWidget *onglet_categories ( void )
     gtk_widget_show ( vbox );
 
     /* on y ajoute la barre d'outils */
-    gtk_box_pack_start ( GTK_BOX ( vbox ), creation_barre_outils_categ(),
-			 FALSE, FALSE, 0 );
+    category_toolbar = gtk_handle_box_new ();
+    gtk_widget_show ( category_toolbar );
+    gtk_box_pack_start ( GTK_BOX ( vbox ), category_toolbar, FALSE, FALSE, 0 );
 
     /* création de l'arbre principal */
 
@@ -481,7 +484,6 @@ void importer_categ ( void )
 }
 
 
-
 /**
  * Create a button bar allowing to act on the categories list.  Some
  * of these buttons are "linked" to the selection status of the
@@ -492,96 +494,118 @@ void importer_categ ( void )
  */
 GtkWidget *creation_barre_outils_categ ( void )
 {
-    GtkWidget * handlebox, * hbox2, * button;
+    GtkWidget *hbox, *button;
+    GtkWidget *category_tree;
+    GtkTreeStore *category_tree_model;
 
-    /* HandleBox */
-    handlebox = gtk_handle_box_new ();
+    /* hbox */
+    hbox = gtk_hbox_new ( FALSE, 0 );
 
-    /* Hbox2 */
-    hbox2 = gtk_hbox_new ( FALSE, 0 );
-    gtk_container_add ( GTK_CONTAINER(handlebox), hbox2 );
+    /* get the tree_model and the tree_view */
+    category_tree_model = category_list_get_tree_store ( );
+    category_tree = category_list_get_tree_view ( );
 
     /* New category button */
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("New\ncategory"),
-					       "new-categ.png",
-					       G_CALLBACK ( appui_sur_ajout_category ),
-					       categ_tree_model );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Create a new category"));
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
-    g_object_set_data ( G_OBJECT (button), "type", GINT_TO_POINTER (1) );
+                                                _("New\ncategory"),
+                                                "new-categ.png",
+                                                G_CALLBACK ( appui_sur_ajout_category ),
+                                                category_tree_model );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                                  _("Create a new category"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+    g_object_set_data ( G_OBJECT ( button ), "type", GINT_TO_POINTER (1) );
 
     /* New sub category button */
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("New sub\ncategory"),
-					       "new-sub-categ.png",
-					       G_CALLBACK (appui_sur_ajout_category),
-					       categ_tree_model );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL(categ_tree_model), button, "selection" );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL(categ_tree_model), button, "sub-division" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Create a new sub-category"));
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
-    g_object_set_data ( G_OBJECT (button), "type", GINT_TO_POINTER (2) );
+                                                _("New sub\ncategory"),
+                                                "new-sub-categ.png",
+                                                G_CALLBACK (appui_sur_ajout_category),
+                                                category_tree_model );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( category_tree_model ), button, "selection" );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( category_tree_model ), button, "sub-division" );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                                  _("Create a new sub-category"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+    g_object_set_data ( G_OBJECT ( button ), "type", GINT_TO_POINTER (2) );
 
     /* Import button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_OPEN,
-					   _("Import"),
-					   G_CALLBACK (importer_categ),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Import a Grisbi category file (.cgsb)"));
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                            GTK_STOCK_OPEN,
+                                            _("Import"),
+                                            G_CALLBACK ( importer_categ ),
+                                            NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                                  _("Import a Grisbi category file (.cgsb)"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* Export button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_SAVE,
-					   _("Export"),
-					   G_CALLBACK(exporter_categ),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Export a Grisbi category file (.cgsb)"));
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                            GTK_STOCK_SAVE,
+                                            _("Export"),
+                                            G_CALLBACK ( exporter_categ ),
+                                            NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                                  _("Export a Grisbi category file (.cgsb)"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* Delete button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_DELETE, _("Delete"),
-					   G_CALLBACK (supprimer_division), arbre_categ );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL(categ_tree_model), button, "selection" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Delete selected category"));
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                            GTK_STOCK_DELETE, _("Delete"),
+                                            G_CALLBACK ( supprimer_division ), category_tree );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( category_tree_model ), button, "selection" );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                                  _("Delete selected category"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* Properties button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_PROPERTIES, _("Properties"),
-					   G_CALLBACK (edit_category), arbre_categ );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL(categ_tree_model), button, "selection" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Edit selected category"));
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                            GTK_STOCK_PROPERTIES, _("Properties"),
+                                            G_CALLBACK ( edit_category ), category_tree );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( category_tree_model ), button, "selection" );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                                  _("Edit selected category"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* View button */
     button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
-						GTK_STOCK_SELECT_COLOR,
-						_("View"),
-						G_CALLBACK (popup_category_view_mode_menu),
-						NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Change view mode"));
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                                 GTK_STOCK_SELECT_COLOR,
+                                                 _("View"),
+                                                 G_CALLBACK ( popup_category_view_mode_menu ),
+                                                 NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                                  _("Change view mode"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
-    gtk_widget_show_all ( handlebox );
+    gtk_widget_show_all ( hbox );
 
-    metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL(categ_tree_model),
-					    FALSE, "selection" );
+    metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL ( category_tree_model ),
+                                            FALSE, "selection" );
 
-    return ( handlebox );
+    return ( hbox );
 }
 
 
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_category_toolbar ( void )
+{
+    GList * list = NULL;
+
+    list = gtk_container_get_children ( GTK_CONTAINER ( category_toolbar ) );
+
+    if ( list )
+    {
+        gtk_container_remove ( GTK_CONTAINER ( category_toolbar ),
+                               GTK_WIDGET ( list -> data ) );
+        g_list_free ( list );
+    }
+    gtk_container_add ( GTK_CONTAINER ( category_toolbar ), creation_barre_outils_categ () );
+}
+
 
 /**
  * Popup a menu that allow changing the view mode of the category
@@ -1080,6 +1104,39 @@ void category_list_popup_context_menu ( void )
 }
 
 
+/**
+ *
+ *
+ *
+ */
+GtkWidget *category_list_get_toolbar ( void )
+{
+    return category_toolbar;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+GtkTreeStore *category_list_get_tree_store ( void )
+{
+    return categ_tree_model;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+GtkWidget *category_list_get_tree_view ( void )
+{
+    return arbre_categ;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/categories_onglet.h b/src/categories_onglet.h
index 714f549..488147e 100644
--- a/src/categories_onglet.h
+++ b/src/categories_onglet.h
@@ -8,10 +8,13 @@
 
 
 /* START_DECLARATION */
+GtkTreeStore *category_list_get_tree_store ( void );
+GtkWidget *category_list_get_tree_view ( void );
 GtkTreePath *category_hold_position_get_path ( void );
 gboolean category_hold_position_set_expand ( gboolean expand );
 gboolean category_hold_position_set_path ( GtkTreePath *path );
 GtkWidget *onglet_categories ( void );
+void gsb_gui_update_category_toolbar ( void );
 void remplit_arbre_categ ( void );
 /* END_DECLARATION */
 #endif
diff --git a/src/etats_onglet.c b/src/etats_onglet.c
index 683c255..33586c6 100644
--- a/src/etats_onglet.c
+++ b/src/etats_onglet.c
@@ -94,6 +94,45 @@ enum report_export_formats {
 };
 
 
+/**
+ * Create the report tab widgets.
+ *
+ * \return	 A newly allocated vbox.
+ */
+GtkWidget *creation_onglet_etats ( void )
+{
+    GtkWidget *tab, *vbox;
+
+    tab = gtk_vbox_new ( FALSE, 6 );
+
+    /* création de la barre d'outils */
+    reports_toolbar = gtk_handle_box_new ( );
+    gtk_widget_show ( reports_toolbar );
+    gtk_box_pack_start ( GTK_BOX ( tab ), reports_toolbar, FALSE, FALSE, 0 );
+
+    /* création du notebook contenant l'état et la config */
+    notebook_etats = gtk_notebook_new ();
+    gtk_notebook_set_show_tabs ( GTK_NOTEBOOK ( notebook_etats ), FALSE );
+    gtk_notebook_set_show_border ( GTK_NOTEBOOK(notebook_etats), FALSE );
+    gtk_box_pack_start ( GTK_BOX ( tab ), notebook_etats, TRUE, TRUE, 0 );
+
+    /* création de la partie droite */
+    vbox = gtk_vbox_new ( FALSE, 6 );
+    gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook_etats ), vbox, gtk_label_new ( _("Reports")));
+
+    /* On met une scrolled window qui sera remplit par l'état */
+    scrolled_window_etat = gtk_scrolled_window_new ( FALSE, FALSE );
+    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window_etat),
+					  GTK_SHADOW_NONE );
+    gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW ( scrolled_window_etat ),
+				     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+    gtk_box_pack_start ( GTK_BOX ( vbox ), scrolled_window_etat, TRUE, TRUE, 0 );
+
+    gtk_widget_show_all ( tab );
+
+    return ( tab );
+}
+
 
 /**
  * Create a toolbar containing all necessary controls on reports tab.
@@ -102,17 +141,10 @@ enum report_export_formats {
  */
 GtkWidget *gsb_gui_create_report_toolbar ( void )
 {
-    GtkWidget *hbox, *handlebox, *hbox2, *button;
+    GtkWidget *hbox, *button;
 
     hbox = gtk_hbox_new ( FALSE, 5 );
 
-    /* HandleBox */
-    handlebox = gtk_handle_box_new ();
-    gtk_box_pack_start ( GTK_BOX ( hbox ), handlebox, TRUE, TRUE, 0 );
-    /* Hbox2 */
-    hbox2 = gtk_hbox_new ( FALSE, 0 );
-    gtk_container_add ( GTK_CONTAINER(handlebox), hbox2 );
-
     /* Add various icons */
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
 					       _("New report"),
@@ -121,7 +153,7 @@ GtkWidget *gsb_gui_create_report_toolbar ( void )
 					       NULL );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
 				  _("Create a new report") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
 
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
 					   GTK_STOCK_OPEN,
@@ -130,7 +162,7 @@ GtkWidget *gsb_gui_create_report_toolbar ( void )
 					   NULL );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
 				  _("Import a Grisbi report file (.egsb)") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
 
     bouton_exporter_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
 							 GTK_STOCK_SAVE,
@@ -139,7 +171,7 @@ GtkWidget *gsb_gui_create_report_toolbar ( void )
 							 NULL );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_exporter_etat),
 				  _("Export selected report to egsb, HTML, Tex, CSV, PostScript") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_exporter_etat, FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), bouton_exporter_etat, FALSE, FALSE, 0 );
 
     /* print button */
     bouton_imprimer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
@@ -150,7 +182,7 @@ GtkWidget *gsb_gui_create_report_toolbar ( void )
     gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_imprimer_etat),
                    _("Print selected report") );
 
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_imprimer_etat, FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), bouton_imprimer_etat, FALSE, FALSE, 0 );
 
     bouton_effacer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
 							 GTK_STOCK_DELETE,
@@ -159,7 +191,7 @@ GtkWidget *gsb_gui_create_report_toolbar ( void )
 							 NULL );
     gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_effacer_etat),
 				   _("Delete selected report") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_effacer_etat, FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), bouton_effacer_etat, FALSE, FALSE, 0 );
 
     bouton_personnaliser_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
 							      GTK_STOCK_PROPERTIES,
@@ -168,7 +200,7 @@ GtkWidget *gsb_gui_create_report_toolbar ( void )
 							      NULL ),
     gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_personnaliser_etat),
 				  _("Edit selected report") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_personnaliser_etat, FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), bouton_personnaliser_etat, FALSE, FALSE, 0 );
 
     bouton_dupliquer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
 							  GTK_STOCK_COPY,
@@ -177,52 +209,39 @@ GtkWidget *gsb_gui_create_report_toolbar ( void )
 							  NULL ),
     gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_dupliquer_etat),
 				  _("Clone selected report") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_dupliquer_etat, FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), bouton_dupliquer_etat, FALSE, FALSE, 0 );
 
     gtk_widget_show_all ( hbox );
 
+    gsb_gui_unsensitive_report_widgets ();
+
     return ( hbox );
 }
 
 
-
 /**
- * Create the report tab widgets.
  *
- * \return	 A newly allocated vbox.
+ *
+ *
  */
-GtkWidget *creation_onglet_etats ( void )
+void gsb_gui_update_reports_toolbar ( void )
 {
-    GtkWidget *tab, *vbox;
-
-    tab = gtk_vbox_new ( FALSE, 6 );
-    reports_toolbar = gsb_gui_create_report_toolbar();
-    gtk_box_pack_start ( GTK_BOX ( tab ), reports_toolbar, FALSE, FALSE, 0 );
-
-    /* création du notebook contenant l'état et la config */
-    notebook_etats = gtk_notebook_new ();
-    gtk_notebook_set_show_tabs ( GTK_NOTEBOOK ( notebook_etats ), FALSE );
-    gtk_notebook_set_show_border ( GTK_NOTEBOOK(notebook_etats), FALSE );
-    gtk_box_pack_start ( GTK_BOX ( tab ), notebook_etats, TRUE, TRUE, 0 );
+    GList * list = NULL;
+    gint current_report;
 
-    /* création de la partie droite */
-
-    vbox = gtk_vbox_new ( FALSE, 6 );
-    gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook_etats ), vbox, gtk_label_new ( _("Reports")));
-
-    /* On met une scrolled window qui sera remplit par l'état */
-    scrolled_window_etat = gtk_scrolled_window_new ( FALSE, FALSE );
-    gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW(scrolled_window_etat),
-					  GTK_SHADOW_NONE );
-    gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW ( scrolled_window_etat ),
-				     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
-    gtk_box_pack_start ( GTK_BOX ( vbox ), scrolled_window_etat, TRUE, TRUE, 0 );
-
-    gtk_widget_show_all ( tab );
+    list = gtk_container_get_children ( GTK_CONTAINER ( reports_toolbar ) );
+    
+    if ( list )
+    {
+        gtk_container_remove ( GTK_CONTAINER ( reports_toolbar ),
+                        GTK_WIDGET ( list -> data ) );
+	g_list_free ( list );
+    }
 
-    gsb_gui_unsensitive_report_widgets ();
+    gtk_container_add ( GTK_CONTAINER ( reports_toolbar ), gsb_gui_create_report_toolbar ( ) );
 
-    return ( tab );
+    if ( ( current_report = gsb_report_get_current ( ) ) > 0 )
+        gsb_gui_update_gui_to_report ( current_report );
 }
 
 
diff --git a/src/etats_onglet.h b/src/etats_onglet.h
index cb5b99c..d4aa888 100644
--- a/src/etats_onglet.h
+++ b/src/etats_onglet.h
@@ -11,5 +11,6 @@
 GtkWidget *creation_onglet_etats ( void );
 void gsb_gui_unsensitive_report_widgets ();
 void gsb_gui_update_gui_to_report ( gint report_number );
+void gsb_gui_update_reports_toolbar ( void );
 /* END_DECLARATION */
 #endif
diff --git a/src/fenetre_principale.c b/src/fenetre_principale.c
index 6eb8949..79eeef4 100644
--- a/src/fenetre_principale.c
+++ b/src/fenetre_principale.c
@@ -305,6 +305,9 @@ gboolean gsb_gui_fill_general_notebook ( GtkWidget *notebook )
                         creation_onglet_etats (),
                         gtk_label_new ( _("Reports") ) );
 
+    /* update toolbars */
+    gsb_gui_update_all_toolbars ( );
+
     return FALSE;
 }
 
@@ -556,6 +559,23 @@ gboolean gsb_gui_set_hpaned_left_width ( gint width )
     return TRUE;
 }
 
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_all_toolbars ( void )
+{
+    gsb_gui_update_transaction_toolbar ();
+    gsb_gui_update_scheduler_toolbar ();
+    gsb_gui_update_payee_toolbar ();
+    gsb_gui_update_category_toolbar ();
+    gsb_gui_update_budgetary_toolbar ();
+    gsb_gui_update_reports_toolbar ();
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/fenetre_principale.h b/src/fenetre_principale.h
index 8398f6d..c8c5d50 100644
--- a/src/fenetre_principale.h
+++ b/src/fenetre_principale.h
@@ -45,6 +45,7 @@ gboolean gsb_gui_on_account_switch_page ( GtkNotebook *notebook,
                         gpointer null );
 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 ();
 /*END_DECLARATION*/
 
diff --git a/src/gsb_file_others.c b/src/gsb_file_others.c
index a077139..dde2fd4 100644
--- a/src/gsb_file_others.c
+++ b/src/gsb_file_others.c
@@ -92,10 +92,11 @@ static void gsb_file_others_start_element ( GMarkupParseContext *context,
  * */
 gboolean gsb_file_others_save_category ( gchar *filename )
 {
+    gchar *file_content;
+    gchar *tmp_str;
     FILE *file;
     gulong iterator;
     gulong length_calculated;
-    gchar *file_content;
     gulong length_part;
 
     devel_debug (filename);
@@ -108,6 +109,14 @@ gboolean gsb_file_others_save_category ( gchar *filename )
     length_part = 500;
     
     length_calculated = length_part * g_slist_length (gsb_data_category_get_categories_list());
+    if ( length_calculated == 0 )
+    {
+        tmp_str = g_strdup ( _("There is no category to record. Back.") );
+        dialogue_error ( tmp_str );
+        g_free ( tmp_str );
+
+        return ( TRUE );
+    }
 
     iterator = 0;
     file_content = g_malloc0 ( length_calculated );
@@ -146,13 +155,13 @@ gboolean gsb_file_others_save_category ( gchar *filename )
 		   iterator,
 		   file ))
     {
-        gchar *tmpstr = g_strdup_printf ( _("Cannot save file '%s': %s"),
-					   filename,
-					   g_strerror(errno) );
-	dialogue_error ( tmpstr );
-	g_free ( tmpstr );
-	g_free ( file_content);
-	return ( FALSE );
+        tmp_str = g_strdup_printf ( _("Cannot save file '%s': %s"),
+                        filename,
+                        g_strerror ( errno ) );
+        dialogue_error ( tmp_str );
+        g_free ( tmp_str );
+        g_free ( file_content );
+        return ( FALSE );
     }
     
     fclose (file);
@@ -173,10 +182,11 @@ gboolean gsb_file_others_save_category ( gchar *filename )
  * */
 gboolean gsb_file_others_save_budget ( gchar *filename )
 {
+    gchar *file_content;
+    gchar *tmp_str;
     FILE *file;
     gulong iterator;
     gulong length_calculated;
-    gchar *file_content;
     gulong length_part;
 
     devel_debug (filename);
@@ -188,7 +198,15 @@ gboolean gsb_file_others_save_budget ( gchar *filename )
 
     length_part = 500;
     
-    length_calculated = length_part * g_slist_length (gsb_data_budget_get_budgets_list());
+    length_calculated = length_part * g_slist_length ( gsb_data_budget_get_budgets_list () );
+    if ( length_calculated == 0 )
+    {
+        tmp_str = g_strdup ( _("There is no budgetary line to record. Back.") );
+        dialogue_error ( tmp_str );
+        g_free ( tmp_str );
+
+        return ( TRUE );
+    }
 
     iterator = 0;
     file_content = g_malloc0 ( length_calculated );
@@ -227,13 +245,13 @@ gboolean gsb_file_others_save_budget ( gchar *filename )
 		   iterator,
 		   file ))
     {
-	gchar* tmpstr = g_strdup_printf ( _("Cannot save file '%s': %s"),
-					   filename,
-					   g_strerror(errno) );
-	dialogue_error ( tmpstr );
-	g_free ( tmpstr );
-	g_free ( file_content);
-	return ( FALSE );
+        tmp_str = g_strdup_printf ( _("Cannot save file '%s': %s"),
+                        filename,
+                        g_strerror ( errno ) );
+        dialogue_error ( tmp_str );
+        g_free ( tmp_str );
+        g_free ( file_content );
+        return ( FALSE );
     }
     
     fclose ( file );
@@ -254,10 +272,11 @@ gboolean gsb_file_others_save_budget ( gchar *filename )
  * */
 gboolean gsb_file_others_save_report ( gchar *filename )
 {
+    gchar *file_content;
+    gchar *tmp_str;
     FILE *file;
     gulong iterator;
     gulong length_calculated;
-    gchar *file_content;
     gulong length_part;
 
     devel_debug (filename);
@@ -270,6 +289,14 @@ gboolean gsb_file_others_save_report ( gchar *filename )
     length_part = 2500;
     
     length_calculated = length_part * g_slist_length (gsb_data_report_get_report_list ());
+    if ( length_calculated == 0 )
+    {
+        tmp_str = g_strdup ( _("There is no report to record. Back.") );
+        dialogue_error ( tmp_str );
+        g_free ( tmp_str );
+
+        return ( TRUE );
+    }
 
     iterator = 0;
     file_content = g_malloc0 ( length_calculated );
@@ -310,13 +337,13 @@ gboolean gsb_file_others_save_report ( gchar *filename )
 		   iterator,
 		   file ))
     {
-	gchar* tmpstr = g_strdup_printf ( _("Cannot save file '%s': %s"),
-					   filename,
-					   g_strerror(errno) );
-	dialogue_error ( tmpstr);
-	g_free ( tmpstr );
-	g_free ( file_content);
-	return ( FALSE );
+        tmp_str = g_strdup_printf ( _("Cannot save file '%s': %s"),
+                        filename,
+                        g_strerror ( errno ) );
+        dialogue_error ( tmp_str);
+        g_free ( tmp_str );
+        g_free ( file_content );
+        return ( FALSE );
     }
     
     fclose ( file );
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index ab560b0..c2fefb0 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -39,7 +39,6 @@
 
 /*START_INCLUDE*/
 #include "gsb_scheduler_list.h"
-#include "barre_outils.h"
 #include "dialog.h"
 #include "fenetre_principale.h"
 #include "gsb_automem.h"
@@ -66,6 +65,7 @@
 /*END_INCLUDE*/
 
 /*START_STATIC*/
+static GtkWidget *creation_barre_outils_echeancier ( void );
 static gboolean gsb_scheduler_list_button_press ( GtkWidget *tree_view,
                         GdkEventButton *ev );
 static gboolean gsb_scheduler_list_clone_selected_scheduled ( GtkWidget *menu_item,
@@ -111,6 +111,8 @@ static gboolean gsb_scheduler_list_switch_expander ( gint scheduled_number );
 static gboolean gsb_scheduler_list_update_white_child ( gint white_line_number,
                         gint mother_scheduled_number );
 static void popup_scheduled_context_menu ( void );
+static gboolean popup_scheduled_view_mode_menu ( GtkWidget *button );
+
 /*END_STATIC*/
 
 
@@ -123,9 +125,6 @@ extern GdkColor couleur_selection;
 extern struct conditional_message delete_msg[];
 extern gint mise_a_jour_liste_echeances_manuelles_accueil;
 extern gsb_real null_real;
-extern GtkWidget *scheduler_button_delete;
-extern GtkWidget *scheduler_button_edit;
-extern GtkWidget *scheduler_button_execute;
 extern GdkColor split_background;
 /*END_EXTERN*/
 
@@ -152,6 +151,16 @@ gint scheduler_current_tree_view_width = 0;
 
 /* toolbar */
 static GtkWidget *scheduler_toolbar;
+/** Used to display/hide comments in scheduler list */
+static GtkWidget *scheduler_display_hide_comments = NULL;
+/** here are the 3 buttons on the scheduler toolbar
+ * which can been unsensitive or sensitive */
+static GtkWidget *scheduler_button_execute = NULL;
+static GtkWidget *scheduler_button_delete = NULL;
+static GtkWidget *scheduler_button_edit = NULL;
+
+
+
 
 static GtkSortType sort_type;
 
@@ -195,10 +204,7 @@ GtkWidget *gsb_scheduler_list_create_list ( void )
     /* create the toolbar */
     scheduler_toolbar = gtk_handle_box_new ();
     gtk_widget_show ( scheduler_toolbar );
-    gsb_gui_update_scheduler_toolbar ();
-    gtk_box_pack_start ( GTK_BOX ( vbox ),
-                         scheduler_toolbar,
-                         FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( vbox ), scheduler_toolbar, FALSE, FALSE, 0 );
 
     /* create the scrolled window */
     scrolled_window = gtk_scrolled_window_new ( NULL, NULL);
@@ -237,6 +243,142 @@ GtkWidget *gsb_scheduler_list_create_list ( void )
     return vbox;
 }
 
+
+/**
+ * Create the toolbar that contains all elements needed to manipulate
+ * the scheduler.
+ *
+ * \param 
+ *
+ * \return A newly created hbox.
+ */
+GtkWidget *creation_barre_outils_echeancier ( void )
+{
+    GtkWidget *hbox, *button;
+
+    hbox = gtk_hbox_new ( FALSE, 0 );
+
+    /* Common actions */
+    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+					       _("_New scheduled"),
+					       "new-scheduled.png",
+					       G_CALLBACK (gsb_scheduler_list_edit_transaction),
+					       GINT_TO_POINTER(-1) );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Prepare form to create a new scheduled transaction"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
+
+    scheduler_button_delete = gsb_automem_stock_button_new ( etat.display_toolbar,
+							    GTK_STOCK_DELETE, 
+							    _("Delete"),
+							    G_CALLBACK ( gsb_scheduler_list_delete_scheduled_transaction_by_menu ),
+							    NULL );
+    gtk_widget_set_sensitive ( scheduler_button_delete, FALSE );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_button_delete),
+				  _("Delete selected scheduled transaction"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_button_delete, FALSE, FALSE, 0 );
+
+    scheduler_button_edit = gsb_automem_stock_button_new ( etat.display_toolbar,
+							  GTK_STOCK_PROPERTIES, 
+							  _("Edit"),
+							  G_CALLBACK ( gsb_scheduler_list_edit_transaction ),
+							  0 );
+    gtk_widget_set_sensitive ( scheduler_button_edit, FALSE );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_button_edit),
+				_("Edit selected transaction"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_button_edit, FALSE, FALSE, 0 );
+
+    /* Display/hide comments */
+    scheduler_display_hide_comments = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+									_("Comments"),
+									"comments.png",
+									G_CALLBACK ( gsb_scheduler_list_show_notes ),
+									0 );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_display_hide_comments),
+				  _("Display scheduled transactions comments"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_display_hide_comments, 
+			 FALSE, FALSE, 0 );
+
+    /* Execute transaction */
+    scheduler_button_execute = gsb_automem_stock_button_new ( etat.display_toolbar,
+							     GTK_STOCK_EXECUTE, 
+							     _("Execute"),
+							     G_CALLBACK ( gsb_scheduler_list_execute_transaction ),
+							     NULL ); 
+    gtk_widget_set_sensitive ( scheduler_button_execute, FALSE );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET (scheduler_button_execute),
+				  _("Execute current scheduled transaction"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), scheduler_button_execute, FALSE, FALSE, 0 );
+
+    button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
+						GTK_STOCK_SELECT_COLOR, _("View"),
+						G_CALLBACK (popup_scheduled_view_mode_menu),
+						NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Change display mode of scheduled transaction list"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
+
+    gtk_widget_show_all ( hbox );
+
+    return ( hbox );
+}
+
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_scheduler_toolbar ( void )
+{
+    GList * list = NULL;
+
+    list = gtk_container_get_children ( GTK_CONTAINER ( scheduler_toolbar ) );
+    
+    if ( list )
+    {
+	gtk_container_remove ( GTK_CONTAINER ( scheduler_toolbar ),
+			       GTK_WIDGET ( list -> data ) );
+	g_list_free ( list );
+    }
+    gtk_container_add ( GTK_CONTAINER ( scheduler_toolbar ), creation_barre_outils_echeancier () );
+}
+
+
+/**
+ *
+ *
+ *
+ */
+gboolean popup_scheduled_view_mode_menu ( GtkWidget *button )
+{
+    GtkWidget *menu, *item;
+    gchar * names[] = { _("Unique view"), _("Week view"), _("Month view"), 
+			_("Two months view"), _("Quarter view"), 
+			_("Year view"), _("Custom view"), NULL, };
+    int i;
+
+    menu = gtk_menu_new ();
+    
+    for ( i = 0 ; names[i] ; i++ )
+    {
+	item = gtk_menu_item_new_with_label ( names[i] );
+	g_signal_connect_swapped ( G_OBJECT ( item ), "activate",
+				    G_CALLBACK ( gsb_scheduler_list_change_scheduler_view ),
+				    GINT_TO_POINTER(i) );
+	gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), item );
+    }
+
+    gtk_widget_show_all ( menu );
+
+    gtk_menu_popup ( GTK_MENU(menu), NULL, button, set_popup_position, button, 1, 
+		     gtk_get_current_event_time());
+
+    return FALSE;
+}
+
+
 /**
  * return the scheduler tree view
  *
diff --git a/src/gsb_scheduler_list.h b/src/gsb_scheduler_list.h
index 63b79d4..864b6ea 100644
--- a/src/gsb_scheduler_list.h
+++ b/src/gsb_scheduler_list.h
@@ -57,6 +57,7 @@ enum periodicity_units {
 
 
 /* START_DECLARATION */
+void gsb_gui_update_scheduler_toolbar ( void );
 gboolean gsb_scheduler_list_append_new_scheduled ( gint scheduled_number,
                         GDate *end_date );
 gboolean gsb_scheduler_list_change_scheduler_view ( enum scheduler_periodicity periodicity,
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index 2caec03..0d479d0 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -33,12 +33,12 @@
 #include "gsb_transactions_list.h"
 #include "accueil.h"
 #include "affichage_liste.h"
-#include "barre_outils.h"
 #include "bet_data.h"
 #include "custom_list.h"
 #include "dialog.h"
 #include "fenetre_principale.h"
 #include "gsb_account.h"
+#include "gsb_automem.h"
 #include "gsb_data_account.h"
 #include "gsb_data_archive.h"
 #include "gsb_data_archive_store.h"
@@ -47,6 +47,7 @@
 #include "gsb_data_currency.h"
 #include "gsb_data_form.h"
 #include "gsb_data_fyear.h"
+#include "gsb_data_import_rule.h"
 #include "gsb_data_payee.h"
 #include "gsb_data_payment.h"
 #include "gsb_data_reconcile.h"
@@ -57,10 +58,12 @@
 #include "gsb_real.h"
 #include "gsb_reconcile.h"
 #include "gsb_scheduler_list.h"
+#include "import.h"
 #include "main.h"
 #include "menu.h"
 #include "mouse.h"
 #include "navigation.h"
+#include "print_transactions_list.h"
 #include "structures.h"
 #include "traitement_variables.h"
 #include "transaction_list.h"
@@ -75,6 +78,7 @@
 
 /*START_STATIC*/
 static gboolean assert_selected_transaction ();
+static GtkWidget *creation_barre_outils_transaction ( void );
 static gboolean gsb_gui_change_cell_content ( GtkWidget * item, gint *element_ptr );
 static GtkWidget *gsb_gui_create_cell_contents_menu ( int x, int y );
 static gboolean gsb_transactions_list_button_press ( GtkWidget *tree_view,
@@ -113,6 +117,10 @@ static gboolean gsb_transactions_list_title_column_button_press ( GtkWidget *but
 static gboolean move_selected_operation_to_account ( GtkMenuItem * menu_item,
                         gpointer null );
 static void popup_transaction_context_menu ( gboolean full, int x, int y );
+static gboolean popup_transaction_rules_menu ( GtkWidget * button,
+                        gpointer null );
+static gboolean popup_transaction_view_mode_menu ( GtkWidget * button,
+                        gpointer null );
 static gint schedule_transaction ( gint transaction_number );
 static void update_titres_tree_view ( void );
 /*END_STATIC*/
@@ -130,8 +138,12 @@ gint transaction_col_width[CUSTOM_MODEL_VISIBLE_COLUMNS];
 /* the initial alignment of each column */
 gint transaction_col_align[CUSTOM_MODEL_VISIBLE_COLUMNS];
 
-/* adr de la barre d'outils */
+/* Barre d'outils */
 static GtkWidget *transaction_toolbar;
+/** the import rules button is showed or hidden if account have or no some rules
+ * so need to set in global variables */
+GtkWidget *menu_import_rules;
+
 
 /* contient les tips et titres des colonnes des listes d'opé */
 gchar *tips_col_liste_operations[CUSTOM_MODEL_VISIBLE_COLUMNS];
@@ -292,22 +304,252 @@ GtkWidget *creation_fenetre_operations ( void )
 
     /* création de la barre d'outils */
     transaction_toolbar = gtk_handle_box_new ();
-    gsb_gui_update_transaction_toolbar ();
     gtk_box_pack_start ( GTK_BOX ( win_operations ), transaction_toolbar, FALSE, FALSE, 0);
 
     /* tree_view_vbox will contain the tree_view, we will see later to set it directly */
     tree_view_vbox = gtk_vbox_new ( FALSE, 0 );
 
 
-    gtk_box_pack_start ( GTK_BOX ( win_operations ),
-			 tree_view_vbox,
-			 TRUE, TRUE, 0);
+    gtk_box_pack_start ( GTK_BOX ( win_operations ), tree_view_vbox, TRUE, TRUE, 0);
+
+    gtk_widget_show_all ( win_operations );
 
-    gtk_widget_show_all (win_operations);
     return ( win_operations );
 }
 
 
+GtkWidget *creation_barre_outils_transaction ( void )
+{
+    GtkWidget *hbox, *menu, *button;
+
+    /* Hbox */
+    hbox = gtk_hbox_new ( FALSE, 0 );
+
+    /* Add various icons */
+    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+					       _("New transaction"),
+					       "new-transaction.png",
+					       G_CALLBACK ( new_transaction ),
+					       GINT_TO_POINTER(-1) );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Blank the form to create a new transaction"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
+
+    button = gsb_automem_stock_button_new ( etat.display_toolbar,
+					   GTK_STOCK_DELETE, 
+					   _("Delete"),
+					   G_CALLBACK ( remove_transaction ),
+					   NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Delete selected transaction"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
+
+    button = gsb_automem_stock_button_new ( etat.display_toolbar,
+					   GTK_STOCK_PROPERTIES, 
+					   _("Edit"),
+					   G_CALLBACK ( gsb_transactions_list_edit_current_transaction ),
+					   NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Edit current transaction"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
+
+    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+					       _("Reconcile"),
+					       "reconciliation.png",
+					       G_CALLBACK (gsb_reconcile_run_reconciliation),
+					       GINT_TO_POINTER(-1) );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Start account reconciliation"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
+
+    /* This stuff needs GTK+ 2.10 to work. */
+    button = gsb_automem_stock_button_new ( etat.display_toolbar,
+					    GTK_STOCK_PRINT,
+					    _("Print"),
+					    G_CALLBACK (print_transactions_list),
+					    NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Print the transactions list"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
+
+    menu = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
+					      GTK_STOCK_SELECT_COLOR, _("View"),
+					      G_CALLBACK (popup_transaction_view_mode_menu),
+					      NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET (menu),
+				  _("Change display mode of the list"));
+    gtk_box_pack_start ( GTK_BOX(hbox), menu, FALSE, FALSE, 0 );
+
+    menu_import_rules = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
+							    GTK_STOCK_EXECUTE, _("Import rules"),
+							    G_CALLBACK (popup_transaction_rules_menu),
+							    NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET (menu_import_rules),
+				  _("Quick file import by rules"));
+    gtk_box_pack_start ( GTK_BOX(hbox), menu_import_rules, FALSE, FALSE, 0 );
+
+    gtk_widget_show_all ( hbox );
+
+    if ( gsb_data_import_rule_account_has_rule ( gsb_gui_navigation_get_current_account ( ) ) )
+	    gtk_widget_show ( menu_import_rules );
+    else
+	    gtk_widget_hide ( menu_import_rules );
+
+    return ( hbox );
+}
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_transaction_toolbar ( void )
+{
+    GtkWidget *transaction_toolbar;
+    GList * list = NULL;
+
+    transaction_toolbar = gsb_transactions_list_get_toolbar ( );
+
+    list = gtk_container_get_children ( GTK_CONTAINER ( transaction_toolbar ) );
+    
+    if ( list )
+    {
+        gtk_container_remove ( GTK_CONTAINER ( transaction_toolbar ),
+                        GTK_WIDGET ( list -> data ) );
+        g_list_free ( list );
+    }
+    gtk_container_add ( GTK_CONTAINER ( transaction_toolbar ), creation_barre_outils_transaction ( ) );
+}
+
+
+/**
+ *
+ *
+ *
+ */
+gboolean popup_transaction_rules_menu ( GtkWidget * button,
+                        gpointer null )
+{
+    GtkWidget *menu, *menu_item;
+    GSList *tmp_list;
+    gint current_account = gsb_gui_navigation_get_current_account ();
+    gint i = 0;
+
+    menu = gtk_menu_new ();
+
+    tmp_list = gsb_data_import_rule_get_from_account (current_account);
+    
+    while (tmp_list)
+    {
+	gint rule;
+
+	rule = gsb_data_import_rule_get_number (tmp_list -> data);
+ 
+	if (i > 0)
+	{ 
+	    menu_item = gtk_separator_menu_item_new ( );
+	    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+	}
+  
+	menu_item = gtk_menu_item_new_with_label (gsb_data_import_rule_get_name (rule));
+	gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+	g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
+				   G_CALLBACK (gsb_import_by_rule), GINT_TO_POINTER (rule) );
+	menu_item = gtk_menu_item_new_with_label (_("Remove the rule"));
+	g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
+				   G_CALLBACK (gsb_data_import_rule_remove), GINT_TO_POINTER (rule) );
+
+	gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+
+    i++;
+
+	tmp_list = tmp_list -> next;
+    }
+
+    gtk_widget_show_all ( menu );
+    gtk_menu_popup ( GTK_MENU(menu), NULL, button, set_popup_position, button, 1, 
+		     gtk_get_current_event_time());
+
+    return FALSE;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+static gboolean popup_transaction_view_mode_menu ( GtkWidget * button,
+                        gpointer null )
+{
+    GtkWidget *menu, *menu_item;
+    gint current_account;
+
+    menu = gtk_menu_new ();
+
+    menu_item = gtk_menu_item_new_with_label ( _("Simple view") );
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
+			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (1) );
+
+    menu_item = gtk_menu_item_new_with_label ( _("Two lines view") );
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
+			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (2) );
+
+    menu_item = gtk_menu_item_new_with_label ( _("Three lines view") );
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
+			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (3) );
+
+    menu_item = gtk_menu_item_new_with_label ( _("Complete view") );
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+    g_signal_connect_swapped ( G_OBJECT(menu_item), "activate", 
+			       G_CALLBACK (change_aspect_liste), GINT_TO_POINTER (4) );
+
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new ( ) );
+
+    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 ( current_account ) );
+    if ( etat.equilibrage == 1 )
+        gtk_widget_set_sensitive ( menu_item, FALSE );
+    else
+        gtk_widget_set_sensitive ( menu_item, TRUE );
+
+    gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+    g_signal_connect ( G_OBJECT ( menu_item ),
+                        "activate", 
+			            G_CALLBACK ( gsb_gui_toggle_show_reconciled ),
+                        NULL );
+
+    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 ) );
+    if ( etat.equilibrage == 1 )
+        gtk_widget_set_sensitive ( menu_item, FALSE );
+    else
+        gtk_widget_set_sensitive ( menu_item, TRUE );
+
+    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 ( ) );
+
+    return FALSE;
+}
+
 
 /**
  * create fully the gui list and fill it
@@ -3840,6 +4082,132 @@ GtkWidget *gsb_transactions_list_get_toolbar ( void )
 }
 
 
+/**
+ *
+ *
+ *
+ */
+gboolean change_aspect_liste ( gint demande )
+{
+    GtkUIManager *ui_manager = gsb_menu_get_ui_manager ( );
+
+    switch ( demande )
+    {
+	case 0:
+	    /* not used */
+	    break;
+
+	/* 	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,
+					    "/menubar/ViewMenu/ShowOneLine" ) ),
+					    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,
+					    "/menubar/ViewMenu/ShowTwoLines" ) ),
+					    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,
+					    "/menubar/ViewMenu/ShowThreeLines" ) ),
+					    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,
+					    "/menubar/ViewMenu/ShowFourLines" ) ),
+					   TRUE );
+	    gsb_transactions_list_set_visible_rows_number ( demande );
+	    if ( etat.modification_fichier == 0 )
+            modification_fichier ( TRUE );
+	    break;
+
+	case 5 :
+
+	    /* ope avec r */
+
+	    mise_a_jour_affichage_r ( 1 );
+	    if ( etat.modification_fichier == 0 )
+            modification_fichier ( TRUE );
+
+	    gsb_menu_set_block_menu_cb ( TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager,
+					    "/menubar/ViewMenu/ShowReconciled" ) ),
+					    TRUE );
+	    gsb_menu_set_block_menu_cb ( FALSE );
+
+	    break;
+
+	case 6 :
+
+	    /* ope sans r */
+
+	    mise_a_jour_affichage_r ( 0 );
+	    if ( etat.modification_fichier == 0 )
+            modification_fichier ( TRUE );
+
+	    gsb_menu_set_block_menu_cb ( TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager,
+					    "/menubar/ViewMenu/ShowReconciled" ) ),
+					    FALSE );
+	    gsb_menu_set_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 );
+
+	    gsb_menu_set_block_menu_cb ( TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager,
+						"/menubar/ViewMenu/ShowArchived" ) ),
+					    TRUE );
+	    gsb_menu_set_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 );
+
+	    gsb_menu_set_block_menu_cb ( TRUE );
+	    gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
+                        gtk_ui_manager_get_action ( ui_manager,
+					    "/menubar/ViewMenu/ShowArchived" ) ),
+					    FALSE );
+	    gsb_menu_set_block_menu_cb ( FALSE );
+
+	    break;
+    }
+
+    return ( TRUE );
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gsb_transactions_list.h b/src/gsb_transactions_list.h
index 9677f55..9aed76f 100644
--- a/src/gsb_transactions_list.h
+++ b/src/gsb_transactions_list.h
@@ -38,6 +38,7 @@ enum
 
 
 /* START_DECLARATION */
+gboolean change_aspect_liste ( gint demande );
 gboolean clone_selected_transaction ( GtkWidget *menu_item,
                         gpointer null );
 GtkWidget *creation_fenetre_operations ( void );
@@ -45,6 +46,7 @@ gint find_element_col ( gint element_number );
 gint find_element_col_for_archive ( void );
 gint find_element_col_split ( gint element_number );
 gint find_element_line ( gint element_number );
+void gsb_gui_update_transaction_toolbar ( void );
 gchar *gsb_transactions_get_category_real_name ( gint transaction_number );
 gboolean gsb_transactions_list_append_new_transaction ( gint transaction_number,
                         gboolean update_tree_view );
diff --git a/src/imputation_budgetaire.c b/src/imputation_budgetaire.c
index 56db397..a313393 100644
--- a/src/imputation_budgetaire.c
+++ b/src/imputation_budgetaire.c
@@ -44,6 +44,7 @@
 #include "gsb_transactions_list.h"
 #include "gtk_combofix.h"
 #include "main.h"
+#include "meta_budgetary.h"
 #include "metatree.h"
 #include "mouse.h"
 #include "transaction_list.h"
@@ -63,7 +64,6 @@ static gboolean budgetary_line_list_button_press ( GtkWidget *tree_view,
                         GdkEventButton *ev,
                         gpointer null );
 static void budgetary_line_list_popup_context_menu ( void );
-static GtkWidget *creation_barre_outils_ib ( void );
 static gboolean edit_budgetary_line ( GtkTreeView * view );
 static void exporter_ib ( void );
 static void importer_ib ( void );
@@ -71,9 +71,9 @@ static gboolean popup_budgetary_line_view_mode_menu ( GtkWidget * button );
 static void selectionne_sub_budgetary ( GtkTreeModel * model );
 /*END_STATIC*/
 
-
-GtkWidget *budgetary_line_tree = NULL;
-GtkTreeStore *budgetary_line_tree_model = NULL;
+static GtkWidget *budgetary_toolbar;
+static GtkWidget *budgetary_line_tree = NULL;
+static GtkTreeStore *budgetary_line_tree_model = NULL;
 gint no_devise_totaux_ib;
 
 /* variable for the management of the cancelled edition */
@@ -83,7 +83,6 @@ static gboolean sortie_edit_budgetary_line = FALSE;
 static struct metatree_hold_position *budgetary_hold_position;
 
 /*START_EXTERN*/
-extern MetatreeInterface * budgetary_interface;
 extern GdkColor couleur_selection;
 /*END_EXTERN*/
 
@@ -91,11 +90,12 @@ extern GdkColor couleur_selection;
 
 
 
-/* **************************************************************************************************** */
-/* Fonction onglet_imputations : */
-/* crée et renvoie le widget contenu dans l'onglet */
-/* **************************************************************************************************** */
-
+/**
+ * crée et renvoie le widget contenu dans l'onglet
+ *
+ *
+ *
+ */
 GtkWidget *onglet_imputations ( void )
 {
     GtkWidget *scroll_window;
@@ -108,7 +108,6 @@ GtkWidget *onglet_imputations ( void )
 	{ "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
     };
 
-
     /* We create the gtktreeview and model early so that they can be referenced. */
     budgetary_line_tree = gtk_tree_view_new();
 
@@ -123,7 +122,9 @@ GtkWidget *onglet_imputations ( void )
     gtk_widget_show ( vbox );
 
     /* on y ajoute la barre d'outils */
-    gtk_box_pack_start ( GTK_BOX ( vbox ), creation_barre_outils_ib(), FALSE, FALSE, 0 );
+    budgetary_toolbar = gtk_handle_box_new ( );
+    gtk_widget_show ( budgetary_toolbar );
+    gtk_box_pack_start ( GTK_BOX ( vbox ), budgetary_toolbar, FALSE, FALSE, 0 );
 
     /* création de l'arbre principal */
     scroll_window = gtk_scrolled_window_new ( NULL, NULL );
@@ -136,12 +137,12 @@ GtkWidget *onglet_imputations ( void )
 
     /* Create model */
     gtk_tree_sortable_set_sort_column_id ( GTK_TREE_SORTABLE(budgetary_line_tree_model),
-					   META_TREE_TEXT_COLUMN, GTK_SORT_ASCENDING );
+                        META_TREE_TEXT_COLUMN, GTK_SORT_ASCENDING );
     gtk_tree_sortable_set_sort_func ( GTK_TREE_SORTABLE(budgetary_line_tree_model),
-				      META_TREE_TEXT_COLUMN, metatree_sort_column,
-				      NULL, NULL );
+                        META_TREE_TEXT_COLUMN, metatree_sort_column,
+                        NULL, NULL );
     g_object_set_data ( G_OBJECT ( budgetary_line_tree_model), "metatree-interface",
-			budgetary_interface );
+                        budgetary_line_get_metatree_interface ( ) );
 
     /* Create container + TreeView */
     gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (budgetary_line_tree), TRUE);
@@ -270,9 +271,11 @@ void remplit_arbre_imputation ( void )
 
 	budget_number = gsb_data_budget_get_no_budget (budget_list -> data);
 
-	gtk_tree_store_append (GTK_TREE_STORE (budgetary_line_tree_model), &iter_budgetary_line, NULL);
-	fill_division_row ( GTK_TREE_MODEL(budgetary_line_tree_model), budgetary_interface,
-			    &iter_budgetary_line, budget_number);
+	gtk_tree_store_append ( GTK_TREE_STORE ( budgetary_line_tree_model ), &iter_budgetary_line, NULL);
+	fill_division_row ( GTK_TREE_MODEL ( budgetary_line_tree_model ),
+                        budgetary_line_get_metatree_interface ( ),
+                        &iter_budgetary_line,
+                        budget_number );
 
 	/** Each budget has sub budgetary lines. */
 	if ( budget_number )
@@ -287,12 +290,13 @@ void remplit_arbre_imputation ( void )
 
 		sub_budget_number = gsb_data_budget_get_no_sub_budget (sub_budget_list -> data);
 
-		gtk_tree_store_append (GTK_TREE_STORE (budgetary_line_tree_model),
+		gtk_tree_store_append ( GTK_TREE_STORE (budgetary_line_tree_model),
 				       &iter_sub_budgetary_line, &iter_budgetary_line);
-		fill_sub_division_row ( GTK_TREE_MODEL(budgetary_line_tree_model), budgetary_interface,
-					&iter_sub_budgetary_line,
-					budget_number,
-					sub_budget_number);
+		fill_sub_division_row ( GTK_TREE_MODEL ( budgetary_line_tree_model ),
+                        budgetary_line_get_metatree_interface ( ),
+                        &iter_sub_budgetary_line,
+                        budget_number,
+                        sub_budget_number );
 
 		sub_budget_list = sub_budget_list -> next;
 	    }
@@ -301,14 +305,18 @@ void remplit_arbre_imputation ( void )
 	/* add the no-sub-budget only if budget exists */
 	if (budget_number)
 	{
-	    gtk_tree_store_append (GTK_TREE_STORE (budgetary_line_tree_model),
-				   &iter_sub_budgetary_line, &iter_budgetary_line);
-	    fill_sub_division_row ( GTK_TREE_MODEL(budgetary_line_tree_model), budgetary_interface,
-				    &iter_sub_budgetary_line, budget_number, 0 );
+	    gtk_tree_store_append ( GTK_TREE_STORE ( budgetary_line_tree_model ),
+                        &iter_sub_budgetary_line,
+                        &iter_budgetary_line );
+	    fill_sub_division_row ( GTK_TREE_MODEL(budgetary_line_tree_model),
+                        budgetary_line_get_metatree_interface ( ),
+                        &iter_sub_budgetary_line,
+                        budget_number,
+                        0 );
 	}
 	budget_list = budget_list -> next;
     }
-        /* replace le curseur sur la division, sub_division ou opération initiale */
+    /* replace le curseur sur la division, sub_division ou opération initiale */
     if ( budgetary_hold_position -> path )
     {
         if ( budgetary_hold_position -> expand )
@@ -399,7 +407,7 @@ void exporter_ib ( void )
     switch ( resultat )
     {
 	case GTK_RESPONSE_OK :
-	    nom_ib =file_selection_get_filename ( GTK_FILE_CHOOSER ( dialog ));
+	    nom_ib = file_selection_get_filename ( GTK_FILE_CHOOSER ( dialog ));
 	    gsb_file_update_last_path (file_selection_get_last_directory (GTK_FILE_CHOOSER (dialog), TRUE));
 	    gtk_widget_destroy ( GTK_WIDGET ( dialog ));
 
@@ -524,98 +532,116 @@ void importer_ib ( void )
  */
 GtkWidget *creation_barre_outils_ib ( void )
 {
-    GtkWidget * handlebox, * hbox2, * button;
-
-    /* HandleBox */
-    handlebox = gtk_handle_box_new ();
+    GtkWidget *hbox, *button;
 
-    /* Hbox2 */
-    hbox2 = gtk_hbox_new ( FALSE, 0 );
-    gtk_container_add ( GTK_CONTAINER(handlebox), hbox2 );
+    /* Hbox */
+    hbox = gtk_hbox_new ( FALSE, 0 );
 
     /* New budgetary line button */
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("New\nbudgetary line"), "new-ib.png",
-					       G_CALLBACK(appui_sur_ajout_imputation),
-					       budgetary_line_tree_model );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Create a new budgetary line") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
-    g_object_set_data ( G_OBJECT (button), "type", GINT_TO_POINTER (1) );
+                                _("New\nbudgetary line"), "new-ib.png",
+                                G_CALLBACK ( appui_sur_ajout_imputation ),
+                                budgetary_line_tree_model );
+
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Create a new budgetary line") );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+    g_object_set_data ( G_OBJECT ( button ), "type", GINT_TO_POINTER (1) );
 
     /* New sub budgetary line button */
     button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
-					       _("New sub\nbudgetary line"),
-					       "new-sub-ib.png",
-					       G_CALLBACK(appui_sur_ajout_imputation),
-					       budgetary_line_tree_model );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL(budgetary_line_tree_model), button, "selection" );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL(budgetary_line_tree_model), button, "sub-division" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Create a new sub-budgetary line") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
-    g_object_set_data ( G_OBJECT (button), "type", GINT_TO_POINTER (2) );
+                                _("New sub\nbudgetary line"),
+                                "new-sub-ib.png",
+                                G_CALLBACK ( appui_sur_ajout_imputation ),
+                                budgetary_line_tree_model );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( budgetary_line_tree_model ), button, "selection" );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( budgetary_line_tree_model ), button, "sub-division" );
+
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Create a new sub-budgetary line") );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+    g_object_set_data ( G_OBJECT ( button ), "type", GINT_TO_POINTER (2) );
 
     /* Import button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_OPEN,
-					   _("Import"),
-					   G_CALLBACK(importer_ib),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Import a Grisbi budgetary line file (.igsb)"
-                            " or create from a list of categories (.cgsb)" ) );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                GTK_STOCK_OPEN,
+                                _("Import"),
+                                G_CALLBACK(importer_ib),
+                                NULL );
+
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                        _("Import a Grisbi budgetary line file (.igsb)"
+                        " or create from a list of categories (.cgsb)" ) );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* Export button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_SAVE,
-					   _("Export"),
-					   G_CALLBACK(exporter_ib),
-					   NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Export a Grisbi budgetary line file (.igsb)") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                GTK_STOCK_SAVE,
+                                _("Export"),
+                                G_CALLBACK(exporter_ib),
+                                NULL );
+
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+                        _("Export a Grisbi budgetary line file (.igsb)") );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* Delete button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_DELETE, _("Delete"),
-					   G_CALLBACK(supprimer_division),
-					   budgetary_line_tree );
-    metatree_register_widget_as_linked ( GTK_TREE_MODEL(budgetary_line_tree_model), button, "selection" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Delete selected budgetary line") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                GTK_STOCK_DELETE, _("Delete"),
+                                G_CALLBACK ( supprimer_division ),
+                                budgetary_line_tree );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( budgetary_line_tree_model ), button, "selection" );
+
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Delete selected budgetary line") );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* Properties button */
     button = gsb_automem_stock_button_new ( etat.display_toolbar,
-					   GTK_STOCK_PROPERTIES, _("Properties"),
-					   G_CALLBACK(edit_budgetary_line),
-					   budgetary_line_tree );
+                                GTK_STOCK_PROPERTIES, _("Properties"),
+                                G_CALLBACK ( edit_budgetary_line ),
+                                budgetary_line_tree );
     metatree_register_widget_as_linked ( GTK_TREE_MODEL(budgetary_line_tree_model), button, "selection" );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Edit selected budgetary line") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Edit selected budgetary line") );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
     /* View button */
     button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
-						GTK_STOCK_SELECT_COLOR,
-						_("View"),
-						G_CALLBACK(popup_budgetary_line_view_mode_menu),
-						NULL );
-    gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
-				  _("Change display mode") );
-    gtk_box_pack_start ( GTK_BOX ( hbox2 ), button, FALSE, TRUE, 0 );
+                                GTK_STOCK_SELECT_COLOR,
+                                _("View"),
+                                G_CALLBACK(popup_budgetary_line_view_mode_menu),
+                                NULL );
+
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ), _("Change display mode") );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
 
-    gtk_widget_show_all ( handlebox );
+    gtk_widget_show_all ( hbox );
 
-    metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL(budgetary_line_tree_model),
-					    FALSE, "selection" );
+    metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL ( budgetary_line_tree_model ), FALSE, "selection" );
 
-    return ( handlebox );
+    return ( hbox );
 }
 
 
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_budgetary_toolbar ( void )
+{
+    GList *list = NULL;
+
+    list = gtk_container_get_children ( GTK_CONTAINER ( budgetary_toolbar ) );
+
+    if ( list )
+    {
+        gtk_container_remove ( GTK_CONTAINER ( budgetary_toolbar ),
+                               GTK_WIDGET ( list -> data ) );
+        g_list_free ( list );
+    }
+
+    gtk_container_add ( GTK_CONTAINER ( budgetary_toolbar ), creation_barre_outils_ib () );
+}
+
 
 /**
  * Popup a menu that allow changing the view mode of the category
@@ -823,22 +849,24 @@ gboolean edit_budgetary_line ( GtkTreeView * view )
     if ( sub_budget_number > 0 )
     {
 	div_iter = get_iter_from_div ( model, budget_number, sub_budget_number );
-	fill_sub_division_row ( model, budgetary_interface,
-				div_iter,
-				budget_number,
-				sub_budget_number);
+	fill_sub_division_row ( model,
+                        budgetary_line_get_metatree_interface ( ),
+                        div_iter,
+                        budget_number,
+                        sub_budget_number );
     }
     else
     {
 	div_iter = get_iter_from_div ( model, budget_number, 0 );
-	fill_division_row ( model, budgetary_interface,
-			    div_iter,
-			    budget_number );
+	fill_division_row ( model,
+                        budgetary_line_get_metatree_interface ( ),
+                        div_iter,
+                        budget_number );
     }
-    gtk_tree_iter_free (div_iter);
+    gtk_tree_iter_free ( div_iter );
 
     /* update the transactions list */
-    transaction_list_update_element (ELEMENT_BUDGET);
+    transaction_list_update_element ( ELEMENT_BUDGET );
 
     return TRUE;
 }
@@ -1109,6 +1137,28 @@ void budgetary_line_list_popup_context_menu ( void )
 }
 
 
+/**
+ *
+ *
+ *
+ */
+GtkTreeStore *budgetary_line_get_tree_store ( void )
+{
+    return budgetary_line_tree_model;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+GtkWidget *budgetary_line_get_tree_view ( void )
+{
+    return budgetary_line_tree;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/imputation_budgetaire.h b/src/imputation_budgetaire.h
index e047e79..20d76aa 100644
--- a/src/imputation_budgetaire.h
+++ b/src/imputation_budgetaire.h
@@ -8,10 +8,13 @@
 
 
 /* START_DECLARATION */
+GtkTreeStore *budgetary_line_get_tree_store ( void );
+GtkWidget *budgetary_line_get_tree_view ( void );
 GtkTreePath *budgetary_hold_position_get_path ( void );
 gboolean budgetary_hold_position_set_expand ( gboolean expand );
 gboolean budgetary_hold_position_set_path ( GtkTreePath *path );
 gboolean gsb_budget_update_combofix ( gboolean force );
+void gsb_gui_update_budgetary_toolbar ( void );
 GtkWidget *onglet_imputations ( void );
 void remplit_arbre_imputation ( void );
 /* END_DECLARATION */
diff --git a/src/menu.c b/src/menu.c
index 264b2dd..22fa4c0 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -32,7 +32,6 @@
 
 /*START_INCLUDE*/
 #include "menu.h"
-#include "barre_outils.h"
 #include "custom_list.h"
 #include "export.h"
 #include "fenetre_principale.h"
diff --git a/src/meta_budgetary.c b/src/meta_budgetary.c
index 9e0f046..dd74bd5 100644
--- a/src/meta_budgetary.c
+++ b/src/meta_budgetary.c
@@ -27,7 +27,6 @@
 #include "include.h"
 #include <glib/gi18n.h>
 
-#include "metatree.h"
 
 /*START_INCLUDE*/
 #include "meta_budgetary.h"
@@ -35,8 +34,8 @@
 #include "gsb_data_budget.h"
 #include "gsb_data_scheduled.h"
 #include "gsb_data_transaction.h"
-#include "utils_str.h"
 #include "gsb_real.h"
+#include "utils_str.h"
 /*END_INCLUDE*/
 
 
@@ -45,10 +44,10 @@ static gint budgetary_line_add_div ();
 static gint budgetary_line_add_sub_div ( int div_id );
 static gboolean budgetary_line_add_transaction_to_div ( gint transaction_number, 
 						 int div_id );
-static gchar * budgetary_line_div_name ( gint div );
+static gchar *budgetary_line_div_name ( gint div );
 static gint budgetary_line_get_without_div_pointer ( );
 static gsb_real budgetary_line_sub_div_balance ( gint div, gint sub_div );
-static gchar * budgetary_line_sub_div_name ( gint div, gint sub_div );
+ tatic gchar * budgetary_line_sub_div_name ( gint div, gint sub_div );  );  ber,   ib () );  SE, "selection" );       @
­¸ÿ         "±œD+          ò7œD+  À­¸ÿ         0­¸ÿ  ó¸œD+  È4œD+  èÄ'œD+                          ’¨#D+  0­¸ÿ  €ÀED+          @
­¸ÿ         ­¸ÿ  ë͜D+  6                    è     è!     è!     À­¸ÿ  0­¸ÿ  xd#D+          @­¸ÿ          "±œD+          ΜD+  À­¸ÿ  ð°œD+  ÿ­¸ÿ         À_‡D+  ó¸œD+   P‡D+  ØT‡D+  ¨Y‡D+  È4œD+          xd#D+          @­¸ÿ          
­¸ÿ  ë͜D+  à!     à!     À­¸ÿ  0­¸ÿ  È-D+           ­¸ÿ         "±œD+          ΜD+  À­¸ÿ  ð°œD+  ÿ­¸ÿ  ð­¸ÿ  è­¸ÿ  Ë'œD+  Œp˜        0­¸ÿ  ó¸œD+  È4œD+                   ­¸ÿ         ð
­¸ÿ  ë͜D+          G       H   I       J   K           M   N   O       P   À­¸ÿ  0­¸ÿ  HåٜD+          À­¸ÿ         "±œD+          ΜD+  À­¸ÿ         0_‡D+  ó¸œD+   p#D+   ·œD+   P‡D+  ØT‡D+  ¨Y‡D+  È4œD+          HåٜD+          À­¸ÿ          ­¸ÿ  ë͜D+  8åٜD+          À­¸ÿ         0­¸ÿ  ë͜D+  (åٜD+          À­¸ÿ         `­¸ÿ  ë͜D+  åٜD+          À­¸ÿ         ­¸ÿ  ë͜D+  	       ¨^‡D+  ó¸œD+         ¨Y‡D+  
­¸ÿ          Šh·œD+  淜D+         ØT‡D+  0­¸ÿ          yh·œD+  淜D+          P‡D+  `­¸ÿ          Zh·œD+  淜D+  Ø·œD+   p#D+   ·œD+   P‡D+  Øt#D+  ØT‡D+  ¨Y‡D+  È4œD+          à]µœD+          à­¸ÿ         °­¸ÿ  ë͜D+  #   %       '       )       *   -   .   0   3       5   6   7   8   :   <   =   À­¸ÿ  0­¸ÿ  p›œD+           ­¸ÿ          "±œD+                 8#D+  ó¸œD+  Øt#D+   y#D+  È4œD+                          c   f   ÝMœD+  0­¸ÿ  p›œD+           ­¸ÿ          Э¸ÿ  ë͜D+  Ó%°•æ§ìš‹wqÒ-øÒ êÓïs¨Ó,~9„×u]ÞÓ	4Q ÷U^Qʉ§ ¶uª¹ñìò*ēv´rSœD+          p­¸ÿ  F€êD+  F€êD+         ?ÅPœD+         0­¸ÿ  ­¸ÿ  P­¸ÿ  ÝMœD+  淜D+  èÄ'œD+  °­¸ÿ  B€êD+  €­¸ÿ  ÿ­¸ÿ  õ\(œD+  0­¸ÿ          ÿÿÿÿÿÿÿÿB€êD+          8­¸ÿ  ë͜            static gchar *budgetary_line_sub_div_name ( gint div, gint sub_div );
 static gint budgetary_line_sub_div_nb_transactions ( gint div, gint sub_div );
 static gint budgetary_lint_get_number_by_name ( const gchar *name, gboolean create );
 /*END_STATIC*/
@@ -104,7 +103,7 @@ static MetatreeInterface _budgetary_interface = {
     budgetary_hold_position_set_expand,
 };
 
-MetatreeInterface * budgetary_interface = &_budgetary_interface;
+MetatreeInterface *budgetary_interface = &_budgetary_interface;
 
 
 /**
@@ -268,6 +267,7 @@ gint budgetary_line_add_sub_div ( int div_id )
 /**
  *
  *
+ *
  */
 gboolean budgetary_line_add_transaction_to_div ( gint transaction_number, 
 						 int div_id )
@@ -278,3 +278,12 @@ gboolean budgetary_line_add_transaction_to_div ( gint transaction_number,
 }
 
 
+/**
+ *
+ *
+ *
+ */
+MetatreeInterface *budgetary_line_get_metatree_interface ( void )
+{
+    return budgetary_interface;
+}
diff --git a/src/meta_budgetary.h b/src/meta_budgetary.h
index 3fde565..c849f8f 100644
--- a/src/meta_budgetary.h
+++ b/src/meta_budgetary.h
@@ -4,10 +4,12 @@
 #include <glib.h>
 
 /* START_INCLUDE_H */
+#include "metatree.h"
 /* END_INCLUDE_H */
 
 
 /* START_DECLARATION */
+MetatreeInterface *budgetary_line_get_metatree_interface ( void );
 gint budgetary_line_tree_currency ( );
 /* END_DECLARATION */
 #endif
diff --git a/src/metatree.c b/src/metatree.c
index 2173ae9..54a46bc 100644
--- a/src/metatree.c
+++ b/src/metatree.c
@@ -2193,22 +2193,23 @@ void metatree_remove_iter_and_select_next ( GtkTreeView * tree_view,
     selection = gtk_tree_view_get_selection ( tree_view );
     if ( selection && gtk_tree_selection_get_selected ( selection, &model, iter ) )
     {
-	GtkTreeIter * next = gtk_tree_iter_copy ( iter );
-	GtkTreePath * path = gtk_tree_model_get_path ( model, iter );
+        GtkTreeIter * next = gtk_tree_iter_copy ( iter );
+        GtkTreePath * path = gtk_tree_model_get_path ( model, iter );
 
-	g_return_if_fail ( path );
-	if ( ! gtk_tree_model_iter_next ( model, next ) )
-	{
-	    gtk_tree_path_up ( path );
-	    gtk_tree_path_next ( path );
-	}
+        g_return_if_fail ( path );
+        if ( ! gtk_tree_model_iter_next ( model, next ) )
+        {
+            gtk_tree_path_up ( path );
+            if ( gtk_tree_path_get_depth ( path ) )
+                gtk_tree_path_next ( path );
+        }
 
-	gtk_tree_store_remove ( GTK_TREE_STORE(model), iter );
-	gtk_tree_selection_select_path ( selection, path );
+        gtk_tree_store_remove ( GTK_TREE_STORE(model), iter );
+        gtk_tree_selection_select_path ( selection, path );
 
-	gtk_tree_iter_free ( next );
-	gtk_tree_path_free ( path );
-    }    
+        gtk_tree_iter_free ( next );
+        gtk_tree_path_free ( path );
+    }
 }
 
 
diff --git a/src/parametres.c b/src/parametres.c
index 51ecc5c..3fbca9a 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -119,8 +119,6 @@ static gint width_spin_button = 50;
 
 /*START_EXTERN*/
 extern GtkWidget *account_page;
-extern GtkWidget *arbre_categ;
-extern GtkWidget *budgetary_line_tree;
 extern struct conditional_message delete_msg[];
 extern gboolean execute_scheduled_of_month;
 extern struct conditional_message messages[];
@@ -1179,6 +1177,8 @@ gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
                         gint *pointeur )
 {
     GtkWidget *payee_tree;
+    GtkWidget *category_tree;
+    GtkWidget *budgetary_tree;
     GtkTreeSelection *selection;
     GtkTreeModel *model;
     GtkTreeIter iter;
@@ -1195,6 +1195,8 @@ gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
 
     page_number = gsb_gui_navigation_get_current_page ( );
     payee_tree = gsb_payee_get_tree_view ( );
+    category_tree = category_list_get_tree_view ( );
+    budgetary_tree = budgetary_line_get_tree_view ( );
 
     switch ( page_number )
     {
@@ -1209,7 +1211,7 @@ gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
 	    break;
 
 	case GSB_CATEGORIES_PAGE:
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( arbre_categ ) );
+        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( category_tree ) );
         if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
             path = gtk_tree_model_get_path ( model, &iter );
         remplit_arbre_categ ();
@@ -1219,7 +1221,7 @@ gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
 	    break;
 
 	case GSB_BUDGETARY_LINES_PAGE:
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( budgetary_line_tree ) );
+        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( budgetary_tree ) );
         if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
             path = gtk_tree_model_get_path ( model, &iter );
 		remplit_arbre_imputation ();
diff --git a/src/tiers_onglet.c b/src/tiers_onglet.c
index 2acfd16..0690ebf 100644
--- a/src/tiers_onglet.c
+++ b/src/tiers_onglet.c
@@ -39,7 +39,6 @@
 
 /*START_INCLUDE*/
 #include "tiers_onglet.h"
-#include "barre_outils.h"
 #include "gsb_assistant.h"
 #include "gsb_automem.h"
 #include "gsb_data_form.h"
@@ -64,6 +63,10 @@
 /*END_INCLUDE*/
 
 /*START_STATIC*/
+static void appui_sur_ajout_payee ( GtkTreeModel * model );
+static void appui_sur_manage_tiers ( void );
+static GtkWidget *creation_barre_outils_tiers ( void );
+static gboolean edit_payee ( GtkTreeView * view );
 static void gsb_assistant_payees_clicked ( GtkButton *button, GtkWidget *assistant );
 static gboolean gsb_assistant_payees_enter_page_2 ( GtkWidget *assistant );
 static gboolean gsb_assistant_payees_enter_page_3 ( GtkWidget *assistant );
@@ -92,9 +95,12 @@ static gboolean payee_drag_data_get ( GtkTreeDragSource * drag_source, GtkTreePa
 static gboolean payee_list_button_press ( GtkWidget *tree_view,
                         GdkEventButton *ev,
                         gpointer null );
+static gboolean payee_remove_unused ( GtkWidget *button,
+                        gpointer null );
 static void payee_tree_update_transactions ( GtkTreeModel * model,
                         MetatreeInterface * iface, GtkTreeIter * iter,
                         gint division, gchar * old_payee );
+static gboolean popup_payee_view_mode_menu ( GtkWidget * button );
 /*END_STATIC*/
 
 gint no_devise_totaux_tiers;
@@ -182,10 +188,7 @@ GtkWidget *onglet_tiers ( void )
     /* on y ajoute la barre d'outils */
     payee_toolbar = gtk_handle_box_new ();
     gtk_widget_show ( payee_toolbar );
-    gsb_gui_update_payee_toolbar ();
-    gtk_box_pack_start ( GTK_BOX ( onglet ),
-                         payee_toolbar,
-                         FALSE, FALSE, 0 );
+    gtk_box_pack_start ( GTK_BOX ( onglet ), payee_toolbar, FALSE, FALSE, 0 );
 
     /* création de l'arbre principal */
     scroll_window = gtk_scrolled_window_new ( NULL, NULL );
@@ -303,6 +306,111 @@ GtkWidget *onglet_tiers ( void )
 
 
 /**
+ * Create a button bar allowing to act on the payee list.  Some of
+ * these buttons are "linked" to the selection status of the payee
+ * metatree.  That is, if nothing is selected, they will become
+ * unsensitive.
+ *
+ * \return	A newly-allocated widget.
+ */
+GtkWidget *creation_barre_outils_tiers ( void )
+{
+    GtkWidget *hbox, *button;
+    GtkWidget *payee_tree;
+    GtkTreeStore *payee_tree_model;
+
+    /* Hbox */
+    hbox = gtk_hbox_new ( FALSE, 0 );
+
+    /* get the tree_model and the tree_view */
+    payee_tree_model = gsb_payee_get_tree_store ( );
+    payee_tree = gsb_payee_get_tree_view ( );
+
+    /* Add various icons */
+    button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+					       _("New payee"), "new-payee.png",
+					       G_CALLBACK ( appui_sur_ajout_payee ),
+					       payee_tree_model );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Create a new payee"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+    button = gsb_automem_stock_button_new ( etat.display_toolbar,
+					   GTK_STOCK_DELETE, _("Delete"),
+					   G_CALLBACK ( supprimer_division ),
+					   payee_tree );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( payee_tree_model ), button, "selection" );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Delete selected payee"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+    button = gsb_automem_stock_button_new ( etat.display_toolbar,
+					   GTK_STOCK_PROPERTIES, _("Properties"),
+					   G_CALLBACK ( edit_payee ),
+					   payee_tree );
+    metatree_register_widget_as_linked ( GTK_TREE_MODEL ( payee_tree_model ), button, "selection" );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Edit selected payee"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+    button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
+						GTK_STOCK_SELECT_COLOR,
+						_("View"),
+						G_CALLBACK ( popup_payee_view_mode_menu ),
+						NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Change view mode"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+	button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+						_("Manage payees"), "payeesmg.png",
+						G_CALLBACK ( appui_sur_manage_tiers ),
+						NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Manage the payees"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+    button = gsb_automem_stock_button_new ( etat.display_toolbar,
+					   GTK_STOCK_DELETE, _("Remove unused payees"),
+					   G_CALLBACK ( payee_remove_unused ),
+					   NULL );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+				  _("Remove orphan payees"));
+    gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+    gtk_widget_show_all ( hbox );
+
+    metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL ( payee_tree_model ),
+					    FALSE, "selection" );
+
+    return ( hbox );
+}
+
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_payee_toolbar ( void )
+{
+    GList * list = NULL;
+
+    list = gtk_container_get_children ( GTK_CONTAINER ( payee_toolbar ) );
+    
+    if ( list )
+    {
+	gtk_container_remove ( GTK_CONTAINER ( payee_toolbar ),
+			       GTK_WIDGET ( list -> data ) );
+	g_list_free ( list );
+    }
+    gtk_container_add ( GTK_CONTAINER ( payee_toolbar ), creation_barre_outils_tiers () );
+}
+
+
+
+/**
  * called by button delete unused payees
  * show a message to be sure and remove all the payees without transactions
  *
@@ -1655,17 +1763,6 @@ GtkWidget *gsb_payee_get_tree_view ( void )
 }
 
 
-/**
- *
- *
- *
- */
-GtkWidget *gsb_payee_get_toolbar ( void )
-{
-    return payee_toolbar;
-}
-
-
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/tiers_onglet.h b/src/tiers_onglet.h
index bfc7942..2a40dc7 100644
--- a/src/tiers_onglet.h
+++ b/src/tiers_onglet.h
@@ -11,19 +11,13 @@
 gint classement_alphabetique_tree ( GtkWidget *tree,
                         GtkCListRow *ligne_1,
                         GtkCListRow *ligne_2 );
-GtkWidget *gsb_payee_get_toolbar ( void );
 GtkTreeStore *gsb_payee_get_tree_store ( void );
 GtkWidget *gsb_payee_get_tree_view ( void );
 gboolean gsb_payee_update_combofix ( void );
+void gsb_gui_update_payee_toolbar ( 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 );
-void appui_sur_ajout_payee ( GtkTreeModel * model );
-void appui_sur_manage_tiers ( void );
-gboolean edit_payee ( GtkTreeView * view );
-gboolean popup_payee_view_mode_menu ( GtkWidget * button );
-gboolean payee_remove_unused ( GtkWidget *button,
-                        gpointer null );
 /* END_DECLARATION */
 #endif
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index 8319357..aca0d45 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -216,7 +216,6 @@ extern gint affichage_echeances;
 extern gint affichage_echeances_perso_nb_libre;
 extern GtkTreeModel *bank_list_model;
 extern gint bet_array_col_width[BET_ARRAY_COLUMNS];
-extern GtkTreeStore *categ_tree_model;
 extern gint current_tree_view_width;
 extern GtkWidget *detail_devise_compte;
 extern gint display_one_line;
@@ -476,9 +475,6 @@ void init_variables ( void )
     id_timeout = 0;
     }
 
-    /* initialise la liste des catégories */
-    categ_tree_model = NULL;
-
     /* initializes the variables for the estimate balance module */
     /* création de la liste des données à utiliser dans le tableau de résultats */
     bet_data_init_variables ( );
diff --git a/src/utils_operations.c b/src/utils_operations.c
index 93ec10f..b3e0dfd 100644
--- a/src/utils_operations.c
+++ b/src/utils_operations.c
@@ -31,9 +31,11 @@
 
 /*START_INCLUDE*/
 #include "utils_operations.h"
+#include "categories_onglet.h"
 #include "gsb_data_budget.h"
 #include "gsb_data_category.h"
 #include "gsb_data_payee.h"
+#include "imputation_budgetaire.h"
 #include "metatree.h"
 #include "tiers_onglet.h"
 #include "erreur.h"
@@ -50,11 +52,7 @@ static void update_transaction_in_payee_tree ( gint transaction_number );
 
 
 /*START_EXTERN*/
-extern GtkWidget *arbre_categ;
 extern MetatreeInterface * budgetary_interface;
-extern GtkWidget *budgetary_line_tree;
-extern GtkTreeStore *budgetary_line_tree_model;
-extern GtkTreeStore *categ_tree_model;
 extern MetatreeInterface * category_interface;
 extern MetatreeInterface * payee_interface;
 /*END_EXTERN*/
@@ -104,7 +102,9 @@ void update_transaction_in_categ_tree ( gint transaction_number )
 {
     /* FIXME: Kludgeish, we should maintain a state. */
     gsb_data_category_update_counters();
-    update_transaction_in_tree ( category_interface, GTK_TREE_MODEL (categ_tree_model), transaction_number );
+    update_transaction_in_tree ( category_interface, 
+                                 GTK_TREE_MODEL ( category_list_get_tree_store ( ) ), 
+                                 transaction_number );
 }
 
 
@@ -115,10 +115,12 @@ void update_transaction_in_categ_tree ( gint transaction_number )
  */
 void update_transaction_in_budgetary_line_tree ( gint transaction_number )
 {
+    
     /* FIXME: Kludgeish, we should maintain a state. */
     gsb_data_budget_update_counters();
-    update_transaction_in_tree ( budgetary_interface, GTK_TREE_MODEL (budgetary_line_tree_model), 
-				 transaction_number );
+    update_transaction_in_tree ( budgetary_interface,
+                        GTK_TREE_MODEL ( budgetary_line_get_tree_store ( ) ), 
+                        transaction_number );
 }
 
 
@@ -143,8 +145,10 @@ void update_transaction_in_payee_tree ( gint transaction_number )
 void delete_transaction_in_categ_tree ( gint transaction_number )
 {
     gsb_data_category_remove_transaction_from_category (transaction_number);
-    metatree_remove_transaction ( GTK_TREE_VIEW (arbre_categ), category_interface,
-				  transaction_number, FALSE);
+    metatree_remove_transaction ( GTK_TREE_VIEW ( category_list_get_tree_view ), 
+                                  category_interface,
+                                  transaction_number, 
+                                  FALSE);
 }
 
 
@@ -156,8 +160,10 @@ void delete_transaction_in_categ_tree ( gint transaction_number )
 void delete_transaction_in_budgetary_line_tree ( gint transaction_number )
 {
     gsb_data_budget_remove_transaction_from_budget (transaction_number);
-    metatree_remove_transaction ( GTK_TREE_VIEW (budgetary_line_tree), budgetary_interface,
-				  transaction_number, FALSE);
+    metatree_remove_transaction ( GTK_TREE_VIEW ( budgetary_line_get_tree_view ( ) ),
+                        budgetary_interface,
+                        transaction_number,
+                        FALSE );
 }
 
 
diff --git a/win32-msvc/CMakeLists.txt b/win32-msvc/CMakeLists.txt
index 5186151..99baeee 100644
--- a/win32-msvc/CMakeLists.txt
+++ b/win32-msvc/CMakeLists.txt
@@ -107,8 +107,6 @@ SET (grisbi_source
 	../src/affichage.h
 	../src/affichage_liste.c
 	../src/affichage_liste.h
-	../src/barre_outils.c
-	../src/barre_outils.h
 	../src/bet_config.c
 	../src/bet_config.h
 	../src/bet_data.c
@@ -629,4 +627,4 @@ foreach (current_po ${po_files})
 	COMMAND xcopy /S /Y /I /D target\\lib\\locale target\\$(Platform)\\$(Configuration)\\lib\\locale
 	# COMMAND IF NOT EXIST target\\Release\\lib mkdir target\\Release\\lib
 	# COMMAND xcopy /S /Y /I /D target\\lib\\locale target\\Release\\lib\\locale
-)
\ No newline at end of file
+)


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list