[grisbi-cvs] [SCM] grisbi branch, pbiava_new_etats, updated. upstream_version_0_9_4-170-g1dc8264

Pierre Biava nobody at users.sourceforge.net
Sun Oct 30 22:09:34 CET 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, pbiava_new_etats has been updated
       via  1dc8264ea32c6f3804d974e875e8a50f3ce8b996 (commit)
       via  e04f7472e3f2c1ad3b040fc331abe77bec911bb1 (commit)
       via  ce601262698b87c73f0833b015a982ab659ceffb (commit)
       via  9ed5df0563968ca79760b340c41e51932911cc58 (commit)
      from  0df56846e73207cba0e30db565f517feaa7d0570 (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 1dc8264ea32c6f3804d974e875e8a50f3ce8b996
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Oct 30 22:08:45 2011 +0100

    rename button_group_by_categ in bouton_group_by_categ

commit e04f7472e3f2c1ad3b040fc331abe77bec911bb1
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Oct 30 21:57:41 2011 +0100

    Adds the grouping data tab

commit ce601262698b87c73f0833b015a982ab659ceffb
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Oct 30 16:35:42 2011 +0100

    Changes the location of the variable: direction_move

commit 9ed5df0563968ca79760b340c41e51932911cc58
Author: pbiava <pierre.biava at nerim.net>
Date:   Sat Oct 29 20:31:08 2011 +0200

    Adds the miscellaneous tab and minor changes

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

Changes:
diff --git a/src/etats_config.c b/src/etats_config.c
index 2a36d46..523da55 100644
--- a/src/etats_config.c
+++ b/src/etats_config.c
@@ -282,7 +282,7 @@ static GtkWidget *liste_comptes_virements = NULL;
 static GtkWidget *bouton_exclure_non_virements_etat = NULL;
 static GtkWidget *hbox_liste_comptes_virements = NULL;
 
-static GtkWidget *button_group_by_categ = NULL;
+static GtkWidget *bouton_group_by_categ = NULL;
 static GtkWidget *button_detail_categ = NULL;
 static GtkWidget *hbox_detaille_categ_etat = NULL;
 static GtkWidget *bouton_afficher_sous_categ = NULL;
@@ -969,18 +969,18 @@ void personnalisation_etat (void)
 
 
     /* onglet catégories */
-    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button_group_by_categ ),
+    gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( bouton_group_by_categ ),
 				   gsb_data_report_get_category_used (current_report_number));
 
-    sens_desensitive_pointeur ( button_group_by_categ,
+    sens_desensitive_pointeur ( bouton_group_by_categ,
 				bouton_affiche_sous_total_categ );
-    sens_desensitive_pointeur ( button_group_by_categ,
+    sens_desensitive_pointeur ( bouton_group_by_categ,
 				bouton_afficher_sous_categ );
-    sens_desensitive_pointeur ( button_group_by_categ,
+    sens_desensitive_pointeur ( bouton_group_by_categ,
 				bouton_affiche_sous_total_sous_categ );
-    sens_desensitive_pointeur ( button_group_by_categ,
+    sens_desensitive_pointeur ( bouton_group_by_categ,
 				bouton_afficher_pas_de_sous_categ );
-    sens_desensitive_pointeur ( button_group_by_categ,
+    sens_desensitive_pointeur ( bouton_group_by_categ,
 				bouton_afficher_noms_categ );
 
     gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button_detail_categ ),
@@ -1627,7 +1627,7 @@ void recuperation_info_perso_etat ( void )
 
     /* get the categories */
     gsb_data_report_set_category_used ( current_report_number,
-					gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button_group_by_categ )));
+					gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( bouton_group_by_categ )));
 
     gsb_data_report_set_category_detail_used ( current_report_number,
 					       gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button_detail_categ )));
@@ -6229,8 +6229,8 @@ GtkWidget *page_data_grouping ( void )
     bouton_utilise_tiers_etat = gtk_check_button_new_with_label ( _("Group transactions by payee") );
     gtk_box_pack_start ( GTK_BOX ( paddingbox ), bouton_utilise_tiers_etat, FALSE, FALSE, 0 );
 
-    button_group_by_categ = gtk_check_button_new_with_label ( _("Group transactions by category") );
-    gtk_box_pack_start ( GTK_BOX ( paddingbox ), button_group_by_categ, FALSE, FALSE, 0 );
+    bouton_group_by_categ = gtk_check_button_new_with_label ( _("Group transactions by category") );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), bouton_group_by_categ, FALSE, FALSE, 0 );
 
     bouton_utilise_ib_etat = gtk_check_button_new_with_label ( _("Group transactions by budgetary line") );
     gtk_box_pack_start ( GTK_BOX ( paddingbox ), bouton_utilise_ib_etat, FALSE, FALSE, 0 );
@@ -7075,7 +7075,7 @@ GtkWidget *onglet_affichage_etat_divers ( void )
 			 0 );
     gtk_widget_show ( bouton_afficher_noms_categ );
 
-    g_signal_connect ( G_OBJECT ( button_group_by_categ ),
+    g_signal_connect ( G_OBJECT ( bouton_group_by_categ ),
 			 "toggled",
 			 G_CALLBACK ( sens_desensitive_pointeur ),
 			 bouton_afficher_noms_categ );
@@ -7091,7 +7091,7 @@ GtkWidget *onglet_affichage_etat_divers ( void )
 			 0 );
     gtk_widget_show ( bouton_affiche_sous_total_categ );
 
-    g_signal_connect ( G_OBJECT ( button_group_by_categ ),
+    g_signal_connect ( G_OBJECT ( bouton_group_by_categ ),
 			 "toggled",
 			 G_CALLBACK ( sens_desensitive_pointeur ),
 			 bouton_affiche_sous_total_categ );
@@ -7106,7 +7106,7 @@ GtkWidget *onglet_affichage_etat_divers ( void )
 			 0 );
     gtk_widget_show ( bouton_afficher_sous_categ );
 
-    g_signal_connect ( G_OBJECT ( button_group_by_categ ),
+    g_signal_connect ( G_OBJECT ( bouton_group_by_categ ),
 			 "toggled",
 			 G_CALLBACK ( sens_desensitive_pointeur ),
 			 bouton_afficher_sous_categ );
@@ -7120,7 +7120,7 @@ GtkWidget *onglet_affichage_etat_divers ( void )
 			 0 );
     gtk_widget_show ( bouton_affiche_sous_total_sous_categ );
 
-    g_signal_connect ( G_OBJECT ( button_group_by_categ ),
+    g_signal_connect ( G_OBJECT ( bouton_group_by_categ ),
 			 "toggled",
 			 G_CALLBACK ( sens_desensitive_pointeur ),
 			 bouton_affiche_sous_total_sous_categ );
@@ -7134,7 +7134,7 @@ GtkWidget *onglet_affichage_etat_divers ( void )
 			 0 );
     gtk_widget_show ( bouton_afficher_pas_de_sous_categ );
 
-    g_signal_connect ( G_OBJECT ( button_group_by_categ ),
+    g_signal_connect ( G_OBJECT ( bouton_group_by_categ ),
 			 "toggled",
 			 G_CALLBACK ( sens_desensitive_pointeur ),
 			 bouton_afficher_pas_de_sous_categ );
diff --git a/src/etats_config_ui.c b/src/etats_config_ui.c
index 9c3b5ec..7530fba 100644
--- a/src/etats_config_ui.c
+++ b/src/etats_config_ui.c
@@ -32,19 +32,8 @@
 
 /*START_INCLUDE*/
 #include "etats_config_ui.h"
-/* #include "dialog.h"  */
-/* #include "etats_calculs.h"  */
-/* #include "etats_config.h"  */
-/* #include "fenetre_principale.h"  */
 #include "gsb_calendar_entry.h"
-/* #include "gsb_data_account.h"  */
-/* #include "gsb_data_budget.h"  */
-/* #include "gsb_data_category.h"  */
-/* #include "gsb_data_fyear.h"  */
-/* #include "gsb_data_payee.h"  */
-/* #include "gsb_data_payment.h"  */
 #include "gsb_etats_config.h"
-/* #include "navigation.h"  */
 #include "structures.h"
 #include "utils.h"
 #include "utils_buttons.h"
@@ -87,11 +76,32 @@ static GtkWidget *etats_config_ui_onglet_comptes_create_page ( gint page );
 static void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( gint page );
 static void etats_config_ui_onglet_comptes_init_buttons_selection ( gchar *name,
                         GtkWidget *tree_view );
+static void etats_config_ui_onglet_data_grouping_button_clicked ( GtkWidget *button,
+                        gpointer data );
+static GtkWidget *etats_config_ui_onglet_data_grouping_create_page ( gint page );
+static gboolean etats_config_ui_onglet_data_grouping_drag_data_get ( GtkTreeDragSource *drag_source,
+                        GtkTreePath *path,
+                        GtkSelectionData *selection_data );
+static gboolean etats_config_ui_onglet_data_grouping_drag_data_received ( GtkTreeDragDest * drag_dest,
+                        GtkTreePath *dest_path,
+                        GtkSelectionData *selection_data );
+static gboolean etats_config_ui_onglet_data_grouping_drop_possible ( GtkTreeDragDest *drag_dest,
+                        GtkTreePath *dest_path,
+                        GtkSelectionData *selection_data );
+static gboolean etats_config_ui_onglet_data_grouping_init_tree_view ( void );
+static void etats_config_ui_onglet_data_grouping_selection_changed ( GtkTreeSelection *selection,
+                        GtkWidget *tree_view );
+
+static GtkWidget *etats_config_ui_onglet_divers_create_page ( gint page );
+static gboolean etats_config_ui_onglet_divers_update_style_left_panel ( GtkWidget *button,
+                        gint *page_number );
 static GtkWidget *etats_config_ui_onglet_mode_paiement_create_page ( gint page );
-static GtkWidget *etats_config_ui_onglet_periode_create_page ( void );
+static GtkWidget *etats_config_ui_onglet_periode_create_page ( gint page );
 static GtkTreeModel *etats_config_ui_onglet_periode_get_liste_dates ( void );
 static gboolean etats_config_ui_onglet_periode_selection_dates_changed ( GtkTreeSelection *selection,
                         GtkWidget *widget );
+static gboolean etats_config_ui_onglet_periode_update_style_left_panel ( GtkWidget *button,
+                        gint *page_number );
 static GtkWidget *etats_config_ui_onglet_tiers_create_page ( gint page );
 static void etats_config_ui_onglet_tiers_entry_delete_text ( GtkEditable *editable,
                         gint start_pos,
@@ -162,7 +172,8 @@ static gchar *etats_config_liste_plages_dates[] =
     N_("Last 3 months"),
     N_("Last 6 months"),
     N_("Last 12 months"),
-    NULL };
+    NULL,
+};
 
 
 /* builder */
@@ -321,7 +332,7 @@ void etats_config_ui_left_panel_populate_tree_model ( GtkTreeStore *tree_model,
     etats_config_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data selection"), -1 );
 
     /* append page Dates */
-    widget = etats_config_ui_onglet_periode_create_page ( );
+    widget = etats_config_ui_onglet_periode_create_page ( page );
     etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Dates"), page );
     page++;
 
@@ -368,19 +379,17 @@ void etats_config_ui_left_panel_populate_tree_model ( GtkTreeStore *tree_model,
     page++;
 
     /* append page Misc. */
-/*     widget = gsb_etats_config_onglet_etat_divers ( page );
- *     etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Miscellaneous"), page );
- *     page++;
- */
+    widget = etats_config_ui_onglet_divers_create_page ( page );
+    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Miscellaneous"), page );
+    page++;
 
     /* remplissage de l'onglet d'organisation */
     etats_config_ui_left_panel_add_line ( tree_model, &iter, NULL, NULL, _("Data organization"), -1 );
 
     /* Data grouping */
-/*     widget = gsb_etats_config_page_data_grouping ( page );
- *     etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Data grouping"), page );
- *     page++;
- */
+    widget = etats_config_ui_onglet_data_grouping_create_page ( page );
+    etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Data grouping"), page );
+    page++;
 
     /* Data separation */
 /*     widget = gsb_etats_config_page_data_separation ( page );
@@ -556,6 +565,8 @@ gboolean etats_config_ui_left_panel_tree_view_update_style ( GtkWidget *button,
 
         return TRUE;
     }
+
+    /* return */
     return FALSE;
 }
 
@@ -569,13 +580,14 @@ gboolean etats_config_ui_left_panel_tree_view_update_style ( GtkWidget *button,
  *
  * \return la page
  */
-GtkWidget *etats_config_ui_onglet_periode_create_page ( void )
+GtkWidget *etats_config_ui_onglet_periode_create_page ( gint page )
 {
     GtkWidget *vbox_onglet;
     GtkWidget *vbox;
     GtkWidget *hbox;
     GtkWidget *entree_date_init_etat;
     GtkWidget *entree_date_finale_etat;
+    GtkWidget *button;
 
     devel_debug (NULL);
 
@@ -619,16 +631,30 @@ GtkWidget *etats_config_ui_onglet_periode_create_page ( void )
                         gtk_builder_get_object ( etat_config_builder, "vbox_utilisation_exo" ) ),
                         10 );
 
+    button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder,
+                        "radio_button_utilise_dates", NULL );
+    /* on met la connection pour changer le style de la ligne du panneau de gauche */
+    g_signal_connect ( G_OBJECT ( button ),
+                        "toggled",
+                        G_CALLBACK ( etats_config_ui_onglet_periode_update_style_left_panel ),
+                        GINT_TO_POINTER ( page ) );
+
     /* on met la connection pour rendre sensitif la frame vbox_utilisation_date */
-    g_signal_connect ( G_OBJECT ( utils_gtkbuilder_get_widget_by_name ( etat_config_builder,
-                        "radio_button_utilise_dates", NULL ) ),
+    g_signal_connect ( G_OBJECT ( button ),
                         "toggled",
                         G_CALLBACK ( sens_desensitive_pointeur ),
                         gtk_builder_get_object ( etat_config_builder, "vbox_utilisation_date" ) );
 
+    button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder,
+                        "radio_button_utilise_exo", NULL );
+    /* on met la connection pour changer le style de la ligne du panneau de gauche */
+    g_signal_connect ( G_OBJECT ( button ),
+                        "toggled",
+                        G_CALLBACK ( etats_config_ui_onglet_periode_update_style_left_panel ),
+                        GINT_TO_POINTER ( page ) );
+
     /* on met la connection pour rendre sensitif la frame vbox_utilisation_exo */
-    g_signal_connect ( G_OBJECT ( utils_gtkbuilder_get_widget_by_name ( etat_config_builder,
-                        "radio_button_utilise_exo", NULL ) ),
+    g_signal_connect ( G_OBJECT ( button ),
                         "toggled",
                         G_CALLBACK ( sens_desensitive_pointeur ),
                         gtk_builder_get_object ( etat_config_builder, "vbox_utilisation_exo" ) );
@@ -702,6 +728,9 @@ gboolean etats_config_ui_onglet_periode_selection_dates_changed ( GtkTreeSelecti
     gtk_tree_model_get ( model, &iter, 1, &selected, -1 );
     etats_config_ui_onglet_periode_date_interval_sensitive ( selected );
 
+    /* on regarde si on utilise des dates personalisées */
+    etats_config_ui_onglet_periode_update_style_left_panel ( NULL, 0 );
+
     return TRUE;
 }
 
@@ -727,6 +756,55 @@ void etats_config_ui_onglet_periode_date_interval_sensitive ( gboolean show )
 }
 
 
+/**
+ * If applicable, update report navigation tree style to reflect which
+ * pages have been changed.
+ *
+ * \param page_number Page that contained an interface element just
+ *                      changed that triggered this event.
+ *
+ * \return      FALSE
+ */
+gboolean etats_config_ui_onglet_periode_update_style_left_panel ( GtkWidget *button,
+                        gint *page_number )
+{
+    GtkWidget *tree_view;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    gchar *path_string;
+    gchar *tmp_str;
+    gint index;
+    gint iter_page_number;
+
+    iter_page_number = GPOINTER_TO_INT ( page_number );
+
+    index = etats_config_ui_buttons_radio_get_active_index ( "radio_button_utilise_exo" );
+
+    if ( index == 0 )
+    {
+        if ( etats_config_ui_tree_view_get_single_row_selected ( "treeview_dates" ) == 1 )
+        index = 1;
+    }
+
+    tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_left_panel" ) );
+    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+    tmp_str = utils_str_itoa ( iter_page_number );
+    path_string = g_strconcat ("0:", tmp_str, NULL );
+
+    gtk_tree_model_get_iter_from_string ( GTK_TREE_MODEL ( model ), &iter, path_string );
+    gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+                        &iter,
+                        LEFT_PANEL_TREE_ITALIC_COLUMN, index,
+                        -1 );
+
+    g_free ( tmp_str );
+    g_free ( path_string );
+
+    /* return */
+    return FALSE;
+}
+
 /*RIGHT_PANEL : ONGLET_VIREMENTS*/
 /**
  * Création de l'onglet virements
@@ -1977,6 +2055,495 @@ GSList *etats_config_ui_onglet_mode_paiement_get_list_rows_selected ( const gcha
 }
 
 
+/*RIGHT_PANEL : ONGLET_DIVERS*/
+/**
+ * Création de l'onglet Divers
+ *
+ * \param
+ *
+ * \return
+ */
+GtkWidget *etats_config_ui_onglet_divers_create_page ( gint page )
+{
+    GtkWidget *vbox_onglet;
+    GtkWidget *vbox;
+    GtkWidget *paddingbox;
+    GtkWidget *button;
+
+    devel_debug (NULL);
+
+    vbox_onglet =  GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_divers" ) );
+
+    vbox = new_vbox_with_title_and_icon ( _("Miscellaneous"), "generalities.png" );
+
+    gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
+    gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
+
+    /* on crée la vbax pour sélectionner les opérations marquées */
+    paddingbox = new_paddingbox_with_title ( vbox_onglet, FALSE, _("Selecting Transactions") );
+
+    vbox = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "vbox_select_transactions_buttons" ) );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), vbox, TRUE, TRUE, 5 );
+
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "radiobutton_marked" ) );
+    /* on met la connection pour changer le style de la ligne du panneau de gauche */
+    g_signal_connect ( G_OBJECT ( button ),
+                        "toggled",
+                        G_CALLBACK ( etats_config_ui_onglet_divers_update_style_left_panel ),
+                        GINT_TO_POINTER ( page ) );
+
+    /* on met la connection pour rendre sensitif la vbox_marked_buttons */
+    g_signal_connect ( G_OBJECT ( button ),
+                        "toggled",
+                        G_CALLBACK ( sens_desensitive_pointeur ),
+                        gtk_builder_get_object ( etat_config_builder, "vbox_marked_buttons" ) );
+
+    /* on met la connection pour changer le style de la ligne du panneau de gauche */
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "radiobutton_marked_No_R" ) );
+    g_signal_connect ( G_OBJECT ( button ),
+                        "toggled",
+                        G_CALLBACK ( etats_config_ui_onglet_divers_update_style_left_panel ),
+                        GINT_TO_POINTER ( page ) );
+
+    /* on crée la vbox pour le bouton bouton_pas_detailler_ventilation */
+    paddingbox = new_paddingbox_with_title ( vbox_onglet, FALSE, _("Split of transactions detail") );
+
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_pas_detailler_ventilation" ) );
+    /* on met la connection pour changer le style de la ligne du panneau de gauche */
+    g_signal_connect ( G_OBJECT ( button ),
+                        "toggled",
+                        G_CALLBACK ( etats_config_ui_onglet_divers_update_style_left_panel ),
+                        GINT_TO_POINTER ( page ) );
+
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, TRUE, TRUE, 5 );
+
+    gtk_widget_show_all ( vbox_onglet );
+
+    return vbox_onglet;
+}
+
+
+/**
+ * If applicable, update report navigation tree style to reflect which
+ * pages have been changed.
+ *
+ * \param page_number Page that contained an interface element just
+ *                      changed that triggered this event.
+ *
+ * \return      FALSE
+ */
+gboolean etats_config_ui_onglet_divers_update_style_left_panel ( GtkWidget *button,
+                        gint *page_number )
+{
+    gint active;
+    gint index;
+
+    index = etats_config_ui_buttons_radio_get_active_index ( "radiobutton_marked_all" );
+    active = etats_config_ui_widget_get_actif ( "bouton_pas_detailler_ventilation" );
+
+    if ( GTK_IS_RADIO_BUTTON ( button ) )
+    {
+        if ( active == 0 )
+            etats_config_ui_left_panel_tree_view_update_style ( button, page_number );
+    }
+    else
+    {
+        if ( index == 0 )
+            etats_config_ui_left_panel_tree_view_update_style ( button, page_number );
+    }
+
+    return TRUE;
+}
+
+
+/*RIGHT_PANEL : ONGLET_DATA_GROUPING*/
+/**
+ * Création de l'onglet groupement des donnés
+ *
+ * \param
+ *
+ * \return
+ */
+GtkWidget *etats_config_ui_onglet_data_grouping_create_page ( gint page )
+{
+    GtkWidget *vbox_onglet;
+    GtkWidget *vbox;
+    GtkWidget *hbox;
+    GtkWidget *paddingbox;
+    GtkWidget *button;
+
+    devel_debug (NULL);
+
+    vbox_onglet =  GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "page_data_grouping" ) );
+
+    vbox = new_vbox_with_title_and_icon ( _("Data grouping"), "organization.png" );
+
+    gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
+    gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
+
+    /* choix de ce qu'on utilise dans le classement */
+    paddingbox = new_paddingbox_with_title ( vbox_onglet, FALSE, _("Group transactions") );
+
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_regroupe_ope_compte_etat" ) );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, FALSE, FALSE, 0 );
+
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_utilise_tiers_etat" ) );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, FALSE, FALSE, 0 );
+
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_group_by_categ" ) );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, FALSE, FALSE, 0 );
+
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_utilise_ib_etat" ) );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, FALSE, FALSE, 0 );
+
+    /* choix du type de classement */
+    paddingbox = new_paddingbox_with_title ( vbox_onglet, TRUE, _("Group level organisation") );
+
+    etats_config_ui_onglet_data_grouping_init_tree_view ( );
+
+    hbox = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "hbox_data_grouping" ) );
+    gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, FALSE, FALSE, 0 );
+
+    /* on met la connection pour modifier l'ordre des données dans le tree_view data_grouping */
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "button_data_grouping_up" ) );
+    g_signal_connect ( G_OBJECT ( button ),
+                        "clicked",
+                        G_CALLBACK ( etats_config_ui_onglet_data_grouping_button_clicked ),
+                        GINT_TO_POINTER ( GSB_UP ) );
+
+    button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "button_data_grouping_down" ) );
+    g_signal_connect ( G_OBJECT ( button ),
+                        "clicked",
+                        G_CALLBACK ( etats_config_ui_onglet_data_grouping_button_clicked ),
+                        GINT_TO_POINTER ( GSB_DOWN ) );
+
+    gtk_widget_show_all ( vbox_onglet );
+
+    /* return */
+    return vbox_onglet;
+}
+
+
+/**
+ * crée un nouveau tree_view initialisé avec model.
+ * le modèle comporte 3 colonnes : G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT
+ * le tree_view n'affiche que la colonne texte.
+ *
+ * \return the tree_wiew
+ */
+gboolean etats_config_ui_onglet_data_grouping_init_tree_view ( void )
+{
+    GtkWidget *tree_view;
+    GtkListStore *store;
+    GtkTreeSelection *selection;
+    GtkTreeViewColumn *column;
+    GtkCellRenderer *cell;
+    GtkTreeDragDestIface *dst_iface;
+    GtkTreeDragSourceIface *src_iface;
+    static GtkTargetEntry row_targets[] =
+    {
+        { "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
+    };
+
+    tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_data_grouping" ) );
+    if ( !tree_view )
+        return FALSE;
+
+    /* colonnes du list_store :
+     *  1 : chaine affichée
+     *  2 : numéro de ligne dans le modèle
+     *  3 : type de donnée : 1 Categ, 3 IB, 5 Account, 6 Payee.
+     */
+    store = gtk_list_store_new ( 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT );
+    gtk_tree_view_set_model ( GTK_TREE_VIEW ( tree_view ), GTK_TREE_MODEL ( store ) );
+    g_object_unref ( G_OBJECT ( store ) );
+
+    utils_set_tree_view_selection_and_text_color ( tree_view );
+
+    /* set the column */
+    cell = gtk_cell_renderer_text_new ( );
+
+    column = gtk_tree_view_column_new_with_attributes ( NULL,
+                        cell,
+                        "text", 0,
+                        NULL);
+    gtk_tree_view_column_set_sizing ( GTK_TREE_VIEW_COLUMN ( column ), GTK_TREE_VIEW_COLUMN_FIXED );
+    gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ),
+                        GTK_TREE_VIEW_COLUMN ( column ) );
+    gtk_tree_view_column_set_resizable ( column, TRUE );
+
+    /* Enable drag & drop */
+    gtk_tree_view_enable_model_drag_source ( GTK_TREE_VIEW ( tree_view ),
+                        GDK_BUTTON1_MASK,
+                        row_targets,
+                        1,
+                        GDK_ACTION_MOVE );
+    gtk_tree_view_enable_model_drag_dest ( GTK_TREE_VIEW ( tree_view ),
+                        row_targets,
+                        1,
+                        GDK_ACTION_MOVE );
+    gtk_tree_view_set_reorderable ( GTK_TREE_VIEW (tree_view), TRUE );
+
+    dst_iface = GTK_TREE_DRAG_DEST_GET_IFACE ( store );
+    if ( dst_iface )
+    {
+        dst_iface -> drag_data_received = &etats_config_ui_onglet_data_grouping_drag_data_received;
+        dst_iface -> row_drop_possible = &etats_config_ui_onglet_data_grouping_drop_possible;
+    }
+
+    src_iface = GTK_TREE_DRAG_SOURCE_GET_IFACE ( store );
+    if ( src_iface )
+    {
+        gtk_selection_add_target ( tree_view,
+                      GDK_SELECTION_PRIMARY,
+                      GDK_SELECTION_TYPE_ATOM,
+                      1 );
+        src_iface -> drag_data_get = &etats_config_ui_onglet_data_grouping_drag_data_get;
+    }
+
+    selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+    g_signal_connect ( G_OBJECT ( selection ),
+                        "changed",
+                        G_CALLBACK ( etats_config_ui_onglet_data_grouping_selection_changed ),
+                        tree_view );
+
+    /* return */
+    return TRUE;
+}
+
+
+/**
+ * callback when treeview_data_grouping receive a drag and drop signal
+ *
+ * \param drag_dest
+ * \param dest_path
+ * \param selection_data
+ *
+ * \return FALSE
+ */
+gboolean etats_config_ui_onglet_data_grouping_drag_data_received ( GtkTreeDragDest *drag_dest,
+                        GtkTreePath *dest_path,
+                        GtkSelectionData *selection_data )
+{
+    if ( dest_path && selection_data )
+    {
+        GtkTreeModel *model;
+        GtkTreeIter src_iter;
+        GtkTreeIter dest_iter;
+        GtkTreePath *src_path;
+        gint src_pos = 0;
+        gint dest_pos;
+        gint src_type_data;
+        gint dest_type_data;
+
+        /* On récupère le model et le path d'origine */
+        gtk_tree_get_row_drag_data ( selection_data, &model, &src_path );
+        
+        /* On récupère les données des 2 lignes à modifier */
+        if ( gtk_tree_model_get_iter ( model, &src_iter, src_path ) )
+            gtk_tree_model_get ( model, &src_iter, 1, &src_pos, 2, &src_type_data, -1 );
+
+        if ( gtk_tree_model_get_iter ( model, &dest_iter, dest_path ) )
+            gtk_tree_model_get ( model, &dest_iter, 1, &dest_pos, 2, &dest_type_data, -1 );
+        else
+            return FALSE;
+
+        /* on met à jour la liste des types pour le tri de données */
+        gsb_etats_config_onglet_data_grouping_move_in_list ( src_pos,
+                        src_type_data,
+                        dest_pos );
+
+        return TRUE;
+    }
+
+    /* return */
+    return FALSE;
+}
+
+
+/**
+ * Fill the drag & drop structure with the path of selected column.
+ * This is an interface function called from GTK, much like a callback.
+ *
+ * \param drag_source       Not used.
+ * \param path              Original path for the gtk selection.
+ * \param selection_data    A pointer to the drag & drop structure.
+ *
+ * \return FALSE, to allow future processing by the callback chain.
+ */
+gboolean etats_config_ui_onglet_data_grouping_drag_data_get ( GtkTreeDragSource *drag_source,
+                        GtkTreePath *path,
+                        GtkSelectionData *selection_data )
+{
+    if ( path )
+    {
+        GtkWidget *tree_view;
+        GtkTreeModel *model;
+
+        tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_data_grouping" ) );
+        model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+        gtk_tree_set_row_drag_data ( selection_data, GTK_TREE_MODEL ( model ), path );
+    }
+
+    return FALSE;
+}
+/**
+ * Checks the validity of the change of position
+ * This is an interface function called from GTK, much like a callback.
+ *
+ * \param drag_dest         Not used.
+ * \param path              Original path for the gtk selection.
+ * \param selection_data    A pointer to the drag & drop structure.
+ *
+ * \return FALSE, to allow future processing by the callback chain.
+ */
+gboolean etats_config_ui_onglet_data_grouping_drop_possible ( GtkTreeDragDest *drag_dest,
+                        GtkTreePath *dest_path,
+                        GtkSelectionData *selection_data )
+{
+    GtkTreePath *orig_path;
+    GtkTreeModel *model;
+    gint src_pos;
+    gint dst_pos = 0;
+    GtkTreeIter iter;
+
+    gtk_tree_get_row_drag_data ( selection_data, &model, &orig_path );
+
+    if ( gtk_tree_model_get_iter ( model, &iter, orig_path ) )
+        gtk_tree_model_get ( model, &iter, 1, &src_pos, -1 );
+
+    if ( gtk_tree_model_get_iter ( model, &iter, dest_path ) )
+        gtk_tree_model_get ( model, &iter, 1, &dst_pos, -1 );
+
+    if ( dst_pos < 0 || dst_pos > 3 )
+        return FALSE;
+
+    if ( src_pos != dst_pos )
+        return TRUE;
+    else
+        return FALSE;
+}
+
+
+/**
+ * callback when a button receive a clicked signal
+ *
+ * \param the button
+ * \param a pointer for the direction of movement
+ *
+ * \return
+ */
+void etats_config_ui_onglet_data_grouping_button_clicked ( GtkWidget *button,
+                        gpointer data )
+{
+    GtkWidget *tree_view;
+    GtkTreeSelection *selection;
+    GtkTreeModel *model;
+    GtkTreeIter orig_iter;
+
+    /* On récupère le model et le path d'origine */
+    tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_data_grouping" ) );
+    selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+
+    if ( gtk_tree_selection_get_selected ( selection, &model, &orig_iter ) )
+    {
+        GtkTreeIter dest_iter;
+        GtkTreePath *path;
+        gchar *string = NULL;
+        gint orig_pos = 0;
+        gint dest_pos;
+        gint orig_type_data;
+        gint dest_type_data;
+        gint sens;
+
+        sens = GPOINTER_TO_INT ( data );
+
+        path = gtk_tree_model_get_path ( model, &orig_iter );
+
+        /* On récupère les données des 2 lignes à modifier */
+        gtk_tree_model_get ( model, &orig_iter, 1, &orig_pos, 2, &orig_type_data, -1 );
+
+        if ( sens == GSB_UP )
+            gtk_tree_path_prev ( path );
+        else
+            gtk_tree_path_next ( path );
+            
+        if ( gtk_tree_model_get_iter ( model, &dest_iter, path ) )
+            gtk_tree_model_get ( model, &dest_iter, 1, &dest_pos, 2, &dest_type_data, -1 );
+        else
+            return;
+        /* on met à jour la ligne de destination */
+        string = gsb_etats_config_onglet_data_grouping_get_string ( orig_type_data, dest_pos );
+        gtk_list_store_set ( GTK_LIST_STORE ( model ), &dest_iter, 0, string, 2, orig_type_data, -1 );
+
+        g_free ( string );
+
+        /* on met à jour la ligne d'origine */
+        string = gsb_etats_config_onglet_data_grouping_get_string ( dest_type_data, orig_pos );
+        gtk_list_store_set ( GTK_LIST_STORE ( model ), &orig_iter, 0, string, 2, dest_type_data, -1 );
+
+        /* on garde la sélection sur le même iter */
+        gtk_tree_selection_select_path ( selection, path );
+
+        g_free ( string );
+    }
+
+    /* return */
+    return;
+}
+
+
+/**
+ * fonction de callback de changement de sélection
+ *
+ * \param selection
+ * \param NULL
+ *
+ * \return
+ */
+void etats_config_ui_onglet_data_grouping_selection_changed ( GtkTreeSelection *selection,
+                        GtkWidget *tree_view )
+{
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+
+    if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
+    {
+        gint pos;
+
+        gtk_tree_model_get ( model, &iter, 1, &pos, -1 );
+        switch ( pos )
+        {
+            case 0:
+                desensitive_widget ( NULL,
+                                GTK_WIDGET ( gtk_builder_get_object (
+                                etat_config_builder, "button_data_grouping_up" ) ) );
+                sensitive_widget ( NULL,
+                                GTK_WIDGET ( gtk_builder_get_object (
+                                etat_config_builder, "button_data_grouping_down" ) ) );
+                break;
+            case 3:
+                sensitive_widget ( NULL,
+                                GTK_WIDGET ( gtk_builder_get_object (
+                                etat_config_builder, "button_data_grouping_up" ) ) );
+                desensitive_widget ( NULL,
+                                GTK_WIDGET ( gtk_builder_get_object (
+                                etat_config_builder, "button_data_grouping_down" ) ) );
+                break;
+            default:
+                sensitive_widget ( NULL,
+                                GTK_WIDGET ( gtk_builder_get_object (
+                                etat_config_builder, "button_data_grouping_up" ) ) );
+                sensitive_widget ( NULL,
+                                GTK_WIDGET ( gtk_builder_get_object (
+                                etat_config_builder, "button_data_grouping_down" ) ) );
+                break;
+        }
+    }
+}
+
+
 /*FONCTIONS UTILITAIRES COMMUNES*/
 /**
  * retourne l'index du radiobutton actif.
diff --git a/src/gsb_data_report.c b/src/gsb_data_report.c
index 34c0e55..03f17fc 100644
--- a/src/gsb_data_report.c
+++ b/src/gsb_data_report.c
@@ -4404,6 +4404,29 @@ void gsb_data_report_free_method_of_payment_list ( gint report_number )
 }
 
 
+/**
+ * free the sorting_type_list
+ *
+ * \param report_number number of the report
+ *
+ * \return
+ * */
+void gsb_data_report_free_sorting_type_list ( gint report_number )
+{
+    struct_report *report;
+
+    report = gsb_data_report_get_structure ( report_number );
+
+    if ( !report )
+        return;
+
+    if ( report->sorting_type )
+        g_slist_free ( report->sorting_type );
+
+    report->sorting_type = NULL;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gsb_data_report.h b/src/gsb_data_report.h
index 1df9cb2..e7c117d 100644
--- a/src/gsb_data_report.h
+++ b/src/gsb_data_report.h
@@ -31,6 +31,7 @@ void gsb_data_report_free_categ_budget_struct_list (GSList *categ_budget_sel_lis
 void gsb_data_report_free_financial_year_list ( gint report_number );
 void gsb_data_report_free_method_of_payment_list ( gint report_number );
 void gsb_data_report_free_payee_numbers_list ( gint report_number );
+void gsb_data_report_free_sorting_type_list ( gint report_number );
 void gsb_data_report_free_transfer_account_numbers_list ( gint report_number );
 gint gsb_data_report_get_account_group_reports ( gint report_number );
 GSList *gsb_data_report_get_account_numbers_list ( gint report_number );
diff --git a/src/gsb_etats_config.c b/src/gsb_etats_config.c
index 1ed0d83..87e91a4 100644
--- a/src/gsb_etats_config.c
+++ b/src/gsb_etats_config.c
@@ -62,6 +62,8 @@
 /*START_STATIC*/
 static gboolean gsb_etats_config_initialise_dialog_from_etat ( gint report_number );
 static void gsb_etats_config_initialise_onglet_comptes ( gint report_number );
+static void gsb_etats_config_initialise_onglet_data_grouping ( gint report_number );
+static void gsb_etats_config_initialise_onglet_divers ( gint report_number );
 static void gsb_etats_config_initialise_onglet_mode_paiement ( gint report_number );
 static void gsb_etats_config_initialise_onglet_periode ( gint report_number );
 static void gsb_etats_config_initialise_onglet_tiers ( gint report_number );
@@ -78,9 +80,13 @@ static gint gsb_etats_config_onglet_categ_budget_sort_function ( GtkTreeModel *m
                         GtkTreeIter *iter_1,
                         GtkTreeIter *iter_2,
                         gpointer ptr );
+static GSList *gsb_etats_config_onglet_data_grouping_get_list ( gint report_number );
+static gboolean gsb_etats_config_onglet_data_grouping_update_model ( gint report_number );
 
 static gboolean gsb_etats_config_recupere_info_to_etat ( gint report_number );
 static void gsb_etats_config_recupere_info_onglet_comptes ( gint report_number );
+static void gsb_etats_config_recupere_info_onglet_data_grouping ( gint report_number );
+static void gsb_etats_config_recupere_info_onglet_divers ( gint report_number );
 static void gsb_etats_config_recupere_info_onglet_mode_paiement ( gint report_number );
 static void gsb_etats_config_recupere_info_onglet_periode ( gint report_number );
 static void gsb_etats_config_recupere_info_onglet_tiers ( gint report_number );
@@ -292,6 +298,13 @@ gboolean gsb_etats_config_initialise_dialog_from_etat ( gint report_number )
     /* onglet modes de paiement */
     gsb_etats_config_initialise_onglet_mode_paiement ( report_number );
 
+    /* onglet divers */
+    gsb_etats_config_initialise_onglet_divers ( report_number );
+
+    /* onglet data grouping */
+    gsb_etats_config_initialise_onglet_data_grouping ( report_number );
+
+
     /* return */
     return TRUE;
 }
@@ -327,6 +340,12 @@ gboolean gsb_etats_config_recupere_info_to_etat ( gint report_number )
     /* onglet mode de paiement */
     gsb_etats_config_recupere_info_onglet_mode_paiement ( report_number );
 
+    /* onglet modes divers */
+    gsb_etats_config_recupere_info_onglet_divers ( report_number );
+
+    /* onglet modes data grouping */
+    gsb_etats_config_recupere_info_onglet_data_grouping ( report_number );
+
 
 
 
@@ -1706,6 +1725,322 @@ GtkTreeModel *gsb_etats_config_onglet_mode_paiement_get_model ( void )
 }
 
 
+/*ONGLET_DIVERS*/
+/**
+ * Initialise les informations de l'onglet divers
+ *
+ * \param report_number
+ *
+ * \return
+ */
+void gsb_etats_config_initialise_onglet_divers ( gint report_number )
+{
+    gint index;
+
+    index = gsb_data_report_get_show_m ( report_number );
+    etats_config_ui_buttons_radio_set_active_index ( "radiobutton_marked_all", index );
+
+    etats_config_ui_widget_set_actif ( "checkbutton_marked_P",
+                        gsb_data_report_get_show_p ( report_number ) );
+    etats_config_ui_widget_set_actif ( "checkbutton_marked_R",
+                        gsb_data_report_get_show_r ( report_number ) );
+    etats_config_ui_widget_set_actif ( "checkbutton_marked_T",
+                        gsb_data_report_get_show_t ( report_number ) );
+
+    etats_config_ui_widget_set_actif ( "bouton_pas_detailler_ventilation",
+                        gsb_data_report_get_not_detail_split ( report_number ) );
+}
+
+
+/**
+ * Récupère les informations de l'onglet divers
+ *
+ * \param numéro d'état à mettre à jour
+ *
+ * \return
+ */
+void gsb_etats_config_recupere_info_onglet_divers ( gint report_number )
+{
+    gint index;
+
+    index = etats_config_ui_buttons_radio_get_active_index ( "radiobutton_marked_all" );
+    gsb_data_report_set_show_m ( report_number, index );
+
+    gsb_data_report_set_show_p ( report_number,
+                        etats_config_ui_widget_get_actif ( "checkbutton_marked_P" ) );
+    gsb_data_report_set_show_r ( report_number,
+                        etats_config_ui_widget_get_actif ( "checkbutton_marked_R" ) );
+    gsb_data_report_set_show_t ( report_number,
+                        etats_config_ui_widget_get_actif ( "checkbutton_marked_T" ) );
+
+    gsb_data_report_set_not_detail_split ( report_number,
+                        etats_config_ui_widget_get_actif ( "bouton_pas_detailler_ventilation" ) );
+}
+
+
+/*ONGLET_DATA_GROUPING*/
+/**
+ * Initialise les informations de l'onglet groupement des données
+ *
+ * \param report_number
+ *
+ * \return
+ */
+void gsb_etats_config_initialise_onglet_data_grouping ( gint report_number )
+{
+    etats_config_ui_widget_set_actif ( "bouton_regroupe_ope_compte_etat",
+                        gsb_data_report_get_account_group_reports ( report_number ) );
+    etats_config_ui_widget_set_actif ( "bouton_utilise_tiers_etat",
+                        gsb_data_report_get_payee_used ( report_number ) );
+    etats_config_ui_widget_set_actif ( "bouton_group_by_categ",
+                        gsb_data_report_get_category_used ( report_number ) );
+    etats_config_ui_widget_set_actif ( "bouton_utilise_ib_etat",
+                        gsb_data_report_get_budget_used ( report_number ) );
+
+    gsb_etats_config_onglet_data_grouping_update_model ( report_number );
+}
+
+
+/**
+ * Récupère les informations de l'onglet groupement des données
+ *
+ * \param numéro d'état à mettre à jour
+ *
+ * \return
+ */
+void gsb_etats_config_recupere_info_onglet_data_grouping ( gint report_number )
+{
+    gsb_data_report_set_account_group_reports ( report_number,
+                        etats_config_ui_widget_get_actif ( "bouton_regroupe_ope_compte_etat" ) );
+    gsb_data_report_set_payee_used ( report_number,
+                        etats_config_ui_widget_get_actif ( "bouton_utilise_tiers_etat" ) );
+    gsb_data_report_set_category_used ( report_number,
+                        etats_config_ui_widget_get_actif ( "bouton_group_by_categ" ) );
+    gsb_data_report_set_budget_used ( report_number,
+                        etats_config_ui_widget_get_actif ( "bouton_utilise_ib_etat" ) );
+
+    /* on récupère les données servant au tri des données pour l'affichage */
+    gsb_data_report_free_sorting_type_list ( report_number );
+    gsb_data_report_set_sorting_type_list ( report_number,
+                        gsb_etats_config_onglet_data_grouping_get_list ( report_number ) );
+}
+
+
+/**
+ * Update le modèle avec les données sauvegardées
+ *
+ * \param report_number
+ *
+ * \return TRUE
+ */
+gboolean gsb_etats_config_onglet_data_grouping_update_model ( gint report_number )
+{
+    GtkWidget *tree_view;
+    GtkTreeModel *model;
+    GSList *tmp_list;
+    gint i = 0;
+
+    tree_view = etats_config_ui_widget_get_widget_by_name ( "treeview_data_grouping", NULL );
+    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+    /* on reset le model */
+    gtk_list_store_clear ( GTK_LIST_STORE ( model ) );
+
+    /* on remplit la liste des données */
+    tmp_list = gsb_data_report_get_sorting_type_list ( report_number );
+
+    while ( tmp_list )
+    {
+        GtkTreeIter iter;
+        gchar *string = NULL;
+        gint type_data;
+
+        type_data = GPOINTER_TO_INT ( tmp_list->data );
+
+        string = gsb_etats_config_onglet_data_grouping_get_string ( type_data, i );
+        if ( !string )
+        {
+            tmp_list = tmp_list->next;
+            continue;
+        }
+
+        gtk_list_store_append ( GTK_LIST_STORE ( model ), &iter );
+        gtk_list_store_set ( GTK_LIST_STORE ( model ), &iter, 0, string, 1, i, 2, type_data, -1 );
+
+        g_free ( string );
+
+        i++;
+        tmp_list = tmp_list->next;
+    }
+
+    /* return */
+    return TRUE;
+}
+
+/**
+ * retourne une chaine de caractère formatée en fonction du type de donnée
+ * et de la position dans la liste
+ *
+ * \param type_data     type de donnée : 1 Categ, 3 IB, 5 Account, 6 Payee.
+ * \param pos           numéro de ligne dans le modèle
+ *
+ * \return NULL or a formatted string
+ */
+gchar *gsb_etats_config_onglet_data_grouping_get_string ( gint type_data,
+                        gint pos )
+{
+    gchar *string = NULL;
+    gchar *text = NULL;
+
+    switch ( type_data )
+    {
+        case 1:
+        text = g_strdup ( _("Category") );
+        break;
+
+        case 3:
+        text = g_strdup ( _("Budgetary line") );
+        break;
+
+        case 5:
+        text = g_strdup ( _("Account") );
+        break;
+
+        case 6:
+        text = g_strdup ( _("Payee") );
+        break;
+    }
+
+    if ( !text )
+        return NULL;
+
+    if ( pos <= 0 )
+        string = text;
+    else if ( pos == 1 )
+    {
+        string = g_strconcat ( "\t", text, NULL );
+        g_free ( text );
+    }
+    else if ( pos == 2 )
+    {
+        string = g_strconcat ( "\t\t", text, NULL );
+        g_free ( text );
+    }
+    else if ( pos == 3 )
+    {
+        string = g_strconcat ( "\t\t\t", text, NULL );
+        g_free ( text );
+    }
+
+    return string;
+}
+
+/**
+ * return la liste des données par ordre de tri
+ *
+ * \param report_number
+ *
+ * \return a GSList
+ * */
+GSList *gsb_etats_config_onglet_data_grouping_get_list ( gint report_number )
+{
+    GtkWidget *tree_view;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GSList *tmp_list = NULL;
+
+    tree_view = etats_config_ui_widget_get_widget_by_name ( "treeview_data_grouping", NULL );
+    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+    if ( gtk_tree_model_get_iter_first ( model, &iter ) )
+    {
+        do
+        {
+            gint type_data;
+
+            gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, 2, &type_data, -1 );
+            tmp_list = g_slist_append ( tmp_list, GINT_TO_POINTER ( type_data ) );
+
+            /* on ajoute les sous catégories ici */
+            if ( type_data == 1 )
+            {
+                tmp_list = g_slist_append ( tmp_list, GINT_TO_POINTER ( 2 ) );
+            }
+            /* et les sous imputations ici */
+            else if ( type_data == 3 )
+            {
+                tmp_list = g_slist_append ( tmp_list, GINT_TO_POINTER ( 4 ) );
+            }
+        }
+        while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter ) );
+
+        return tmp_list;
+    }
+
+    /* return */
+    return NULL;
+}
+
+/**
+ * déplace un item suite à un drag and drop dans le tree_view
+ *
+ * \param src_pos           position avant
+ * \param src_type_data     type de donnée
+ * \param dst_pos           position après drag and drop
+ *
+ * \return
+ * */
+void gsb_etats_config_onglet_data_grouping_move_in_list ( gint src_pos,
+                        gint src_type_data,
+                        gint dst_pos )
+{
+    GtkWidget *tree_view;
+    GtkTreeModel *model;
+    GSList *tmp_list;
+    gint report_number;
+    gint i = 0;
+
+    report_number = gsb_gui_navigation_get_current_report ( );
+    tmp_list = g_slist_copy ( gsb_data_report_get_sorting_type_list ( report_number ) );
+
+    /* on supprime les sous categ et les sous IB */
+    tmp_list = g_slist_remove ( tmp_list, GINT_TO_POINTER ( 4 ) );
+    tmp_list = g_slist_remove ( tmp_list, GINT_TO_POINTER ( 2 ) );
+
+    /* on supprime la donnée à la position initiale */
+    tmp_list = g_slist_remove ( tmp_list, GINT_TO_POINTER ( src_type_data ) );
+
+    /* on insère la donnée à la position finale */
+    tmp_list = g_slist_insert ( tmp_list, GINT_TO_POINTER ( src_type_data ), dst_pos );
+
+    tree_view = etats_config_ui_widget_get_widget_by_name ( "treeview_data_grouping", NULL );
+    model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+    /* on reset le model */
+    gtk_list_store_clear ( GTK_LIST_STORE ( model ) );
+
+    while ( tmp_list )
+    {
+        GtkTreeIter iter;
+        gchar *string = NULL;
+        gint type_data;
+        gpointer ptr;
+
+        ptr = tmp_list->data;
+        type_data = GPOINTER_TO_INT ( ptr );
+
+        string = gsb_etats_config_onglet_data_grouping_get_string ( type_data, i );
+
+        gtk_list_store_append ( GTK_LIST_STORE ( model ), &iter );
+        gtk_list_store_set ( GTK_LIST_STORE ( model ), &iter, 0, string, 1, i, 2, type_data, -1 );
+
+        g_free ( string );
+
+        i++;
+        tmp_list = tmp_list->next;
+    }
+}
+
 
 /*OLD_FUNCTIONS*/
 
@@ -2039,77 +2374,6 @@ GtkWidget *gsb_etats_config_onglet_etat_montant ( void )
  *
  *
  */
-GtkWidget *gsb_etats_config_onglet_etat_divers ( void )
-{
-    GtkWidget *vbox_onglet;
-    GtkWidget *vbox;
-    GtkWidget *paddingbox;
-    GtkWidget *button;
-
-    devel_debug (NULL);
-
-    vbox_onglet =  GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_divers" ) );
-
-    vbox = new_vbox_with_title_and_icon ( _("Miscellaneous"), "generalities.png" );
-
-    gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
-    gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
-
-    /* on peut sélectionner les opérations marquées */
-    paddingbox = new_paddingbox_with_title ( vbox_onglet, FALSE, _("Selecting Transactions") );
-
-    vbox = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "vbox_select_transactions_buttons", NULL );
-    gtk_box_pack_start ( GTK_BOX ( paddingbox ), vbox, TRUE, TRUE, 5 );
-
-    button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "radiobutton_marked", NULL );
-
-    /* on met la connection pour rendre sensitif la vbox_detaille_categ_etat */
-    g_signal_connect ( G_OBJECT ( button ),
-                        "toggled",
-                        G_CALLBACK ( sens_desensitive_pointeur ),
-                        utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "vbox_marked_buttons", NULL ) );
-
-    paddingbox = new_paddingbox_with_title ( vbox_onglet, FALSE, _("Split of transactions detail") );
-
-    button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "bouton_pas_detailler_ventilation", NULL );
-/*    g_signal_connect_swapped ( G_OBJECT ( button ),
-                        "toggled",
-                        G_CALLBACK ( report_tree_update_style ),
-                        GINT_TO_POINTER ( 9 ) );
-*/
-    gtk_box_pack_start ( GTK_BOX ( paddingbox ), button, TRUE, TRUE, 5 );
-    gtk_widget_show_all ( vbox_onglet );
-
-    return vbox_onglet;
-}
-
-
-/**
- *
- *
- *
- */
-GtkWidget *gsb_etats_config_page_data_grouping ( void )
-{
-    GtkWidget *vbox_onglet;
-    GtkWidget *vbox;
-
-    vbox_onglet =  GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "page_data_grouping" ) );
-
-    vbox = new_vbox_with_title_and_icon ( _("Data grouping"), "organization.png" );
-
-    gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
-    gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
-
-    return vbox_onglet;
-}
-
-
-/**
- *
- *
- *
- */
 GtkWidget *gsb_etats_config_page_data_separation ( void )
 {
     GtkWidget *vbox_onglet;
diff --git a/src/gsb_etats_config.h b/src/gsb_etats_config.h
index d659804..0067fcb 100644
--- a/src/gsb_etats_config.h
+++ b/src/gsb_etats_config.h
@@ -16,6 +16,11 @@ gboolean gsb_etats_config_onglet_categ_budget_toggled ( GtkCellRendererToggle *r
                         GtkTreeStore *store );
 void gsb_etats_config_onglet_categ_budget_tree_model_check_uncheck_all ( GtkTreeModel *model,
                         gboolean toggle_value );
+gchar *gsb_etats_config_onglet_data_grouping_get_string ( gint type_data,
+                        gint pos );
+void gsb_etats_config_onglet_data_grouping_move_in_list ( gint src_pos,
+                        gint src_type_data,
+                        gint dst_pos );;
 
 GtkTreeModel *gsb_etats_config_onglet_get_liste_comptes ( void );
 GtkTreeModel *gsb_etats_config_onglet_get_liste_exercices ( void );
@@ -23,9 +28,6 @@ GtkTreeModel *gsb_etats_config_onglet_get_liste_tiers ( void );
 GtkTreeModel *gsb_etats_config_onglet_mode_paiement_get_model ( void );
 void gsb_etats_config_onglet_select_partie_liste_comptes ( GtkWidget *tree_view,
                         gint type_compte );
-
-
-
 /* END_DECLARATION */
 
 
diff --git a/src/gsb_form.h b/src/gsb_form.h
index f4d3bab..6ab8986 100644
--- a/src/gsb_form.h
+++ b/src/gsb_form.h
@@ -6,13 +6,6 @@
 /* START_INCLUDE_H */
 /* END_INCLUDE_H */
 
-enum direction_move {
-    GSB_LEFT = 0,
-    GSB_RIGHT,
-    GSB_UP,
-    GSB_DOWN
-};
-
 /** returned values want ask for the origin
  * must be < 0 because 0 and more are reserved for account numbers */
 enum origin_values {
diff --git a/src/structures.h b/src/structures.h
index 26d8ee9..3caec00 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -282,6 +282,13 @@ enum bet_type_maj
     BET_MAJ_ALL,
 };
 
+/* définition du type de mouvement */
+enum direction_move {
+    GSB_LEFT = 0,
+    GSB_RIGHT,
+    GSB_UP,
+    GSB_DOWN
+};
 
 
 #endif
diff --git a/src/ui/etats_config.ui b/src/ui/etats_config.ui
index 1131af4..95f0a2f 100644
--- a/src/ui/etats_config.ui
+++ b/src/ui/etats_config.ui
@@ -58,18 +58,44 @@
       <placeholder/>
     </child>
   </object>
-  <object class="GtkArrow" id="arrow_up">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="arrow_type">up</property>
-  </object>
   <object class="GtkCheckButton" id="bouton_pas_detailler_ventilation">
     <property name="label" translatable="yes">Do not detail split of transactions</property>
     <property name="visible">True</property>
     <property name="can_focus">True</property>
     <property name="receives_default">False</property>
     <property name="use_action_appearance">False</property>
-    <property name="active">True</property>
+    <property name="draw_indicator">True</property>
+  </object>
+  <object class="GtkCheckButton" id="bouton_regroupe_ope_compte_etat">
+    <property name="label" translatable="yes">Group transactions by account</property>
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="receives_default">False</property>
+    <property name="use_action_appearance">False</property>
+    <property name="draw_indicator">True</property>
+  </object>
+  <object class="GtkCheckButton" id="bouton_utilise_ib_etat">
+    <property name="label" translatable="yes">Group transactions by budgetary line</property>
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="receives_default">False</property>
+    <property name="use_action_appearance">False</property>
+    <property name="draw_indicator">True</property>
+  </object>
+  <object class="GtkCheckButton" id="bouton_utilise_tiers_etat">
+    <property name="label" translatable="yes">Group transactions by payee</property>
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="receives_default">False</property>
+    <property name="use_action_appearance">False</property>
+    <property name="draw_indicator">True</property>
+  </object>
+  <object class="GtkCheckButton" id="bouton_group_by_categ">
+    <property name="label" translatable="yes">Group transactions by category</property>
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="receives_default">False</property>
+    <property name="use_action_appearance">False</property>
     <property name="draw_indicator">True</property>
   </object>
   <object class="GtkDialog" id="config_etats_dialog">
@@ -196,25 +222,83 @@
       <action-widget response="-5">button_OK</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkImage" id="image_tiers_dernier">
+  <object class="GtkHBox" id="hbox_data_grouping">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="stock">gtk-goto-last</property>
-  </object>
-  <object class="GtkImage" id="image_tiers_precedent">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-go-back</property>
-  </object>
-  <object class="GtkImage" id="image_tiers_premier">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-goto-first</property>
-  </object>
-  <object class="GtkImage" id="image_tiers_suivant">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="stock">gtk-go-forward</property>
+    <child>
+      <object class="GtkScrolledWindow" id="sw_data_grouping">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="hscrollbar_policy">automatic</property>
+        <property name="vscrollbar_policy">automatic</property>
+        <property name="shadow_type">in</property>
+        <child>
+          <object class="GtkTreeView" id="treeview_data_grouping">
+            <property name="height_request">150</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="headers_visible">False</property>
+            <property name="headers_clickable">False</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="padding">5</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="vbox15">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="homogeneous">True</property>
+        <child>
+          <object class="GtkButton" id="button_data_grouping_up">
+            <property name="label">gtk-go-up</property>
+            <property name="width_request">100</property>
+            <property name="visible">True</property>
+            <property name="sensitive">False</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="use_action_appearance">False</property>
+            <property name="relief">none</property>
+            <property name="use_stock">True</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="button_data_grouping_down">
+            <property name="label">gtk-go-down</property>
+            <property name="width_request">100</property>
+            <property name="visible">True</property>
+            <property name="sensitive">False</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="use_action_appearance">False</property>
+            <property name="relief">none</property>
+            <property name="use_stock">True</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
   </object>
   <object class="GtkVBox" id="liste_montant_etat">
     <property name="visible">True</property>
@@ -1041,7 +1125,7 @@
                     <property name="receives_default">True</property>
                     <property name="use_action_appearance">False</property>
                     <property name="relief">none</property>
-                    <property name="xalign">0.05000000074505806</property>
+                    <property name="xalign">0</property>
                     <property name="draw_indicator">True</property>
                   </object>
                   <packing>
@@ -1689,13 +1773,18 @@
                             <property name="receives_default">True</property>
                             <property name="tooltip_text" translatable="yes">First item</property>
                             <property name="use_action_appearance">False</property>
-                            <property name="image">image_tiers_premier</property>
                             <property name="relief">none</property>
+                            <child>
+                              <object class="GtkImage" id="image_tiers_premier">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="stock">gtk-goto-top</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="padding">10</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
@@ -1706,8 +1795,14 @@
                             <property name="receives_default">True</property>
                             <property name="tooltip_text" translatable="yes">Prévious</property>
                             <property name="use_action_appearance">False</property>
-                            <property name="image">image_tiers_precedent</property>
                             <property name="relief">none</property>
+                            <child>
+                              <object class="GtkImage" id="image_tiers_precedent">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="stock">gtk-go-up</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -1723,9 +1818,15 @@
                             <property name="receives_default">True</property>
                             <property name="tooltip_text" translatable="yes">Following</property>
                             <property name="use_action_appearance">False</property>
-                            <property name="image">image_tiers_suivant</property>
                             <property name="relief">none</property>
                             <property name="image_position">right</property>
+                            <child>
+                              <object class="GtkImage" id="image_tiers_suivant">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="stock">gtk-go-down</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -1741,8 +1842,14 @@
                             <property name="receives_default">True</property>
                             <property name="tooltip_text" translatable="yes">Last item</property>
                             <property name="use_action_appearance">False</property>
-                            <property name="image">image_tiers_dernier</property>
                             <property name="relief">none</property>
+                            <child>
+                              <object class="GtkImage" id="image_tiers_dernier">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="stock">gtk-goto-bottom</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -2101,16 +2208,6 @@ to add at the selection</property>
       <placeholder/>
     </child>
   </object>
-  <object class="GtkToggleButton" id="togglebutton_select_all_">
-    <property name="label" translatable="yes">Select all</property>
-    <property name="visible">True</property>
-    <property name="can_focus">True</property>
-    <property name="receives_default">True</property>
-    <property name="use_action_appearance">False</property>
-    <property name="relief">none</property>
-    <property name="xalign">0</property>
-    <property name="draw_indicator">True</property>
-  </object>
   <object class="GtkVBox" id="vbox_select_transactions_buttons">
     <property name="visible">True</property>
     <property name="can_focus">False</property>


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list