[grisbi-cvs] [SCM] grisbi branch, pbiava_new_etats, updated. upstream_version_0_9_4-166-g0df5684
Pierre Biava
nobody at users.sourceforge.net
Thu Oct 20 23:12:06 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, pbiava_new_etats has been updated
via 0df56846e73207cba0e30db565f517feaa7d0570 (commit)
via 743ca9df05f28093270018c3e3ad269ed54d7dba (commit)
via c5dc96a3a4531b6a8a19d06f222954c8442f7255 (commit)
via cc23d351ae8b4b5bccc5aff2b8ca7868e6cbcd0a (commit)
via d7b9efd34698dbf2f15e1bf9a7ab902da2a8f970 (commit)
via d154f704db60c8c04a4c5da6bbc745a423435fd3 (commit)
via 60347e3b8c4453ceeb5c38e1927b24bf6632df42 (commit)
via 9a16f1390ca2211f1dbfd822fe07c6a7b2d295d7 (commit)
from 2ae1d3f7c4e2879b19efb96f82dab4399da6a1b8 (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 0df56846e73207cba0e30db565f517feaa7d0570
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Oct 20 23:11:24 2011 +0200
code cleanup
commit 743ca9df05f28093270018c3e3ad269ed54d7dba
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Oct 20 21:03:01 2011 +0200
Add message for accounts tab
commit c5dc96a3a4531b6a8a19d06f222954c8442f7255
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Oct 20 20:45:36 2011 +0200
Add method_of_payment tab and minor changes
commit cc23d351ae8b4b5bccc5aff2b8ca7868e6cbcd0a
Author: pbiava <pierre.biava at nerim.net>
Date: Tue Oct 18 21:14:21 2011 +0200
etats_config.ui: minor change
commit d7b9efd34698dbf2f15e1bf9a7ab902da2a8f970
Author: pbiava <pierre.biava at nerim.net>
Date: Mon Oct 17 22:06:41 2011 +0200
etats_config: Changing the configuration of payees for states
commit d154f704db60c8c04a4c5da6bbc745a423435fd3
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Oct 15 17:30:25 2011 +0200
etats_config: minor changes
commit 60347e3b8c4453ceeb5c38e1927b24bf6632df42
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Oct 15 16:52:30 2011 +0200
etats_config : Add categories tab and budgetary lines tab
commit 9a16f1390ca2211f1dbfd822fe07c6a7b2d295d7
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Oct 15 08:20:53 2011 +0200
export.c:153: back the code for gtk2.18
-----------------------------------------------------------------------
Changes:
diff --git a/src/etats_config_ui.c b/src/etats_config_ui.c
index 5a2c6d3..9c3b5ec 100644
--- a/src/etats_config_ui.c
+++ b/src/etats_config_ui.c
@@ -55,7 +55,7 @@
/*START_STATIC*/
-static GtkWidget *etats_config_ui_button_init_button_select_unselect_all ( gchar *name,
+static void etats_config_ui_toggle_button_init_button_expand ( gchar *name,
GtkWidget *tree_view );
static void etats_config_ui_left_panel_add_line ( GtkTreeStore *tree_model,
@@ -77,14 +77,48 @@ static gboolean etats_config_ui_left_panel_tree_view_selection_changed ( GtkTree
static gboolean etats_config_ui_left_panel_tree_view_update_style ( GtkWidget *button,
gint *page_number );
-static GtkWidget *etats_config_ui_onglet_comptes_create_page ( void );
-static void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( void );
+static GtkWidget *etats_config_ui_onglet_budgets_create_page ( gint page );
+static void etats_config_ui_onglet_categ_budget_init_buttons_select_unselect ( gchar *name,
+ GtkWidget *tree_view,
+ gboolean is_categ );
+static GtkWidget *etats_config_ui_onglet_categ_budget_tree_view_create ( gboolean is_categ );
+static GtkWidget *etats_config_ui_onglet_categories_create_page ( gint page );
+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 GtkWidget *etats_config_ui_onglet_mode_paiement_create_page ( gint page );
static GtkWidget *etats_config_ui_onglet_periode_create_page ( void );
static GtkTreeModel *etats_config_ui_onglet_periode_get_liste_dates ( void );
-static GtkWidget *etats_config_ui_onglet_tiers_create_page ( void );
-static GtkWidget *etats_config_ui_onglet_virements_create_page ( void );
+static gboolean etats_config_ui_onglet_periode_selection_dates_changed ( GtkTreeSelection *selection,
+ GtkWidget *widget );
+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,
+ gint end_pos,
+ GtkWidget *tree_view );
+static void etats_config_ui_onglet_tiers_search_iter_from_entry ( const gchar *text,
+ GtkTreeView *tree_view,
+ gint sens );
+static void etats_config_ui_onglet_tiers_entry_insert_text ( GtkEditable *editable,
+ gchar *new_text,
+ gint new_text_length,
+ gpointer position,
+ GtkWidget *tree_view );
+static gboolean etats_config_ui_onglet_tiers_select_first_last_item ( GtkWidget *button,
+ GdkEventButton *event,
+ gpointer ptr_sens );
+static gboolean etats_config_ui_onglet_tiers_select_prev_next_item ( GtkWidget *button,
+ GdkEventButton *event,
+ gpointer ptr_sens );
+static void etats_config_ui_onglet_tiers_selection_changed ( GtkTreeSelection *selection,
+ gpointer user_data );
+static gboolean etats_config_ui_onglet_tiers_show_first_row_selected ( GtkWidget *tree_view,
+ GdkEventVisibility *event,
+ gpointer user_data);
+static void etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( gint show_left,
+ gint show_right );
+static GtkWidget *etats_config_ui_onglet_virements_create_page ( gint page );
static void etats_config_ui_tree_view_init ( const gchar *treeview_name,
GtkTreeModel *(*function) ( void ),
@@ -92,8 +126,7 @@ static void etats_config_ui_tree_view_init ( const gchar *treeview_name,
GCallback selection_callback );
static GtkWidget *etats_config_ui_tree_view_new_with_model ( const gchar *treeview_name,
GtkTreeModel *model );
-static gboolean etats_config_ui_onglet_periode_selection_dates_changed ( GtkTreeSelection *selection,
- GtkWidget *widget );
+
/*END_STATIC*/
@@ -138,10 +171,13 @@ static GtkBuilder *etat_config_builder = NULL;
/* mémorisation du togglebutton utilisé servira à remplacer son label */
GtkToggleButton *prev_togglebutton = NULL;
+/* variables utilisées pour la gestion des tiers*/
+GtkTreePath *tiers_selected = NULL;
+
/*END_GLOBAL_VARIABLES*/
-/*START_PUBLIC_FUNCTIONS*/
+/*GENERAL*/
/**
* Création de la fenêtre de dialog
*
@@ -184,16 +220,11 @@ GtkWidget *etats_config_ui_create_dialog ( void )
*
*
* */
-void etats_config_ui_free_builder ( void )
+void etats_config_ui_free_all_var ( void )
{
g_object_unref ( G_OBJECT ( etat_config_builder ) );
}
-
-/*END_PUBLIC_FUNCTIONS*/
-
-
-/*START_PRIVATE_FUNCTIONS*/
/*LEFT_PANEL*/
/**
* création du tree_view qui liste les onglets de la fenêtre de dialogue
@@ -295,52 +326,49 @@ void etats_config_ui_left_panel_populate_tree_model ( GtkTreeStore *tree_model,
page++;
/* append page Transferts */
- widget = etats_config_ui_onglet_virements_create_page ( );
+ widget = etats_config_ui_onglet_virements_create_page ( page );
etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Transfers"), page );
page++;
/* append page Accounts */
- widget = etats_config_ui_onglet_comptes_create_page ( );
+ widget = etats_config_ui_onglet_comptes_create_page ( page );
etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Accounts"), page );
page++;
/* append page Payee */
- widget = etats_config_ui_onglet_tiers_create_page ( );
+ widget = etats_config_ui_onglet_tiers_create_page ( page );
etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Payee"), page );
page++;
/* append page Categories */
-/* widget = gsb_etats_config_onglet_etat_categories ( );
- * etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Categories"), page );
- * page++;
- */
+ widget = etats_config_ui_onglet_categories_create_page ( page );
+ etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Categories"), page );
+ page++;
/* append page Budgetary lines */
-/* widget = gsb_etats_config_onglet_etat_ib ( );
- * etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Budgetary lines"), page );
- * page++;
- */
+ widget = etats_config_ui_onglet_budgets_create_page ( page );
+ etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Budgetary lines"), page );
+ page++;
/* append page Texts */
-/* widget = gsb_etats_config_onglet_etat_texte ( );
+/* widget = gsb_etats_config_onglet_etat_texte ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Texts"), page );
* page++;
*/
/* append page Amounts */
-/* widget = gsb_etats_config_onglet_etat_montant ( );
+/* widget = gsb_etats_config_onglet_etat_montant ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Amounts"), page );
* page++;
*/
/* append page Payment methods */
-/* widget = gsb_etats_config_onglet_etat_mode_paiement ( );
- * etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Payment methods"), page );
- * page++;
- */
+ widget = etats_config_ui_onglet_mode_paiement_create_page ( page );
+ etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Payment methods"), page );
+ page++;
/* append page Misc. */
-/* widget = gsb_etats_config_onglet_etat_divers ( );
+/* widget = gsb_etats_config_onglet_etat_divers ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Miscellaneous"), page );
* page++;
*/
@@ -349,13 +377,13 @@ 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 organization"), -1 );
/* Data grouping */
-/* widget = gsb_etats_config_page_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++;
*/
/* Data separation */
-/* widget = gsb_etats_config_page_data_separation ( );
+/* widget = gsb_etats_config_page_data_separation ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Data separation"), page );
* page++;
*/
@@ -364,25 +392,25 @@ 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 display"), -1 );
/* append page Generalities */
-/* widget = gsb_etats_config_affichage_etat_generalites ( );
+/* widget = gsb_etats_config_affichage_etat_generalites ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Generalities"), page );
* page++;
*/
/* append page Titles */
-/* widget = gsb_etats_config_affichage_etat_titres ( );
+/* widget = gsb_etats_config_affichage_etat_titres ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Titles"), page );
* page++;
*/
/* append page Transactions */
-/* widget = gsb_etats_config_affichage_etat_operations ( );
+/* widget = gsb_etats_config_affichage_etat_operations ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Transactions"), page );
* page++;
*/
/* append page Currencies */
-/* widget = gsb_etats_config_affichage_etat_devises ( );
+/* widget = gsb_etats_config_affichage_etat_devises ( page );
* etats_config_ui_left_panel_add_line ( tree_model, &iter, notebook, widget, _("Currencies"), page );
*/
@@ -707,7 +735,7 @@ void etats_config_ui_onglet_periode_date_interval_sensitive ( gboolean show )
*
* \return
*/
-GtkWidget *etats_config_ui_onglet_virements_create_page ( void )
+GtkWidget *etats_config_ui_onglet_virements_create_page ( gint page )
{
GtkWidget *vbox_onglet;
GtkWidget *vbox;
@@ -734,7 +762,7 @@ GtkWidget *etats_config_ui_onglet_virements_create_page ( void )
tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_virements" ) );
/* on initialise les boutons pour sensibiliser bouton_exclure_non_virements_etat et la liste des comptes */
- etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( );
+ etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( page );
/* on initialise les boutons pour sélectionner tout ou partie des comptes */
etats_config_ui_onglet_comptes_init_buttons_selection ( "virements", tree_view );
@@ -754,7 +782,7 @@ GtkWidget *etats_config_ui_onglet_virements_create_page ( void )
*
* \return
*/
-void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( void )
+void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( gint page )
{
GtkWidget *button;
@@ -764,7 +792,7 @@ void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( v
g_signal_connect ( G_OBJECT ( button ),
"toggled",
G_CALLBACK ( etats_config_ui_left_panel_tree_view_update_style ),
- GINT_TO_POINTER ( 1 ) );
+ GINT_TO_POINTER ( page ) );
/* on connecte le signal pour gérer la sensibilité du bouton bouton_bouton_inclusion_virements_actifs_etat */
g_signal_connect ( G_OBJECT ( button ),
"toggled",
@@ -777,7 +805,7 @@ void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( v
g_signal_connect ( G_OBJECT ( button ),
"toggled",
G_CALLBACK ( etats_config_ui_left_panel_tree_view_update_style ),
- GINT_TO_POINTER ( 1 ) );
+ GINT_TO_POINTER ( page ) );
/* on connecte le signal pour gérer la sensibilité du bouton_inclusion_virements_hors_etat */
g_signal_connect ( G_OBJECT ( button ),
"toggled",
@@ -790,7 +818,7 @@ void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( v
g_signal_connect ( G_OBJECT ( button ),
"toggled",
G_CALLBACK ( etats_config_ui_left_panel_tree_view_update_style ),
- GINT_TO_POINTER ( 1 ) );
+ GINT_TO_POINTER ( page ) );
/* on connecte le signal pour gérer la sensibilité du bouton_inclusion_virements_perso */
g_signal_connect ( G_OBJECT ( button ),
"toggled",
@@ -814,7 +842,7 @@ void etats_config_ui_onglet_comptes_init_buttons_choix_utilisation_virements ( v
*
* \return
*/
-GtkWidget *etats_config_ui_onglet_comptes_create_page ( void )
+GtkWidget *etats_config_ui_onglet_comptes_create_page ( gint page )
{
GtkWidget *vbox_onglet;
GtkWidget *vbox;
@@ -842,11 +870,12 @@ GtkWidget *etats_config_ui_onglet_comptes_create_page ( void )
tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_comptes" ) );
button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_detaille_comptes_etat" ) );
+
/* 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_left_panel_tree_view_update_style ),
- GINT_TO_POINTER ( 2 ) );
+ GINT_TO_POINTER ( page ) );
/* on met la connection pour rendre sensitif la vbox_generale_comptes_etat */
g_signal_connect ( G_OBJECT ( button ),
@@ -974,14 +1003,7 @@ void etats_config_ui_onglet_comptes_select_unselect ( GtkToggleButton *togglebut
{
case -9:
{
- GtkTreeModel *model;
-
- model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
-
- if ( GTK_IS_TREE_STORE ( model ) )
- gsb_etats_config_tree_model_check_uncheck_all ( model, toggle );
- else
- utils_togglebutton_select_unselect_all_rows ( togglebutton, tree_view );
+ utils_togglebutton_select_unselect_all_rows ( togglebutton, tree_view );
break;
}
default:
@@ -1003,7 +1025,7 @@ void etats_config_ui_onglet_comptes_select_unselect ( GtkToggleButton *togglebut
*
* \return
*/
-GtkWidget *etats_config_ui_onglet_tiers_create_page ( void )
+GtkWidget *etats_config_ui_onglet_tiers_create_page ( gint page )
{
GtkWidget *vbox_onglet;
GtkWidget *vbox;
@@ -1029,21 +1051,55 @@ GtkWidget *etats_config_ui_onglet_tiers_create_page ( void )
GTK_SELECTION_MULTIPLE,
NULL );
+ /* on ajoute un callback pour aller au premier item sélectionné */
tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_tiers" ) );
+ g_signal_connect ( G_OBJECT ( tree_view ),
+ "visibility-notify-event",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_show_first_row_selected ),
+ NULL );
+ /* on supprime la recherche intégrée */
+ gtk_tree_view_set_enable_search ( GTK_TREE_VIEW ( tree_view ), FALSE );
+
+ /* on rend les boutons premier, précédent, suivant et dernier actifs */
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "button_tiers_premier" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "button-press-event",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_select_first_last_item ),
+ GINT_TO_POINTER ( GDK_LEFTBUTTON ) );
+
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "button_tiers_precedent" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "button-press-event",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_select_prev_next_item ),
+ GINT_TO_POINTER ( GDK_LEFTBUTTON ) );
+
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "button_tiers_suivant" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "button-press-event",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_select_prev_next_item ),
+ GINT_TO_POINTER ( GDK_RIGHTBUTTON ) );
+
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "button_tiers_dernier" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "button-press-event",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_select_first_last_item ),
+ GINT_TO_POINTER ( GDK_RIGHTBUTTON ) );
+
+ /* on rend insensible les bouton premier et précédent car on est positionné sur le 1er item sélectionné */
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( FALSE, -1 );
- button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_detaille_tiers_etat" ) );
/* 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, "bouton_detaille_tiers_etat" ) );
g_signal_connect ( G_OBJECT ( button ),
"toggled",
G_CALLBACK ( etats_config_ui_left_panel_tree_view_update_style ),
- GINT_TO_POINTER ( 3 ) );
+ GINT_TO_POINTER ( page ) );
/* on met la connection pour rendre sensitif la vbox_generale_comptes_etat */
g_signal_connect ( G_OBJECT ( button ),
"toggled",
G_CALLBACK ( sens_desensitive_pointeur ),
gtk_builder_get_object ( etat_config_builder, "vbox_detaille_tiers_etat" ) );
-
/* on met la connection pour (dé)sélectionner tous les tiers */
button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "togglebutton_select_all_tiers" ) );
g_signal_connect ( G_OBJECT ( button ),
@@ -1052,7 +1108,14 @@ GtkWidget *etats_config_ui_onglet_tiers_create_page ( void )
tree_view );
entry = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "search_entry_tiers" ) );
- gtk_tree_view_set_search_entry ( GTK_TREE_VIEW ( tree_view ), GTK_ENTRY ( entry ) );
+ g_signal_connect ( G_OBJECT ( entry ),
+ "insert-text",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_entry_insert_text ),
+ tree_view );
+ g_signal_connect ( G_OBJECT ( entry ),
+ "delete-text",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_entry_delete_text ),
+ tree_view );
gtk_widget_show_all ( vbox_onglet );
@@ -1061,242 +1124,1129 @@ GtkWidget *etats_config_ui_onglet_tiers_create_page ( void )
}
-/*FONCTIONS UTILITAIRES COMMUNES*/
/**
- * retourne l'index du radiobutton actif.
+ * Gestion des flêches de déplacement des tiers sélextionnés
*
- * \param nom du radio_button
+ * \param button
+ * \param event
+ * \param un pointeur donnant le sens de déplacement GDK_LEFTBUTTON et GDK_RIGHTBUTTON
*
- * \return index bouton actif
+ * \return
*/
-gint etats_config_ui_buttons_radio_get_active_index ( const gchar *button_name )
+gboolean etats_config_ui_onglet_tiers_select_prev_next_item ( GtkWidget *button,
+ GdkEventButton *event,
+ gpointer ptr_sens )
{
- GtkWidget *radio_button;
- GSList *liste;
- GSList *tmp_list;
- gint index = 0;
+ GtkWidget *tree_view;
+ GtkTreeSelection *selection;
+ GtkTreePath *start_path;
+ GtkTreePath *end_path;
+ GtkTreePath *first_path;
+ GtkTreePath *last_path;
+ GtkTreePath *path = NULL;
+ GList *liste;
+ gint sens;
+ gint nbre_selections;
+ gboolean find = FALSE;
+ gboolean return_value = FALSE;
+
+ sens = GPOINTER_TO_INT ( ptr_sens );
- radio_button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_tiers" ) );
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
- liste = g_slist_copy ( gtk_radio_button_get_group ( GTK_RADIO_BUTTON ( radio_button ) ) );
- tmp_list = g_slist_reverse ( liste );
+ liste = gtk_tree_selection_get_selected_rows ( selection, NULL );
+ if ( liste == NULL )
+ {
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( FALSE, FALSE );
+ return FALSE;
+ }
+ nbre_selections = g_list_length (liste );
- while ( tmp_list )
+ first_path = g_list_nth_data ( liste, 0 );
+ last_path = g_list_nth_data ( liste, nbre_selections - 1 );
+
+ liste = g_list_find_custom ( liste, tiers_selected, ( GCompareFunc ) gtk_tree_path_compare );
+
+ if ( gtk_tree_view_get_visible_range ( GTK_TREE_VIEW ( tree_view ), &start_path, &end_path ) )
{
- GtkWidget *button;
+ while ( liste )
+ {
+ path = ( GtkTreePath * ) liste->data;
- button = tmp_list->data;
- if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button ) ) )
- break;
+ if ( gtk_tree_selection_path_is_selected ( selection, path ) )
+ {
+ if ( sens == GDK_LEFTBUTTON )
+ {
+ if ( gtk_tree_path_compare ( start_path, path ) <= 0 )
+ {
+ liste = liste->prev;
+ continue;
+ }
+ else if ( gtk_tree_path_compare ( path, tiers_selected ) != 0 )
+ {
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), path, NULL, FALSE, 0., 0. );
+ tiers_selected = path;
+ find = TRUE;
+ break;
+ }
+ }
+ else
+ {
+ if ( gtk_tree_path_compare ( path, end_path ) <= 0 )
+ {
+ liste = liste->next;
+ continue;
+ }
+ else if ( gtk_tree_path_compare ( path, tiers_selected ) != 0 )
+ {
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), path, NULL, FALSE, 0., 0. );
+ tiers_selected = path;
+ find = TRUE;
+ break;
+ }
+ }
+ }
- index++;
- tmp_list = tmp_list->next;
+ if ( sens == GDK_LEFTBUTTON )
+ liste = liste->prev;
+ else
+ liste = liste->next;
+ }
+
+ gtk_tree_path_free ( start_path );
+ gtk_tree_path_free ( end_path );
+
+ if ( find )
+ return_value = TRUE;
}
- g_slist_free ( liste );
+ if ( !find )
+ {
+ liste = gtk_tree_selection_get_selected_rows ( selection, NULL );
+ if ( liste == NULL )
+ return FALSE;
- return index;
-}
+ if ( sens == GDK_LEFTBUTTON )
+ liste = g_list_first ( liste );
+ else
+ liste = g_list_last ( liste );
-/**
- * rend actif le button qui correspond à l'index passé en paramètre.
- *
- * \param nom du radio_button
- * \param index du bouton à rendre actif
- *
- * \return index bouton actif
- */
-void etats_config_ui_buttons_radio_set_active_index ( const gchar *button_name,
- gint index )
-{
- GtkWidget *radio_button;
- GSList *liste;
- GSList *tmp_list;
+ path = ( GtkTreePath * ) liste->data;
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), path, NULL, FALSE, 0., 0. );
+ tiers_selected = path;
- radio_button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
+ return_value = TRUE;
+ }
- liste = g_slist_copy ( gtk_radio_button_get_group ( GTK_RADIO_BUTTON ( radio_button ) ) );
- tmp_list = g_slist_reverse ( liste );
+ if ( gtk_tree_path_compare ( path, first_path ) == 0 )
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( FALSE, -1 );
+ else
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( TRUE, -1 );
- gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( g_slist_nth_data ( tmp_list, index ) ), TRUE );
+ if ( gtk_tree_path_compare ( path, last_path ) == 0 )
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( -1, FALSE );
+ else
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( -1, TRUE );
- g_slist_free ( liste );
+ /* return */
+ return return_value;
}
/**
- * retourne l'état du togglebutton dont le nom est passé en paramètre.
+ * Gestion des flèches de déplacement des tiers sélextionnés
*
- * \param widget name
+ * \param button
+ * \param event
+ * \param un pointeur donnant le sens de déplacement GDK_LEFTBUTTON et GDK_RIGHTBUTTON
*
- * \return activ
+ * \return
*/
-gboolean etats_config_ui_widget_get_actif ( const gchar *button_name )
+gboolean etats_config_ui_onglet_tiers_select_first_last_item ( GtkWidget *button,
+ GdkEventButton *event,
+ gpointer ptr_sens )
{
- GtkWidget *button = NULL;
+ GtkWidget *tree_view;
+ GtkTreeSelection *selection;
+ GtkTreePath *first_path;
+ GtkTreePath *last_path;
+ GList *liste;
+ gint sens;
+ gint nbre_selections;
- button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
- if ( !button )
+ sens = GPOINTER_TO_INT ( ptr_sens );
+
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_tiers" ) );
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+
+ liste = gtk_tree_selection_get_selected_rows ( selection, NULL );
+ if ( liste == NULL )
+ {
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( FALSE, FALSE );
return FALSE;
+ }
+ nbre_selections = g_list_length (liste );
- /* return */
- return gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button ) );
-}
+ first_path = g_list_nth_data ( liste, 0 );
+ last_path = g_list_nth_data ( liste, nbre_selections - 1 );
+ if ( sens == GDK_LEFTBUTTON )
+ {
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), first_path, NULL, FALSE, 0., 0. );
+ tiers_selected = first_path;
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( FALSE, TRUE );
+ }
+ else
+ {
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), last_path, NULL, FALSE, 0., 0. );
+ tiers_selected = last_path;
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( TRUE, FALSE );
+ }
+ return TRUE;
+}
/**
- * Positionne letogglebutton demandé par son nom en fonction de actif
+ * positionne le tree_view sur le premier tiers sélectionné
*
- *\param widget name
- *\param actif
+ * \param tree_view
+ * \param event
+ * \param user_data = NULL
*
- * \return TRUE if success FALSE otherwise
+ * \return
*/
-gboolean etats_config_ui_widget_set_actif ( const gchar *button_name,
- gboolean actif )
+gboolean etats_config_ui_onglet_tiers_show_first_row_selected ( GtkWidget *tree_view,
+ GdkEventVisibility *event,
+ gpointer user_data)
{
- GtkWidget *button = NULL;
+ GtkTreeSelection *selection;
+ GtkTreePath *start_path;
+ GtkTreePath *end_path;
+ GList *liste;
+
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+ liste = gtk_tree_selection_get_selected_rows ( selection, NULL );
+ if ( liste )
+ tiers_selected = ( GtkTreePath * ) liste->data;
+ else
+ {
+ /* on ajoute un callback pour gérer le changement de sélection */
+ g_signal_connect ( G_OBJECT ( selection ),
+ "changed",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_selection_changed ),
+ NULL );
- button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
- if ( !button )
return FALSE;
+ }
- gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button ), actif );
+ if ( gtk_tree_view_get_visible_range ( GTK_TREE_VIEW ( tree_view ), &start_path, &end_path ) )
+ {
+ if ( tiers_selected && gtk_tree_path_compare ( tiers_selected, end_path ) == 1 )
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), tiers_selected, NULL, FALSE, 0., 0. );
+
+ gtk_tree_path_free ( start_path );
+ gtk_tree_path_free ( end_path );
+ }
+ else if ( tiers_selected )
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), tiers_selected, NULL, FALSE, 0., 0. );
+
+ /* on ajoute un callback pour gérer le changement de sélection */
+ g_signal_connect ( G_OBJECT ( selection ),
+ "changed",
+ G_CALLBACK ( etats_config_ui_onglet_tiers_selection_changed ),
+ NULL );
return TRUE;
}
/**
- * crée un nouveau tree_view initialisé avec model.
- * le modèle comporte deux colonnes : G_TYPE_STRING, G_TYPE_INT
- * le tree_view n'affiche que la colonne texte.
+ * fonction de callback de changement de sélection
*
- * \return the tree_wiew
+ * \param selection
+ * \param NULL
+ *
+ * \return
*/
-GtkWidget *etats_config_ui_tree_view_new_with_model ( const gchar *treeview_name,
- GtkTreeModel *model )
+void etats_config_ui_onglet_tiers_selection_changed ( GtkTreeSelection *selection,
+ gpointer user_data )
{
- GtkWidget *tree_view;
- GtkCellRenderer *cell;
- GtkTreeViewColumn *column;
+ GtkTreeView *tree_view;
+ GtkTreePath *start_path;
+ GtkTreePath *end_path;
+ GtkTreePath *path = NULL;
+ GList *liste;
- tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
- if ( !tree_view )
- return NULL;
+ tree_view = gtk_tree_selection_get_tree_view ( selection );
- gtk_tree_view_set_model ( GTK_TREE_VIEW ( tree_view ), GTK_TREE_MODEL ( model ) );
- g_object_unref ( G_OBJECT ( model ) );
+ /* on récupère la liste des libnes sélectionnées */
+ liste = gtk_tree_selection_get_selected_rows ( selection, NULL );
- utils_set_tree_view_selection_and_text_color ( tree_view );
+ /* on change la sensibilité des boutons de navigation si nécessaire */
+ if ( g_list_length ( liste ) > 1 )
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( TRUE, TRUE );
+ else
+ etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( FALSE, FALSE );
- /* set the column */
- cell = gtk_cell_renderer_text_new ( );
+ /* on positionne le tree_view sur la ligne sélectionnée visible la plus proche */
+ if ( gtk_tree_view_get_visible_range ( GTK_TREE_VIEW ( tree_view ), &start_path, &end_path ) )
+ {
+ while ( liste )
+ {
+ path = ( GtkTreePath * ) liste->data;
- 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 );
+ if ( gtk_tree_selection_path_is_selected ( selection, path ) )
+ {
+ if ( gtk_tree_path_compare ( start_path, path ) <= 0
+ &&
+ gtk_tree_path_compare ( path, end_path ) <= 0 )
+ {
+ if ( gtk_tree_path_compare ( path, tiers_selected ) == 0 )
+ {
+ liste = liste->next;
+ continue;
+ }
+ tiers_selected = path;
+ break;
+ }
+ }
+ liste = liste->next;
+ }
- return tree_view;
+ /* free the path */
+ gtk_tree_path_free ( start_path );
+ gtk_tree_path_free ( end_path );
+ }
}
/**
- * récupère l'index l'iter selectionné
+ * gère la sensibilité des boutons premier,précédent, suivant et dernier pour les tiers
*
- * \param nom du tree_view
+ * \param show left buttons 0 = insensitif 1 = sensitif -1 = sans changement
+ * \param show right buttons 0 = insensitif 1 = sensitif -1 = sans changement
*
- * \return numéro de la ligne sélectionnée
+ * \return
*/
-gint etats_config_ui_tree_view_get_single_row_selected ( const gchar *treeview_name )
+void etats_config_ui_onglet_tiers_show_hide_prev_next_buttons ( gint show_left,
+ gint show_right )
{
- GtkWidget *tree_view;
- GtkTreeModel *model;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
-
- tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
- if ( !tree_view )
- return -1;
-
- selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
-
- if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
+ if ( show_left >= 0 )
{
- gint index;
-
- gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, 1, &index, -1 );
-
- return index;
+ gtk_widget_set_sensitive ( GTK_WIDGET ( gtk_builder_get_object (
+ etat_config_builder, "button_tiers_premier" ) ), show_left );
+ gtk_widget_set_sensitive ( GTK_WIDGET ( gtk_builder_get_object (
+ etat_config_builder, "button_tiers_precedent" ) ), show_left );
+ }
+ if ( show_right >= 0 )
+ {
+ gtk_widget_set_sensitive ( GTK_WIDGET ( gtk_builder_get_object (
+ etat_config_builder, "button_tiers_suivant" ) ), show_right );
+ gtk_widget_set_sensitive ( GTK_WIDGET ( gtk_builder_get_object (
+ etat_config_builder, "button_tiers_dernier" ) ), show_right );
}
- return -1;
}
/**
+ * Fonction de CALLBACK pour la recherche de tiers
*
- *
- * \param
+ * \param editable
+ * \param new_test
+ * \param longueur ajoutée
+ * \param position de l'ajout
+ * \param tree_view pour la recherche
*
* \return
*/
-void etats_config_ui_tree_view_select_single_row ( const gchar *treeview_name,
- gint numero )
+void etats_config_ui_onglet_tiers_entry_insert_text ( GtkEditable *editable,
+ gchar *new_text,
+ gint new_text_length,
+ gpointer position,
+ GtkWidget *tree_view )
{
- GtkWidget *tree_view;
- GtkTreeModel *model;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
+ gchar *text;
- tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
- if ( !tree_view )
- return;
-
- model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
- selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+ /* on bloque l'appel de la fonction */
+ g_signal_handlers_block_by_func ( G_OBJECT ( editable ),
+ G_CALLBACK ( etats_config_ui_onglet_tiers_entry_insert_text ),
+ tree_view );
- if ( gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &iter ) )
- {
- do
- {
- gint index;
+ gtk_editable_insert_text ( editable, new_text, new_text_length, position );
- gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, 1, &index, -1 );
+ /* on lance la recherche de la chaine */
+ text = gtk_editable_get_chars ( editable, 0, -1 );
+ etats_config_ui_onglet_tiers_search_iter_from_entry ( text, GTK_TREE_VIEW ( tree_view ), GDK_RIGHTBUTTON );
- if ( numero == index )
- {
- gtk_tree_selection_select_iter ( GTK_TREE_SELECTION ( selection ), &iter );
- break;
- }
- }
- while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter ) );
- }
+ /* on débloque l'appel de la fonction */
+ g_signal_handlers_unblock_by_func ( G_OBJECT ( editable ),
+ G_CALLBACK ( etats_config_ui_onglet_tiers_entry_insert_text ),
+ tree_view );
+ /* evite d'écrire en double dans l'entry */
+ g_signal_stop_emission_by_name ( editable, "insert_text" );
}
-
/**
+ * Fonction de CALLBACK pour la recherche de tiers
*
- *
- * \param
+ * \param editable
+ * \param début du caractère supprimé
+ * \param fin du caractère supprimé
+ * \param tree_view pour la recherche
*
* \return
*/
-GtkWidget *etats_config_ui_widget_get_widget_by_name ( const gchar *parent_name,
- const gchar *child_name )
+void etats_config_ui_onglet_tiers_entry_delete_text ( GtkEditable *editable,
+ gint start_pos,
+ gint end_pos,
+ GtkWidget *tree_view )
{
- return utils_gtkbuilder_get_widget_by_name ( etat_config_builder, parent_name, child_name );
+ gchar *text;
+
+ text = gtk_editable_get_chars ( editable, 0, start_pos );
+ etats_config_ui_onglet_tiers_search_iter_from_entry ( text, GTK_TREE_VIEW ( tree_view ), GDK_LEFTBUTTON );
}
/**
- * récupère l'index l'iter selectionné
+ * Fonction de de recherche de tiers
*
- * \param nom du tree_view
+ * \param text à rechercher
+ * \param tree_view pour la recherche
+ *
+ * \return
+ */
+void etats_config_ui_onglet_tiers_search_iter_from_entry ( const gchar *text,
+ GtkTreeView *tree_view,
+ gint sens)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ gint index = 1;
+ gint longueur;
+
+ if ( !text || strlen ( text ) == 0 )
+ return;
+
+ model = gtk_tree_view_get_model ( tree_view );
+ path = gtk_tree_path_new_first ( );
+
+ if ( !gtk_tree_model_get_iter ( model, &iter, path ) )
+ return;
+
+ do
+ {
+ gchar *str;
+ gchar *tmp_str;
+
+ gtk_tree_model_get ( model, &iter, 0, &str, -1 );
+
+ longueur = g_utf8_strlen ( text, -1 );
+ tmp_str = g_strndup ( str, longueur );
+
+ if ( strcmp ( g_utf8_casefold ( tmp_str, -1 ), g_utf8_casefold ( text, -1 ) ) == 0 )
+ {
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view ), path, NULL, TRUE, 0.0, 0.0 );
+ break;
+ }
+ if ( path )
+ {
+ gtk_tree_path_next ( path );
+ if ( !gtk_tree_model_get_iter ( model, &iter, path ) )
+ index--;
+ }
+ }
+ /*termine la boucle si la lettre n'existe pas */
+ while ( index );
+}
+
+
+/*RIGHT_PANEL : ONGLET_CATEGORIES*/
+/**
+ * Création de l'onglet Catégories
+ *
+ * \param
+ *
+ * \return
+ */
+GtkWidget *etats_config_ui_onglet_categories_create_page ( gint page )
+{
+ GtkWidget *vbox_onglet;
+ GtkWidget *vbox;
+ GtkWidget *tree_view;
+ GtkWidget *button;
+
+ devel_debug (NULL);
+
+ vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_categories" ) );
+
+ vbox = new_vbox_with_title_and_icon ( _("Categories"), "categories.png" );
+
+ gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
+ gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
+
+ gtk_widget_set_sensitive ( GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder,
+ "vbox_detaille_categ_etat" ) ), FALSE );
+
+ /* on crée la liste des catégories */
+ tree_view = etats_config_ui_onglet_categ_budget_tree_view_create ( TRUE );
+
+ /* on met la connection pour rendre sensitif la vbox_detaille_categ_etat */
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_detaille_categ_etat" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "toggled",
+ G_CALLBACK ( sens_desensitive_pointeur ),
+ gtk_builder_get_object ( etat_config_builder, "vbox_detaille_categ_etat" ) );
+
+ /* 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_left_panel_tree_view_update_style ),
+ GINT_TO_POINTER ( page ) );
+
+ /* on met la connection pour déplier replier les catégories */
+ etats_config_ui_toggle_button_init_button_expand ( "categ", tree_view );
+
+ /* on met la connection pour (dé)sélectionner tout ou partie des catégories */
+ etats_config_ui_onglet_categ_budget_init_buttons_select_unselect ( "categ", tree_view, TRUE );
+
+ return vbox_onglet;
+}
+
+
+/*RIGHT_PANEL : ONGLET_BUDGETS*/
+/**
+ * Création de l'onglet Budgets
+ *
+ * \param
+ *
+ * \return
+ */
+GtkWidget *etats_config_ui_onglet_budgets_create_page ( gint page )
+{
+ GtkWidget *vbox_onglet;
+ GtkWidget *vbox;
+ GtkWidget *button;
+ GtkWidget *tree_view;
+
+ devel_debug (NULL);
+
+ vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_ib" ) );
+
+ vbox = new_vbox_with_title_and_icon ( _("Budgetary lines"), "budgetary_lines.png" );
+
+ gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
+ gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
+
+ gtk_widget_set_sensitive ( utils_gtkbuilder_get_widget_by_name (etat_config_builder,
+ "vbox_detaille_budget_etat", NULL ), FALSE );
+
+ /* on crée la liste des IB */
+ tree_view = etats_config_ui_onglet_categ_budget_tree_view_create ( FALSE );
+
+ /* on met la connection pour rendre sensitif la hbox_detaille_budget_etat */
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "bouton_detaille_budget_etat" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "toggled",
+ G_CALLBACK ( sens_desensitive_pointeur ),
+ utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "vbox_detaille_budget_etat", 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_left_panel_tree_view_update_style ),
+ GINT_TO_POINTER ( page ) );
+
+ /* on met la connection pour déplier replier les IB */
+ etats_config_ui_toggle_button_init_button_expand ( "budget", tree_view );
+
+ /* on met la connection pour sélectionner tout ou partie des IB */
+ etats_config_ui_onglet_categ_budget_init_buttons_select_unselect ( "budget", tree_view, FALSE );
+
+ /* return */
+ return vbox_onglet;
+}
+
+
+/**
+ * create the category/budget list for reports
+ * it's a tree with categories/budget and sub-categories/budgets,
+ * and a check-button to select them
+ *
+ * \param
+ *
+ * \return a GtkWidget : the GtkTreeView
+ * */
+GtkWidget *etats_config_ui_onglet_categ_budget_tree_view_create ( gboolean is_categ )
+{
+ GtkWidget *tree_view;
+ GtkTreeModel *model;
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *cell_renderer;
+ GtkCellRenderer *radio_renderer;
+ gchar *treeview_name;
+
+ /* get the model */
+ model = gsb_etats_config_onglet_categ_budget_get_model ( is_categ );
+
+ if ( is_categ )
+ treeview_name = g_strdup ( "treeview_categ" );
+ else
+ treeview_name = g_strdup ( "treeview_budget" );
+
+ /* create the tree view */
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
+ gtk_tree_view_set_headers_visible ( GTK_TREE_VIEW ( tree_view ), FALSE );
+
+ /* set the color of selected row */
+ utils_set_tree_view_selection_and_text_color ( tree_view );
+
+ if ( model )
+ {
+ gtk_tree_view_set_model ( GTK_TREE_VIEW ( tree_view ), model );
+ g_object_unref ( G_OBJECT ( model ) );
+ }
+
+ /* create the column */
+ column = gtk_tree_view_column_new ();
+
+ /* create the toggle button part */
+ radio_renderer = gtk_cell_renderer_toggle_new ();
+ g_object_set ( G_OBJECT ( radio_renderer ), "xalign", 0.0, NULL );
+
+ gtk_tree_view_column_pack_start ( column,
+ radio_renderer,
+ FALSE );
+ gtk_tree_view_column_set_attributes ( column,
+ radio_renderer,
+ "active", 1,
+ "activatable", 2,
+ NULL);
+ g_signal_connect ( G_OBJECT ( radio_renderer ),
+ "toggled",
+ G_CALLBACK ( gsb_etats_config_onglet_categ_budget_toggled ),
+ model );
+
+ /* create the text part */
+ cell_renderer = gtk_cell_renderer_text_new ( );
+ g_object_set ( G_OBJECT ( cell_renderer ),
+ "xalign", 0.0,
+ NULL );
+ gtk_tree_view_column_pack_start ( column,
+ cell_renderer,
+ TRUE );
+ gtk_tree_view_column_set_attributes (column,
+ cell_renderer,
+ "text", 0,
+ NULL );
+
+ gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ), column );
+
+ g_free ( treeview_name );
+
+ return tree_view;
+}
+
+
+/**
+ * initialisation des boutons de sélection des catégories
+ *
+ * \param suffixe name of widgets
+ * \param tree_view
+ *
+ * \return
+ * */
+void etats_config_ui_onglet_categ_budget_init_buttons_select_unselect ( gchar *name,
+ GtkWidget *tree_view,
+ gboolean is_categ )
+{
+ GtkWidget *button;
+ gchar *tmp_str;
+
+ tmp_str = g_strconcat ( "togglebutton_select_all_", name, NULL );
+ button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL );
+ g_signal_connect ( G_OBJECT ( button ),
+ "toggled",
+ G_CALLBACK ( etats_config_ui_onglet_categ_budget_check_uncheck_all ),
+ tree_view );
+ g_free ( tmp_str );
+
+ tmp_str = g_strconcat ( "button_income_", name, NULL );
+ button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL );
+ g_object_set_data ( G_OBJECT ( button ), "is_categ", GINT_TO_POINTER ( is_categ ) );
+ g_object_set_data ( G_OBJECT ( button ), "type_div", GINT_TO_POINTER ( FALSE ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "button-press-event",
+ G_CALLBACK ( gsb_etats_config_onglet_categ_budget_select_partie_liste ),
+ tree_view );
+ g_free ( tmp_str );
+
+ tmp_str = g_strconcat ( "button_outgoing_", name, NULL );
+ button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL );
+ g_object_set_data ( G_OBJECT ( button ), "is_categ", GINT_TO_POINTER ( is_categ ) );
+ g_object_set_data ( G_OBJECT ( button ), "type_div", GINT_TO_POINTER ( TRUE ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "button-press-event",
+ G_CALLBACK ( gsb_etats_config_onglet_categ_budget_select_partie_liste ),
+ tree_view );
+ g_free ( tmp_str );
+}
+
+
+/**
+ * coche ou décoche toutes les cases du tree_view
+ *
+ * \param toggle_button
+ * \param tree_view
+ *
+ * \return
+ * */
+void etats_config_ui_onglet_categ_budget_check_uncheck_all ( GtkToggleButton *togglebutton,
+ GtkWidget *tree_view )
+{
+ GtkTreeModel *model;
+ gchar *label;
+ gboolean toggle;
+
+ toggle = gtk_toggle_button_get_active ( togglebutton );
+ model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+ gsb_etats_config_onglet_categ_budget_tree_model_check_uncheck_all ( model, toggle );
+
+ if ( ( toggle ) )
+ label = g_strdup ( _("Unselect all") );
+ else
+ label = g_strdup ( _("Select all") );
+
+ gtk_button_set_label ( GTK_BUTTON ( togglebutton ), label );
+}
+
+
+/*RIGHT_PANEL : ONGLET_MODE_PAIEMENT*/
+/**
+ * Création de l'onglet moyens de paiement
+ *
+ * \param
+ *
+ * \return
+ */
+GtkWidget *etats_config_ui_onglet_mode_paiement_create_page ( gint page )
+{
+ GtkWidget *vbox_onglet;
+ GtkWidget *vbox;
+ GtkWidget *tree_view;
+ GtkWidget *button;
+
+ devel_debug (NULL);
+
+ vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_mode_paiement" ) );
+
+ vbox = new_vbox_with_title_and_icon ( _("Payment methods"), "payment.png" );
+
+ gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
+ gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
+
+ gtk_widget_set_sensitive ( GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder,
+ "vbox_mode_paiement_etat" ) ), FALSE );
+
+ /* on crée la liste des moyens de paiement */
+ etats_config_ui_tree_view_init ( "treeview_mode_paiement",
+ gsb_etats_config_onglet_mode_paiement_get_model,
+ GTK_SELECTION_MULTIPLE,
+ NULL );
+
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "treeview_mode_paiement" ) );
+
+ /* 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, "bouton_detaille_mode_paiement_etat" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "toggled",
+ G_CALLBACK ( etats_config_ui_left_panel_tree_view_update_style ),
+ GINT_TO_POINTER ( page ) );
+
+ /* on met la connection pour rendre sensitif la vbox_generale_comptes_etat */
+ g_signal_connect ( G_OBJECT ( button ),
+ "toggled",
+ G_CALLBACK ( sens_desensitive_pointeur ),
+ gtk_builder_get_object ( etat_config_builder, "vbox_mode_paiement_etat" ) );
+
+ /* on met la connection pour (dé)sélectionner tous les tiers */
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder,
+ "togglebutton_select_all_mode_paiement" ) );
+ g_signal_connect ( G_OBJECT ( button ),
+ "toggled",
+ G_CALLBACK ( utils_togglebutton_select_unselect_all_rows ),
+ tree_view );
+
+ return vbox_onglet;
+}
+
+
+/**
+ * Sélectionne les iters en fonction des données de la liste
+ *
+ * \param liste des lignes à sélectionner
+ * \param nom du tree_view concerné
+ *
+ * \return
+ */
+void etats_config_ui_onglet_mode_paiement_select_rows_from_list ( GSList *liste,
+ const gchar *treeview_name )
+{
+ GtkWidget *tree_view;
+ GtkTreeModel *model;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GSList *tmp_list;
+
+ if ( !liste )
+ return;
+
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
+ model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+
+ if ( gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &iter ) )
+ {
+ do
+ {
+ gchar *tmp_str;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, 0, &tmp_str, -1 );
+
+ tmp_list = liste;
+ while ( tmp_list )
+ {
+ gchar *str;
+
+ str = tmp_list -> data;
+
+ if ( strcmp ( str, tmp_str ) == 0 )
+ gtk_tree_selection_select_iter ( GTK_TREE_SELECTION ( selection ), &iter );
+
+ tmp_list = tmp_list -> next;
+ }
+ g_free ( tmp_str );
+ }
+ while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter ) );
+ }
+}
+
+
+/**
+ * récupère la liste des libellés des item sélectionnés
+ *
+ * \param nom du tree_view
+ *
+ * \return numéro de la ligne sélectionnée
+ */
+GSList *etats_config_ui_onglet_mode_paiement_get_list_rows_selected ( const gchar *treeview_name )
+{
+ GtkWidget *tree_view;
+ GtkTreeModel *model;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GSList *tmp_list = NULL;
+ GList *rows_list;
+
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
+ if ( !tree_view )
+ return NULL;
+
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+ rows_list = gtk_tree_selection_get_selected_rows ( selection, &model );
+ while ( rows_list )
+ {
+ GtkTreePath *path;
+ gchar *tmp_str;
+
+ path = rows_list->data;
+
+ gtk_tree_model_get_iter ( model, &iter, path) ;
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, 0, &tmp_str, -1 );
+
+ tmp_list = g_slist_append ( tmp_list, tmp_str );
+
+ gtk_tree_path_free ( path );
+ rows_list = rows_list->next;
+ }
+ g_list_free ( rows_list );
+
+ return tmp_list;
+}
+
+
+/*FONCTIONS UTILITAIRES COMMUNES*/
+/**
+ * retourne l'index du radiobutton actif.
+ *
+ * \param nom du radio_button
+ *
+ * \return index bouton actif
+ */
+gint etats_config_ui_buttons_radio_get_active_index ( const gchar *button_name )
+{
+ GtkWidget *radio_button;
+ GSList *liste;
+ GSList *tmp_list;
+ gint index = 0;
+
+ radio_button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
+
+ liste = g_slist_copy ( gtk_radio_button_get_group ( GTK_RADIO_BUTTON ( radio_button ) ) );
+ tmp_list = g_slist_reverse ( liste );
+
+ while ( tmp_list )
+ {
+ GtkWidget *button;
+
+ button = tmp_list->data;
+ if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button ) ) )
+ break;
+
+ index++;
+ tmp_list = tmp_list->next;
+ }
+
+ g_slist_free ( liste );
+
+ return index;
+}
+
+/**
+ * rend actif le button qui correspond à l'index passé en paramètre.
+ *
+ * \param nom du radio_button
+ * \param index du bouton à rendre actif
+ *
+ * \return index bouton actif
+ */
+void etats_config_ui_buttons_radio_set_active_index ( const gchar *button_name,
+ gint index )
+{
+ GtkWidget *radio_button;
+ GSList *liste;
+ GSList *tmp_list;
+
+ radio_button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
+
+ liste = g_slist_copy ( gtk_radio_button_get_group ( GTK_RADIO_BUTTON ( radio_button ) ) );
+ tmp_list = g_slist_reverse ( liste );
+
+ gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( g_slist_nth_data ( tmp_list, index ) ), TRUE );
+
+ g_slist_free ( liste );
+}
+
+
+/**
+ * initialise le bouton expand collapse all
+ *
+ * \param suffixe name
+ * \param tree_view
+ *
+ * \return
+ */
+void etats_config_ui_toggle_button_init_button_expand ( gchar *name,
+ GtkWidget *tree_view )
+{
+ GtkWidget *button;
+ gchar *tmp_str;
+
+ tmp_str = g_strconcat ( "togglebutton_expand_", name, NULL );
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, tmp_str ) );
+ g_free ( tmp_str );
+
+ tmp_str = g_strconcat ( "hbox_toggle_expand_", name, NULL );
+ g_object_set_data ( G_OBJECT ( button ), "hbox_expand",
+ gtk_builder_get_object ( etat_config_builder, tmp_str ) );
+ g_free ( tmp_str );
+
+ tmp_str = g_strconcat ( "hbox_toggle_collapse_", name, NULL );
+ g_object_set_data ( G_OBJECT ( button ), "hbox_collapse",
+ gtk_builder_get_object ( etat_config_builder, tmp_str ) );
+
+ g_signal_connect ( G_OBJECT ( button ),
+ "clicked",
+ G_CALLBACK ( utils_togglebutton_collapse_expand_all_rows ),
+ tree_view );
+}
+
+
+/**
+ * retourne l'état du togglebutton dont le nom est passé en paramètre.
+ *
+ * \param widget name
+ *
+ * \return activ
+ */
+gboolean etats_config_ui_widget_get_actif ( const gchar *button_name )
+{
+ GtkWidget *button = NULL;
+
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
+ if ( !button )
+ return FALSE;
+
+ /* return */
+ return gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button ) );
+}
+
+
+/**
+ * Positionne letogglebutton demandé par son nom en fonction de actif
+ *
+ *\param widget name
+ *\param actif
+ *
+ * \return TRUE if success FALSE otherwise
+ */
+gboolean etats_config_ui_widget_set_actif ( const gchar *button_name,
+ gboolean actif )
+{
+ GtkWidget *button = NULL;
+
+ button = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, button_name ) );
+ if ( !button )
+ return FALSE;
+
+ gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button ), actif );
+
+ return TRUE;
+}
+
+
+/**
+ * crée un nouveau tree_view initialisé avec model.
+ * le modèle comporte deux colonnes : G_TYPE_STRING, G_TYPE_INT
+ * le tree_view n'affiche que la colonne texte.
+ *
+ * \return the tree_wiew
+ */
+GtkWidget *etats_config_ui_tree_view_new_with_model ( const gchar *treeview_name,
+ GtkTreeModel *model )
+{
+ GtkWidget *tree_view;
+ GtkCellRenderer *cell;
+ GtkTreeViewColumn *column;
+
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
+ if ( !tree_view )
+ return NULL;
+
+ gtk_tree_view_set_model ( GTK_TREE_VIEW ( tree_view ), GTK_TREE_MODEL ( model ) );
+ g_object_unref ( G_OBJECT ( model ) );
+
+ 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 );
+
+ return tree_view;
+}
+
+
+/**
+ * récupère l'index l'iter selectionné
+ *
+ * \param nom du tree_view
+ *
+ * \return numéro de la ligne sélectionnée
+ */
+gint etats_config_ui_tree_view_get_single_row_selected ( const gchar *treeview_name )
+{
+ GtkWidget *tree_view;
+ GtkTreeModel *model;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
+ if ( !tree_view )
+ return -1;
+
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+
+ if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
+ {
+ gint index;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, 1, &index, -1 );
+
+ return index;
+ }
+ return -1;
+}
+
+
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ */
+void etats_config_ui_tree_view_select_single_row ( const gchar *treeview_name,
+ gint numero )
+{
+ GtkWidget *tree_view;
+ GtkTreeModel *model;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+
+ tree_view = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, treeview_name ) );
+ if ( !tree_view )
+ return;
+
+ model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+ selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
+
+ if ( gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &iter ) )
+ {
+ do
+ {
+ gint index;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, 1, &index, -1 );
+
+ if ( numero == index )
+ {
+ gtk_tree_selection_select_iter ( GTK_TREE_SELECTION ( selection ), &iter );
+ break;
+ }
+ }
+ while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter ) );
+ }
+}
+
+
+/**
+ *
+ *
+ * \param
+ *
+ * \return
+ */
+GtkWidget *etats_config_ui_widget_get_widget_by_name ( const gchar *parent_name,
+ const gchar *child_name )
+{
+ return utils_gtkbuilder_get_widget_by_name ( etat_config_builder, parent_name, child_name );
+}
+
+
+/**
+ * récupère l'index l'iter selectionné
+ *
+ * \param nom du tree_view
*
* \return numéro de la ligne sélectionnée
*/
@@ -1356,6 +2306,7 @@ void etats_config_ui_tree_view_init ( const gchar *treeview_name,
model = function ( );
tree_view = etats_config_ui_tree_view_new_with_model ( treeview_name, GTK_TREE_MODEL ( model ) );
+ gtk_tree_view_set_fixed_height_mode ( GTK_TREE_VIEW ( tree_view ), TRUE );
selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
gtk_tree_selection_set_mode ( selection, type_selection );
@@ -1367,8 +2318,17 @@ void etats_config_ui_tree_view_init ( const gchar *treeview_name,
}
+/**
+ * Sélectionne les iters en fonction des données de la liste
+ *
+ * \param liste des lignes à sélectionner
+ * \param nom du tree_view concerné
+ * \param numéro de la colonne contenant la donnée testée
+ *
+ * \return
+ */
void etats_config_ui_tree_view_select_rows_from_list ( GSList *liste,
- gchar *treeview_name,
+ const gchar *treeview_name,
gint column )
{
GtkWidget *tree_view;
@@ -1388,9 +2348,9 @@ void etats_config_ui_tree_view_select_rows_from_list ( GSList *liste,
{
do
{
- gint fyear_number;
+ gint tmp_number;
- gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, column, &fyear_number, -1 );
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter, column, &tmp_number, -1 );
tmp_list = liste;
while ( tmp_list )
@@ -1399,7 +2359,7 @@ void etats_config_ui_tree_view_select_rows_from_list ( GSList *liste,
result = GPOINTER_TO_INT ( tmp_list -> data );
- if ( result == fyear_number )
+ if ( result == tmp_number )
gtk_tree_selection_select_iter ( GTK_TREE_SELECTION ( selection ), &iter );
tmp_list = tmp_list -> next;
diff --git a/src/etats_config_ui.h b/src/etats_config_ui.h
index c3aa8ce..5028fe2 100644
--- a/src/etats_config_ui.h
+++ b/src/etats_config_ui.h
@@ -5,11 +5,16 @@
/* END_INCLUDE_H */
/* START_DECLARATION */
-void etats_config_ui_free_builder ( void );
+void etats_config_ui_free_all_var ( void );
GtkWidget *etats_config_ui_create_dialog ( void );
+void etats_config_ui_onglet_categ_budget_check_uncheck_all ( GtkToggleButton *togglebutton,
+ GtkWidget *tree_view );
void etats_config_ui_onglet_comptes_select_unselect ( GtkToggleButton *togglebutton,
GtkWidget *tree_view );
+GSList *etats_config_ui_onglet_mode_paiement_get_list_rows_selected ( const gchar *treeview_name );
+void etats_config_ui_onglet_mode_paiement_select_rows_from_list ( GSList *liste,
+ const gchar *treeview_name );
void etats_config_ui_onglet_periode_date_interval_sensitive ( gboolean show );
gint etats_config_ui_buttons_radio_get_active_index ( const gchar *button_name );
@@ -19,7 +24,7 @@ void etats_config_ui_buttons_radio_set_active_index ( const gchar *button_name,
GSList *etats_config_ui_tree_view_get_list_rows_selected ( const gchar *treeview_name );
gint etats_config_ui_tree_view_get_single_row_selected ( const gchar *treeview_name );
void etats_config_ui_tree_view_select_rows_from_list ( GSList *liste,
- gchar *treeview_name,
+ const gchar *treeview_name,
gint column );
void etats_config_ui_tree_view_select_single_row ( const gchar *treeview_name,
gint numero );
@@ -29,8 +34,6 @@ GtkWidget *etats_config_ui_widget_get_widget_by_name ( const gchar *parent_name,
const gchar *child_name );
gboolean etats_config_ui_widget_set_actif ( const gchar *widget_name,
gboolean actif );
-
-
/* END_DECLARATION */
diff --git a/src/export.c b/src/export.c
index 1f6dcd7..5dd1e61 100644
--- a/src/export.c
+++ b/src/export.c
@@ -149,7 +149,9 @@ void export_accounts ( void )
g_free ( extension );
g_slist_free ( selected_accounts );
- g_slist_free_full ( exported_accounts, ( GDestroyNotify ) expert_account_free_account_structure );
+ g_slist_foreach ( exported_accounts, ( GFunc ) expert_account_free_account_structure, NULL );
+ g_slist_free ( exported_accounts );
+/* g_slist_free_full ( exported_accounts, ( GDestroyNotify ) expert_account_free_account_structure ); */
gtk_widget_destroy ( dialog );
}
diff --git a/src/gsb_data_report.c b/src/gsb_data_report.c
index ac2297e..34c0e55 100644
--- a/src/gsb_data_report.c
+++ b/src/gsb_data_report.c
@@ -3739,6 +3739,7 @@ void gsb_data_report_free_payee_numbers_list ( gint report_number )
return;
if ( report -> payee_numbers )
g_slist_free ( report -> payee_numbers );
+
report -> payee_numbers = NULL;
}
@@ -4380,6 +4381,29 @@ void gsb_data_report_free_transfer_account_numbers_list ( gint report_number )
}
+/**
+ * free the method_of_payment_list
+ *
+ * \param report_number number of the report
+ *
+ * \return
+ * */
+void gsb_data_report_free_method_of_payment_list ( gint report_number )
+{
+ struct_report *report;
+
+ report = gsb_data_report_get_structure ( report_number );
+
+ if ( !report )
+ return;
+
+ if ( report->method_of_payment_list )
+ g_slist_free ( report->method_of_payment_list );
+
+ report->method_of_payment_list = NULL;
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/gsb_data_report.h b/src/gsb_data_report.h
index 5fb3772..1df9cb2 100644
--- a/src/gsb_data_report.h
+++ b/src/gsb_data_report.h
@@ -29,6 +29,7 @@ gint gsb_data_report_dup ( gint report_number );
void gsb_data_report_free_account_numbers_list ( gint report_number );
void gsb_data_report_free_categ_budget_struct_list (GSList *categ_budget_sel_list);
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_transfer_account_numbers_list ( gint report_number );
gint gsb_data_report_get_account_group_reports ( gint report_number );
diff --git a/src/gsb_etats_config.c b/src/gsb_etats_config.c
index 7f3fdec..1ed0d83 100644
--- a/src/gsb_etats_config.c
+++ b/src/gsb_etats_config.c
@@ -62,15 +62,31 @@
/*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_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 );
static void gsb_etats_config_initialise_onglet_virements ( gint report_number );
+static void gsb_etats_config_initialise_onglet_categ_budget ( gint report_number,
+ gboolean is_categ );
+
+static gboolean gsb_etats_config_onglet_categ_budget_fill_model ( GtkTreeModel *model,
+ gboolean is_categ );
+static GSList *gsb_etats_config_onglet_categ_budget_get_selected ( const gchar *treeview_name );
+static void gsb_etats_config_onglet_categ_budget_init_treeview ( const gchar *treeview_name,
+ GSList *tmp_list );
+static gint gsb_etats_config_onglet_categ_budget_sort_function ( GtkTreeModel *model,
+ GtkTreeIter *iter_1,
+ GtkTreeIter *iter_2,
+ gpointer ptr );
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_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 );
static void gsb_etats_config_recupere_info_onglet_virements ( gint report_number );
+static void gsb_etats_config_recupere_info_onglet_categ_budget ( gint report_number,
+ gboolean is_categ );
/**********************************************************************************************************************/
@@ -78,33 +94,12 @@ static GtkWidget *gsb_etats_config_affichage_etat_devises ( void );
static GtkWidget *gsb_etats_config_affichage_etat_generalites ( void );
static GtkWidget *gsb_etats_config_affichage_etat_operations ( void );
static GtkWidget *gsb_etats_config_affichage_etat_titres ( void );
-static gboolean gsb_etats_config_budget_select_all ( GtkWidget *button,
- gboolean *select_ptr );
-static gint gsb_etats_config_categ_budget_sort_function ( GtkTreeModel *model,
- GtkTreeIter *iter_1,
- GtkTreeIter *iter_2,
- gchar *sw_name );
-static gboolean gsb_etats_config_categ_budget_toggled ( GtkCellRendererToggle *radio_renderer,
- gchar *path_str,
- GtkTreeStore *store );
-static GtkWidget *gsb_etats_config_get_liste_categ_budget ( gchar *sw_name );
-static GtkWidget *gsb_etats_config_onglet_get_liste_dates ( void );
-static GtkWidget *gsb_etats_config_get_liste_mode_paiement ( gchar *sw_name );
-static GtkWidget *gsb_etats_config_get_report_tree_view ( void );
-static GtkWidget *gsb_etats_config_get_scrolled_window_with_tree_view ( gchar *sw_name,
- GtkTreeModel *model );
-
-static gboolean gsb_etats_config_fill_liste_categ_budget ( gboolean is_categ );
-static GtkWidget *gsb_etats_config_onglet_etat_categories ( void );
-static GtkWidget *gsb_etats_config_onglet_etat_comptes ( void );
-static GtkWidget *gsb_etats_config_onglet_etat_period ( void );
+
static GtkWidget *gsb_etats_config_onglet_etat_divers ( void );
-static GtkWidget *gsb_etats_config_onglet_etat_ib ( void );
-static GtkWidget *gsb_etats_config_onglet_etat_mode_paiement ( void );
+
static GtkWidget *gsb_etats_config_onglet_etat_montant ( void );
static GtkWidget *gsb_etats_config_onglet_etat_texte ( void );
-static GtkWidget *gsb_etats_config_onglet_etat_tiers ( void );
-static GtkWidget *gsb_etats_config_onglet_etat_virements ( void );
+
static void gsb_etats_config_onglet_etat_combo_set_model ( GtkWidget *combo,
gchar **tab );
static void gsb_etats_config_onglet_etat_texte_combo_changed ( GtkComboBox *combo,
@@ -112,31 +107,8 @@ static void gsb_etats_config_onglet_etat_texte_combo_changed ( GtkComboBox *comb
static void gsb_etats_config_onglet_etat_texte_get_buttons_add_remove ( GtkWidget *parent,
gboolean button_2_visible );
static GtkWidget *gsb_etats_config_onglet_etat_texte_new_line ( GtkWidget *parent );
-static gboolean gsb_etats_config_onglet_select_partie_liste_categ_budget ( GtkWidget *button,
- GdkEventButton *event,
- GtkWidget *tree_view );
static GtkWidget *gsb_etats_config_page_data_grouping ( void );
static GtkWidget *gsb_etats_config_page_data_separation ( void );
-static void gsb_etats_config_populate_tree_model ( GtkTreeStore *tree_model,
- GtkWidget *notebook );
-static gboolean gsb_etats_config_report_tree_selectable_func (GtkTreeSelection *selection,
- GtkTreeModel *model,
- GtkTreePath *path,
- gboolean path_currently_selected,
- gpointer data);
-static gboolean gsb_etats_config_report_tree_view_selection_changed ( GtkTreeSelection *selection,
- GtkTreeModel *model );
-static gboolean gsb_etats_config_selection_dates_changed ( GtkTreeSelection *selection,
- GtkWidget *widget );
-static void gsb_etats_config_onglet_set_buttons_select_categ_budget ( gchar *sw_name,
- GtkWidget *tree_view,
- gboolean is_categ );
-static void gsb_etats_config_togglebutton_collapse_expand_lines ( GtkToggleButton *togglebutton,
- GtkWidget *tree_view );
-static void gsb_etats_config_togglebutton_select_all ( GtkToggleButton *togglebutton,
- GtkWidget *tree_view );
-static GtkWidget *gsb_etats_config_togglebutton_set_button_expand ( gchar *sw_name,
- GtkWidget *tree_view );
/*END_STATIC*/
@@ -157,17 +129,6 @@ enum
};
-/* the def of the columns in the model of config tree_view */
-enum gsb_report_tree_columns
-{
- GSB_REPORT_TREE_TEXT_COLUMN,
- GSB_REPORT_TREE_PAGE_COLUMN,
- GSB_REPORT_TREE_BOLD_COLUMN,
- GSB_REPORT_TREE_ITALIC_COLUMN,
- GSB_REPORT_TREE_NUM_COLUMNS,
-};
-
-
/*
static gchar *etats_config_jours_semaine[] =
{
@@ -295,7 +256,7 @@ void gsb_etats_config_personnalisation_etat ( void )
break;
}
- etats_config_ui_free_builder ( );
+ etats_config_ui_free_all_var ( );
gtk_widget_destroy ( dialog );
}
@@ -322,6 +283,15 @@ gboolean gsb_etats_config_initialise_dialog_from_etat ( gint report_number )
/* onglet tiers */
gsb_etats_config_initialise_onglet_tiers ( report_number );
+ /* onglet Categories */
+ gsb_etats_config_initialise_onglet_categ_budget ( report_number, TRUE );
+
+ /* onglet Budgets */
+ gsb_etats_config_initialise_onglet_categ_budget ( report_number, FALSE );
+
+ /* onglet modes de paiement */
+ gsb_etats_config_initialise_onglet_mode_paiement ( report_number );
+
/* return */
return TRUE;
}
@@ -348,6 +318,17 @@ gboolean gsb_etats_config_recupere_info_to_etat ( gint report_number )
/* onglet tiers */
gsb_etats_config_recupere_info_onglet_tiers ( report_number );
+ /* onglet Categories */
+ gsb_etats_config_recupere_info_onglet_categ_budget ( report_number, TRUE );
+
+ /* onglet Budgets */
+ gsb_etats_config_recupere_info_onglet_categ_budget ( report_number, FALSE );
+
+ /* onglet mode de paiement */
+ gsb_etats_config_recupere_info_onglet_mode_paiement ( report_number );
+
+
+
/* update the payee combofix in the form, to add that report if asked */
gsb_form_widget_update_payee_combofix ( );
@@ -662,14 +643,14 @@ void gsb_etats_config_initialise_onglet_comptes ( gint report_number )
etats_config_ui_widget_set_actif ( "bouton_detaille_comptes_etat", active );
if ( active )
+ {
etats_config_ui_tree_view_select_rows_from_list (
gsb_data_report_get_account_numbers_list ( report_number ),
"treeview_comptes",
1 );
- if ( g_slist_length ( gsb_data_report_get_account_numbers_list ( report_number ) ) )
- {
- utils_togglebutton_set_label_position_unselect (
+ if ( g_slist_length ( gsb_data_report_get_account_numbers_list ( report_number ) ) )
+ utils_togglebutton_set_label_position_unselect (
etats_config_ui_widget_get_widget_by_name (
"togglebutton_select_all_comptes", NULL ),
G_CALLBACK ( etats_config_ui_onglet_comptes_select_unselect ),
@@ -691,10 +672,30 @@ void gsb_etats_config_recupere_info_onglet_comptes ( gint report_number )
active = etats_config_ui_widget_get_actif ( "bouton_detaille_comptes_etat" );
gsb_data_report_set_account_use_chosen ( report_number, active );
+
if ( active )
{
gsb_data_report_free_account_numbers_list ( report_number );
- gsb_data_report_set_account_numbers_list ( report_number,
+
+ if ( utils_tree_view_all_rows_are_selected ( GTK_TREE_VIEW (
+ etats_config_ui_widget_get_widget_by_name ( "treeview_comptes", NULL ) ) ) )
+ {
+ gchar *text;
+ gchar *hint;
+
+ hint = g_strdup ( _("Performance issue.") );
+ text = g_strdup ( _("All accounts have been selected. Grisbi will run "
+ "faster without the \"Detail accounts used\" option activated") );
+
+ dialogue_special ( GTK_MESSAGE_INFO, make_hint ( hint, text ) );
+ etats_config_ui_widget_set_actif ( "gsb_data_report_set_account_use_chosen", FALSE );
+ gsb_data_report_set_account_use_chosen ( report_number, FALSE );
+
+ g_free ( text );
+ g_free ( hint );
+ }
+ else
+ gsb_data_report_set_account_numbers_list ( report_number,
etats_config_ui_tree_view_get_list_rows_selected ( "treeview_comptes" ) );
}
}
@@ -783,14 +784,14 @@ void gsb_etats_config_initialise_onglet_tiers ( gint report_number )
etats_config_ui_widget_set_actif ( "bouton_detaille_tiers_etat", active );
if ( active )
+ {
etats_config_ui_tree_view_select_rows_from_list (
gsb_data_report_get_payee_numbers_list ( report_number ),
"treeview_tiers",
1 );
- if ( g_slist_length ( gsb_data_report_get_payee_numbers_list ( report_number ) ) )
- {
- utils_togglebutton_set_label_position_unselect (
+ if ( g_slist_length ( gsb_data_report_get_payee_numbers_list ( report_number ) ) )
+ utils_togglebutton_set_label_position_unselect (
etats_config_ui_widget_get_widget_by_name (
"togglebutton_select_all_tiers", NULL ),
NULL,
@@ -856,62 +857,126 @@ void gsb_etats_config_recupere_info_onglet_tiers ( gint report_number )
if ( active )
{
gsb_data_report_free_payee_numbers_list ( report_number );
- gsb_data_report_set_payee_numbers_list ( report_number,
+
+ if ( utils_tree_view_all_rows_are_selected ( GTK_TREE_VIEW (
+ etats_config_ui_widget_get_widget_by_name ( "treeview_tiers", NULL ) ) ) )
+ {
+ gchar *text;
+ gchar *hint;
+
+ hint = g_strdup ( _("Performance issue.") );
+ text = g_strdup ( _("All payees have been selected. Grisbi will run "
+ "faster without the \"Detail payees used\" option activated.") );
+
+ dialogue_special ( GTK_MESSAGE_INFO, make_hint ( hint, text ) );
+ etats_config_ui_widget_set_actif ( "togglebutton_select_all_tiers", FALSE );
+ gsb_data_report_set_payee_detail_used ( report_number, FALSE );
+
+ g_free ( text );
+ g_free ( hint );
+ }
+ else
+ gsb_data_report_set_payee_numbers_list ( report_number,
etats_config_ui_tree_view_get_list_rows_selected ( "treeview_tiers" ) );
}
}
-/*ONGLET_CATEGORIES*/
+/*ONGLET_CATEGORIES BUDGETS*/
/**
+ * Initialise les informations des onglets catégories ou budgets
*
+ * \param report_number
+ * \param is_categ TRUE = Categories FALSE = Budgets
*
- *
+ * \return
*/
-GtkWidget *gsb_etats_config_onglet_etat_categories ( void )
+void gsb_etats_config_initialise_onglet_categ_budget ( gint report_number,
+ gboolean is_categ )
{
- GtkWidget *vbox_onglet;
- GtkWidget *vbox;
- GtkWidget *sw;
- GtkWidget *tree_view;
- GtkWidget *button;
-
- devel_debug (NULL);
+ gint active;
+ gchar *checkbutton_name;
+ gchar *button_name;
+ gchar *treeview_name;
+ GSList *tmp_list;
- vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_categories" ) );
+ if ( is_categ )
+ {
+ active = gsb_data_report_get_category_detail_used ( report_number );
+ checkbutton_name = g_strdup ( "bouton_detaille_categ_etat" );
+ treeview_name = g_strdup ( "treeview_categ" );
+ button_name = g_strdup ( "togglebutton_select_all_categ" );
+ tmp_list = gsb_data_report_get_category_struct_list ( report_number );
+ }
+ else
+ {
+ active = gsb_data_report_get_budget_detail_used ( report_number );
+ checkbutton_name = g_strdup ( "bouton_detaille_budget_etat" );
+ treeview_name = g_strdup ( "treeview_budget" );
+ button_name = g_strdup ( "togglebutton_select_all_budget" );
+ tmp_list = gsb_data_report_get_budget_struct_list ( report_number );
+ }
- vbox = new_vbox_with_title_and_icon ( _("Categories"), "categories.png" );
+ etats_config_ui_widget_set_actif ( checkbutton_name, active );
- gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
- gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
+ if ( active )
+ {
+ gsb_etats_config_onglet_categ_budget_init_treeview ( treeview_name, tmp_list );
- gtk_widget_set_sensitive ( utils_gtkbuilder_get_widget_by_name (etat_config_builder,
- "vbox_detaille_categ_etat", NULL ), FALSE );
+ if ( g_slist_length ( tmp_list ) )
+ utils_togglebutton_set_label_position_unselect (
+ etats_config_ui_widget_get_widget_by_name (
+ button_name, NULL ),
+ G_CALLBACK ( etats_config_ui_onglet_categ_budget_check_uncheck_all ),
+ etats_config_ui_widget_get_widget_by_name ( treeview_name, NULL ) );
+ }
- /* on crée la liste des catégories */
- sw = gsb_etats_config_get_liste_categ_budget ( "sw_categ" );
- tree_view = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "sw_categ", "tree_view" );
+ g_free ( checkbutton_name );
+ g_free ( treeview_name );
+ g_free ( button_name );
+}
- /* on remplit la liste des catégories */
- gsb_etats_config_fill_liste_categ_budget ( TRUE );
- /* on met la connection pour rendre sensitif la vbox_detaille_categ_etat */
- g_signal_connect ( G_OBJECT ( utils_gtkbuilder_get_widget_by_name (etat_config_builder,
- "button_detail_categ_etat", NULL ) ),
- "toggled",
- G_CALLBACK ( sens_desensitive_pointeur ),
- utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "vbox_detaille_categ_etat", NULL ) );
+/**
+ * Récupère les informations des onglets catégories ou budgets
+ *
+ * \param report_number
+ * \param is_categ TRUE = Categories FALSE = Budgets
+ *
+ * \return
+ */
+void gsb_etats_config_recupere_info_onglet_categ_budget ( gint report_number,
+ gboolean is_categ )
+{
+ gint active;
+ gchar *treeview_name;
- /* on met la connection pour déplier replier les catégories */
- button = gsb_etats_config_togglebutton_set_button_expand ( "sw_categ", tree_view );
+ if ( is_categ )
+ {
+ active = etats_config_ui_widget_get_actif ( "bouton_detaille_categ_etat" );
+ treeview_name = g_strdup ( "treeview_categ" );
- /* on met la connection pour (dé)sélectionner toutes les catégories */
-/* button = gsb_etats_config_togglebutton_set_button_select ( "sw_categ", tree_view ); */
+ gsb_data_report_set_category_detail_used ( report_number, active );
+ if ( active )
+ {
+ gsb_data_report_set_category_struct_list ( report_number,
+ gsb_etats_config_onglet_categ_budget_get_selected ( treeview_name ) );
+ }
+ }
+ else
+ {
+ active = etats_config_ui_widget_get_actif ( "bouton_detaille_budget_etat" );
+ treeview_name = g_strdup ( "treeview_budget" );
- /* on met la connection pour sélectionner une partie des catégories */
- gsb_etats_config_onglet_set_buttons_select_categ_budget ( "sw_categ", tree_view, TRUE );
+ gsb_data_report_set_budget_detail_used ( report_number, active );
+ if ( active )
+ {
+ gsb_data_report_set_budget_struct_list ( report_number,
+ gsb_etats_config_onglet_categ_budget_get_selected ( treeview_name ) );
+ }
+ }
- return vbox_onglet;
+ g_free ( treeview_name );
}
@@ -924,14 +989,9 @@ GtkWidget *gsb_etats_config_onglet_etat_categories ( void )
*
* \return a GtkWidget : the GtkTreeView
* */
-GtkWidget *gsb_etats_config_get_liste_categ_budget ( gchar *sw_name )
+GtkTreeModel *gsb_etats_config_onglet_categ_budget_get_model ( gboolean is_categ )
{
- GtkWidget *sw;
- GtkWidget *tree_view;
GtkTreeStore *store;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
- GtkCellRenderer *radio_renderer;
store = gtk_tree_store_new ( GSB_ETAT_CATEG_BUDGET_LIST_NB,
G_TYPE_STRING, /* GSB_ETAT_CATEG_BUDGET_LIST_NAME */
@@ -945,63 +1005,14 @@ GtkWidget *gsb_etats_config_get_liste_categ_budget ( gchar *sw_name )
gtk_tree_sortable_set_sort_func ( GTK_TREE_SORTABLE ( store ),
GSB_ETAT_CATEG_BUDGET_LIST_NAME,
- (GtkTreeIterCompareFunc) gsb_etats_config_categ_budget_sort_function,
- sw_name,
- NULL );
-
- /* create the tree view */
- tree_view = gtk_tree_view_new_with_model ( GTK_TREE_MODEL ( store ) );
- gtk_tree_view_set_headers_visible ( GTK_TREE_VIEW ( tree_view ), FALSE );
-
- /* set the color of selected row */
- utils_set_tree_view_selection_and_text_color ( tree_view );
-
- g_object_unref ( G_OBJECT ( store ) );
-
- /* create the column */
- column = gtk_tree_view_column_new ();
-
- /* create the toggle button part */
- radio_renderer = gtk_cell_renderer_toggle_new ();
- g_object_set ( G_OBJECT ( radio_renderer ), "xalign", 0.0, NULL );
-
- gtk_tree_view_column_pack_start ( column,
- radio_renderer,
- FALSE );
- gtk_tree_view_column_set_attributes ( column,
- radio_renderer,
- "active", 1,
- "activatable", 2,
- NULL);
- g_signal_connect ( G_OBJECT ( radio_renderer ),
- "toggled",
- G_CALLBACK ( gsb_etats_config_categ_budget_toggled ),
- store );
-
- /* create the text part */
- cell_renderer = gtk_cell_renderer_text_new ( );
- g_object_set ( G_OBJECT ( cell_renderer ),
- "xalign", 0.0,
- NULL );
- gtk_tree_view_column_pack_start ( column,
- cell_renderer,
- TRUE );
- gtk_tree_view_column_set_attributes (column,
- cell_renderer,
- "text", 0,
+ (GtkTreeIterCompareFunc) gsb_etats_config_onglet_categ_budget_sort_function,
+ GINT_TO_POINTER ( is_categ ),
NULL );
- gtk_tree_view_append_column ( GTK_TREE_VIEW ( tree_view ), column );
-
- /* get the container */
- sw = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, sw_name ) );
- gtk_container_add ( GTK_CONTAINER ( sw ), tree_view );
-
- g_object_set_data ( G_OBJECT ( sw ), "tree_view", tree_view );
-
- gtk_widget_show_all ( sw );
+ gsb_etats_config_onglet_categ_budget_fill_model ( GTK_TREE_MODEL ( store ), is_categ );
- return sw;
+ /* return */
+ return GTK_TREE_MODEL ( store );
}
@@ -1016,7 +1027,7 @@ GtkWidget *gsb_etats_config_get_liste_categ_budget ( gchar *sw_name )
*
* \return FALSE
* */
-gboolean gsb_etats_config_categ_budget_toggled ( GtkCellRendererToggle *radio_renderer,
+gboolean gsb_etats_config_onglet_categ_budget_toggled ( GtkCellRendererToggle *radio_renderer,
gchar *path_str,
GtkTreeStore *store )
{
@@ -1079,7 +1090,7 @@ gboolean gsb_etats_config_categ_budget_toggled ( GtkCellRendererToggle *radio_re
*
* \return FALSE
* */
-void gsb_etats_config_tree_model_check_uncheck_all ( GtkTreeModel *model,
+void gsb_etats_config_onglet_categ_budget_tree_model_check_uncheck_all ( GtkTreeModel *model,
gboolean toggle_value )
{
GtkTreeIter parent_iter;
@@ -1116,102 +1127,7 @@ void gsb_etats_config_tree_model_check_uncheck_all ( GtkTreeModel *model,
*
*
*/
-void gsb_etats_config_togglebutton_collapse_expand_lines ( GtkToggleButton *togglebutton,
- GtkWidget *tree_view )
-{
- GtkWidget *hbox_expand;
- GtkWidget *hbox_collapse;
-
- hbox_expand = g_object_get_data ( G_OBJECT ( togglebutton ), "hbox_expand" );
- hbox_collapse = g_object_get_data ( G_OBJECT ( togglebutton ), "hbox_collapse" );
-
- if ( gtk_toggle_button_get_active ( togglebutton ) )
- {
- gtk_widget_hide ( hbox_expand );
- gtk_widget_show ( hbox_collapse );
- gtk_tree_view_expand_all ( GTK_TREE_VIEW ( tree_view ) );
- }
- else
- {
- gtk_widget_show ( hbox_expand );
- gtk_widget_hide ( hbox_collapse );
- gtk_tree_view_collapse_all ( GTK_TREE_VIEW ( tree_view ) );
- }
-}
-
-
-/**
- *
- *
- *
- */
-GtkWidget *gsb_etats_config_togglebutton_set_button_expand ( gchar *sw_name,
- GtkWidget *tree_view )
-{
- GtkWidget *button;
- gchar *tmp_str;
-
- tmp_str = g_strconcat ( "togglebutton_expand", sw_name + 2, NULL );
- button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL );
- g_free ( tmp_str );
-
- tmp_str = g_strconcat ( "hbox_toggle_expand", sw_name + 2, NULL );
- g_object_set_data ( G_OBJECT ( button ), "hbox_expand",
- utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL ) );
- g_free ( tmp_str );
-
- tmp_str = g_strconcat ( "hbox_toggle_collapse", sw_name + 2, NULL );
- g_object_set_data ( G_OBJECT ( button ), "hbox_collapse",
- utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL ) );
- g_signal_connect ( G_OBJECT ( button ),
- "clicked",
- G_CALLBACK ( gsb_etats_config_togglebutton_collapse_expand_lines ),
- tree_view );
-
- return button;
-}
-
-
-/**
- *
- *
- *
- */
-void gsb_etats_config_onglet_set_buttons_select_categ_budget ( gchar *sw_name,
- GtkWidget *tree_view,
- gboolean is_categ )
-{
- GtkWidget *button;
- gchar *tmp_str;
-
- tmp_str = g_strconcat ( "button_income", sw_name + 2, NULL );
- button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL );
- g_object_set_data ( G_OBJECT ( button ), "is_categ", GINT_TO_POINTER ( is_categ ) );
- g_object_set_data ( G_OBJECT ( button ), "type_div", GINT_TO_POINTER ( FALSE ) );
- g_signal_connect ( G_OBJECT ( button ),
- "button-press-event",
- G_CALLBACK ( gsb_etats_config_onglet_select_partie_liste_categ_budget ),
- tree_view );
- g_free ( tmp_str );
-
- tmp_str = g_strconcat ( "button_outgoing", sw_name + 2, NULL );
- button = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, tmp_str, NULL );
- g_object_set_data ( G_OBJECT ( button ), "is_categ", GINT_TO_POINTER ( is_categ ) );
- g_object_set_data ( G_OBJECT ( button ), "type_div", GINT_TO_POINTER ( TRUE ) );
- g_signal_connect ( G_OBJECT ( button ),
- "button-press-event",
- G_CALLBACK ( gsb_etats_config_onglet_select_partie_liste_categ_budget ),
- tree_view );
- g_free ( tmp_str );
-}
-
-
-/**
- *
- *
- *
- */
-gboolean gsb_etats_config_onglet_select_partie_liste_categ_budget ( GtkWidget *button,
+gboolean gsb_etats_config_onglet_categ_budget_select_partie_liste ( GtkWidget *button,
GdkEventButton *event,
GtkWidget *tree_view )
{
@@ -1225,7 +1141,7 @@ gboolean gsb_etats_config_onglet_select_partie_liste_categ_budget ( GtkWidget *b
if ( !gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &iter ) )
return FALSE;
- gsb_etats_config_tree_model_check_uncheck_all ( model, FALSE );
+ gsb_etats_config_onglet_categ_budget_tree_model_check_uncheck_all ( model, FALSE );
is_categ = GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( button ), "is_categ" ) );
type_div = GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( button ), "type_div" ) );
@@ -1275,14 +1191,14 @@ gboolean gsb_etats_config_onglet_select_partie_liste_categ_budget ( GtkWidget *b
/**
* fill the categories selection list for report
*
- * \param is_categ TRUE for category, FALSE for budget
+ * \param model
+ * \param is_categ TRUE for category, FALSE for budget
*
* \return FALSE
* */
-gboolean gsb_etats_config_fill_liste_categ_budget ( gboolean is_categ )
+gboolean gsb_etats_config_onglet_categ_budget_fill_model ( GtkTreeModel *model,
+ gboolean is_categ )
{
- GtkWidget *tree_view;
- GtkTreeModel *model;
GtkTreeIter parent_iter;
GtkTreeIter child_iter;
GSList *list_tmp;
@@ -1294,9 +1210,6 @@ gboolean gsb_etats_config_fill_liste_categ_budget ( gboolean is_categ )
{
list_tmp = gsb_data_category_get_categories_list ( );
- tree_view = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "sw_categ", "tree_view" );
- model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
-
gtk_tree_store_clear ( GTK_TREE_STORE ( model ) );
without_name = _("No category");
@@ -1305,9 +1218,6 @@ gboolean gsb_etats_config_fill_liste_categ_budget ( gboolean is_categ )
else
{
list_tmp = gsb_data_budget_get_budgets_list ( );
- tree_view = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "sw_budget", "tree_view" );
- model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
-
gtk_tree_store_clear ( GTK_TREE_STORE ( model ) );
without_name = _("No budgetary line");
@@ -1417,70 +1327,405 @@ gboolean gsb_etats_config_fill_liste_categ_budget ( gboolean is_categ )
*
*
*/
-GtkWidget *gsb_etats_config_onglet_etat_ib ( void )
+gint gsb_etats_config_onglet_categ_budget_sort_function ( GtkTreeModel *model,
+ GtkTreeIter *iter_1,
+ GtkTreeIter *iter_2,
+ gpointer ptr )
{
- GtkWidget *vbox_onglet;
- GtkWidget *vbox;
- GtkWidget *sw;
- GtkWidget *tree_view;
- GtkWidget *button;
-
- devel_debug (NULL);
+ gchar *name_1;
+ gchar *name_2;
+ gchar *without_name;
+ gchar *without_sub_name;
+ gint number_1;
+ gint number_2;
+ gint sub_number_1;
+ gint sub_number_2;
+ gint return_value = 0;
+ gboolean is_categ;
- vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_ib" ) );
+ is_categ = GPOINTER_TO_INT ( ptr );
- vbox = new_vbox_with_title_and_icon ( _("Budgetary lines"), "budgetary_lines.png" );
+ if ( is_categ )
+ {
+ without_name = _("No category");
+ without_sub_name = _("No subcategory");
+ }
+ else
+ {
+ without_name = _("No budgetary line");
+ without_sub_name = _("No sub-budgetary line");
+ }
- gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
- gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
+ /* first, we sort by date (col 0) */
+ gtk_tree_model_get ( model,
+ iter_1,
+ GSB_ETAT_CATEG_BUDGET_LIST_NAME, &name_1,
+ GSB_ETAT_CATEG_BUDGET_LIST_NUMBER, &number_1,
+ GSB_ETAT_CATEG_BUDGET_LIST_SUB_NUMBER, &sub_number_1,
+ -1 );
- gtk_widget_set_sensitive ( utils_gtkbuilder_get_widget_by_name (etat_config_builder,
- "vbox_detaille_budget_etat", NULL ), FALSE );
+ gtk_tree_model_get ( model,
+ iter_2,
+ GSB_ETAT_CATEG_BUDGET_LIST_NAME, &name_2,
+ GSB_ETAT_CATEG_BUDGET_LIST_NUMBER, &number_2,
+ GSB_ETAT_CATEG_BUDGET_LIST_SUB_NUMBER, &sub_number_2,
+ -1 );
- /* on crée la liste des IB et on récupère le tree_view*/
- sw = gsb_etats_config_get_liste_categ_budget ( "sw_budget" );
- tree_view = utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "sw_budget", "tree_view" );
- /* on remplit la liste des IB */
- gsb_etats_config_fill_liste_categ_budget ( FALSE );
+ if ( number_1 != -1 && number_2 != -1 && number_1 - number_2 )
+ {
+ if ( number_1 == 0 )
+ return_value = -1;
+ else if ( number_2 == 0 )
+ return_value = 1;
+ else
+ return_value = strcmp ( g_utf8_collate_key ( name_1, -1 ),
+ g_utf8_collate_key ( name_2, -1 ) );
- /* on met la connection pour rendre sensitif la hbox_detaille_budget_etat */
- g_signal_connect ( G_OBJECT ( utils_gtkbuilder_get_widget_by_name (etat_config_builder,
- "bouton_detaille_budget_etat", NULL ) ),
- "toggled",
- G_CALLBACK ( sens_desensitive_pointeur ),
- utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "vbox_detaille_budget_etat", NULL ) );
+ if ( name_1) g_free ( name_1);
+ if ( name_2) g_free ( name_2);
+ }
- /* on met la connection pour déplier replier les IB */
- button = gsb_etats_config_togglebutton_set_button_expand ( "sw_budget", tree_view );
+ if ( return_value )
+ return return_value;
- /* on met la connection pour sélectionner toutes les IB */
-/* button = gsb_etats_config_togglebutton_set_button_select ( "sw_budget", tree_view ); */
+ if ( sub_number_1 == 0 )
+ return_value = -1;
+ else if ( sub_number_2 == 0 )
+ return_value = 1;
+ else
+ return_value = strcmp ( g_utf8_collate_key ( name_1, -1 ),
+ g_utf8_collate_key ( name_2, -1 ) );
- /* on met la connection pour sélectionner une partie des IB */
- gsb_etats_config_onglet_set_buttons_select_categ_budget ( "sw_budget", tree_view, FALSE );
+ if ( name_1) g_free ( name_1);
+ if ( name_2) g_free ( name_2);
- return vbox_onglet;
+ return return_value;
}
/**
+ * get all the selected categ and sub-categ and place them in a list of struct_categ_budget_sel
+ * to be saved in the report
*
+ * \param is_categ TRUE for categ, FALSE for budget
*
- *
- */
-GtkWidget *gsb_etats_config_onglet_etat_texte ( void )
+ * \return a GSList of struct_categ_budget_sel or NULL if all the categories/sub-categ were selected
+ * to avoid to filter by categ, to improve speed
+ * */
+GSList *gsb_etats_config_onglet_categ_budget_get_selected ( const gchar *treeview_name )
{
- GtkWidget *vbox_onglet;
- GtkWidget *vbox;
- GtkWidget *sw;
- GtkWidget *lignes;
+ GtkWidget *tree_view;
+ GtkTreeModel *model;
+ GtkTreeIter parent_iter;
+ gboolean all_selected = TRUE;
+ GSList *tmp_list = NULL;
- devel_debug (NULL);
+ /* on récupère le modèle */
+ tree_view = etats_config_ui_widget_get_widget_by_name ( treeview_name, NULL );
+ model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
- vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_texte" ) );
+ if ( !gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &parent_iter ) )
+ return NULL;
+
+ do
+ {
+ gint div_number;
+ gboolean active;
+ struct_categ_budget_sel *categ_budget_struct;
+ GtkTreeIter iter_children;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (model),
+ &parent_iter,
+ GSB_ETAT_CATEG_BUDGET_LIST_NUMBER, &div_number,
+ GSB_ETAT_CATEG_BUDGET_LIST_ACTIVE, &active,
+ -1 );
+ if (!active)
+ {
+ all_selected = FALSE;
+ continue;
+ }
+
+ /* ok, we are on a selected category/budget, create and fill the structure */
+ categ_budget_struct = g_malloc0 ( sizeof ( struct_categ_budget_sel ) );
+
+ categ_budget_struct -> div_number = div_number;
+ tmp_list = g_slist_append ( tmp_list, categ_budget_struct );
+
+ /* check the children */
+ if (gtk_tree_model_iter_children ( GTK_TREE_MODEL (model), &iter_children, &parent_iter))
+ {
+ /* we are on the children */
+ do
+ {
+ gint sub_div_number;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (model),
+ &iter_children,
+ GSB_ETAT_CATEG_BUDGET_LIST_SUB_NUMBER, &sub_div_number,
+ GSB_ETAT_CATEG_BUDGET_LIST_ACTIVE, &active,
+ -1 );
+ if (active)
+ categ_budget_struct -> sub_div_numbers = g_slist_append (
+ categ_budget_struct -> sub_div_numbers,
+ GINT_TO_POINTER ( sub_div_number ) );
+ else
+ all_selected = FALSE;
+ }
+ while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter_children ) );
+ }
+ }
+ while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &parent_iter ) );
+
+ /* if all is selected, erase the new list and set an info message */
+ if ( all_selected )
+ {
+ if ( strcmp ( treeview_name, "treeview_categ" ) == 0 )
+ dialogue_special ( GTK_MESSAGE_INFO,
+ make_hint ( _("Performance issue."),
+ _("All categories have been selected. Grisbi will run faster without "
+ "the \"Detail categories used\" option activated.") ) );
+ else
+ dialogue_special ( GTK_MESSAGE_INFO,
+ make_hint ( _("Performance issue."),
+ _("All budgets have been selected. Grisbi will run faster without the "
+ "\"Detail budgets used\" option activated.") ) );
+
+ gsb_etats_config_onglet_categ_budget_tree_model_check_uncheck_all ( model, FALSE );
+ gsb_data_report_free_categ_budget_struct_list ( tmp_list );
+
+ tmp_list = NULL;
+ }
+ return tmp_list;
+}
+
+
+/**
+ * toggle the categories and sub-categories selected
+ *
+ * \param is_categ TRUE for categ, FALSE for budgets
+ *
+ * \return
+ * */
+void gsb_etats_config_onglet_categ_budget_init_treeview ( const gchar *treeview_name,
+ GSList *tmp_list )
+{
+ GtkWidget *tree_view;
+ GtkTreeModel *model;
+ GtkTreeIter parent_iter;
+
+ /* on récupère le modèle */
+ tree_view = etats_config_ui_widget_get_widget_by_name ( treeview_name, NULL );
+ model = gtk_tree_view_get_model ( GTK_TREE_VIEW ( tree_view ) );
+
+ gsb_etats_config_onglet_categ_budget_tree_model_check_uncheck_all ( model, FALSE );
+
+ if ( !gtk_tree_model_get_iter_first ( GTK_TREE_MODEL ( model ), &parent_iter ) )
+ return;
+
+ while ( tmp_list )
+ {
+ struct_categ_budget_sel *categ_budget_struct = tmp_list -> data;
+
+ do
+ {
+ gint div_number;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ),
+ &parent_iter,
+ GSB_ETAT_CATEG_BUDGET_LIST_NUMBER, &div_number,
+ -1 );
+
+ /* we check the children only if the category is selected */
+ if ( div_number == categ_budget_struct -> div_number )
+ {
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+ &parent_iter,
+ GSB_ETAT_CATEG_BUDGET_LIST_ACTIVE, TRUE,
+ -1 );
+
+ if ( categ_budget_struct -> sub_div_numbers )
+ {
+ GtkTreeIter iter_child;
+
+ if ( gtk_tree_model_iter_children ( GTK_TREE_MODEL ( model ), &iter_child, &parent_iter ) )
+ {
+ do
+ {
+ gint sub_div_number;
+
+ gtk_tree_model_get ( GTK_TREE_MODEL ( model ),
+ &iter_child,
+ GSB_ETAT_CATEG_BUDGET_LIST_SUB_NUMBER, &sub_div_number,
+ -1 );
+
+ if ( g_slist_find ( categ_budget_struct -> sub_div_numbers,
+ GINT_TO_POINTER ( sub_div_number ) ) )
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+ &iter_child,
+ GSB_ETAT_CATEG_BUDGET_LIST_ACTIVE, TRUE,
+ -1 );
+ }
+ while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &iter_child ) );
+ }
+ }
+ /* we have found the category, can stop here */
+ break;
+ }
+ }
+ while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &parent_iter ) );
+
+ tmp_list = tmp_list -> next;
+ }
+}
+
+
+/*ONGLET_MODE_PAIEMENT*/
+/**
+ * Initialise les informations de l'onglet modes de paiement
+ *
+ * \param report_number
+ *
+ * \return
+ */
+void gsb_etats_config_initialise_onglet_mode_paiement ( gint report_number )
+{
+ gint active;
+
+ active = gsb_data_report_get_method_of_payment_used ( report_number );
+ etats_config_ui_widget_set_actif ( "bouton_detaille_mode_paiement_etat", active );
+
+ if ( active )
+ {
+ etats_config_ui_onglet_mode_paiement_select_rows_from_list (
+ gsb_data_report_get_method_of_payment_list ( report_number ),
+ "treeview_mode_paiement" );
+
+ if ( g_slist_length ( gsb_data_report_get_method_of_payment_list ( report_number ) ) )
+ utils_togglebutton_set_label_position_unselect (
+ etats_config_ui_widget_get_widget_by_name (
+ "togglebutton_select_all_mode_paiement", NULL ),
+ NULL,
+ etats_config_ui_widget_get_widget_by_name ( "treeview_mode_paiement", NULL ) );
+ }
+}
- vbox = new_vbox_with_title_and_icon ( _("Transaction content"), "text.png" );
+
+/**
+ * Récupère les informations de l'onglet mode de paiement
+ *
+ * \param numéro d'état à mettre à jour
+ *
+ * \return
+ */
+void gsb_etats_config_recupere_info_onglet_mode_paiement ( gint report_number )
+{
+ gint active;
+
+ active = etats_config_ui_widget_get_actif ( "bouton_detaille_mode_paiement_etat" );
+ gsb_data_report_set_method_of_payment_used ( report_number, active );
+ if ( active )
+ {
+ gsb_data_report_free_method_of_payment_list ( report_number );
+
+ if ( utils_tree_view_all_rows_are_selected ( GTK_TREE_VIEW (
+ etats_config_ui_widget_get_widget_by_name ( "treeview_mode_paiement", NULL ) ) ) )
+ {
+ gchar *text;
+ gchar *hint;
+
+ hint = g_strdup ( _("Performance issue.") );
+ text = g_strdup ( _("All methods of payment have been selected. Grisbi will run "
+ "faster without the \"Detail methods of payment used\" option activated.") );
+
+ dialogue_special ( GTK_MESSAGE_INFO, make_hint ( hint, text ) );
+ etats_config_ui_widget_set_actif ( "togglebutton_select_all_mode_paiement", FALSE );
+ gsb_data_report_set_method_of_payment_used ( report_number, 0 );
+
+ g_free ( text );
+ g_free ( hint );
+ }
+ else
+ gsb_data_report_set_method_of_payment_list ( report_number,
+ etats_config_ui_onglet_mode_paiement_get_list_rows_selected (
+ "treeview_mode_paiement" ) );
+
+ }
+ /* return */
+}
+
+
+/**
+ *
+ *
+ *
+ */
+GtkTreeModel *gsb_etats_config_onglet_mode_paiement_get_model ( void )
+{
+ GtkListStore *list_store;
+ GSList *liste_nom_types = NULL;
+ GSList *list_tmp;
+
+ list_store = gtk_list_store_new ( 2, G_TYPE_STRING, G_TYPE_INT );
+
+ gtk_tree_sortable_set_sort_column_id ( GTK_TREE_SORTABLE ( list_store ),
+ 0, GTK_SORT_ASCENDING );
+
+ /* create a list of unique names */
+ list_tmp = gsb_data_payment_get_payments_list ( );
+
+ while ( list_tmp )
+ {
+ GtkTreeIter iter;
+ gchar *name;
+ gint payment_number;
+
+ payment_number = gsb_data_payment_get_number (list_tmp -> data);
+ name = my_strdup ( gsb_data_payment_get_name ( payment_number ) );
+
+ if ( !g_slist_find_custom ( liste_nom_types,
+ name,
+ ( GCompareFunc ) cherche_string_equivalente_dans_slist ) )
+ {
+ liste_nom_types = g_slist_append ( liste_nom_types, name );
+ gtk_list_store_append ( list_store, &iter );
+ gtk_list_store_set ( list_store, &iter, 0, name, 1, payment_number, -1 );
+ }
+ else
+ g_free ( name );
+
+ list_tmp = list_tmp -> next;
+ }
+
+ /* on libère la mémoire utilisée par liste_nom_types */
+ g_slist_foreach ( liste_nom_types, ( GFunc ) g_free, NULL );
+ g_slist_free ( liste_nom_types );
+
+ /* return */
+ return GTK_TREE_MODEL ( list_store );
+}
+
+
+
+/*OLD_FUNCTIONS*/
+
+/**
+ *
+ *
+ *
+ */
+GtkWidget *gsb_etats_config_onglet_etat_texte ( void )
+{
+ GtkWidget *vbox_onglet;
+ GtkWidget *vbox;
+ GtkWidget *sw;
+ GtkWidget *lignes;
+
+ devel_debug (NULL);
+
+ vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_texte" ) );
+
+ vbox = new_vbox_with_title_and_icon ( _("Transaction content"), "text.png" );
gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
@@ -1794,98 +2039,6 @@ GtkWidget *gsb_etats_config_onglet_etat_montant ( void )
*
*
*/
-GtkWidget *gsb_etats_config_onglet_etat_mode_paiement ( void )
-{
- GtkWidget *vbox_onglet;
- GtkWidget *vbox;
- GtkWidget *sw;
-
- devel_debug (NULL);
-
- vbox_onglet = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, "onglet_etat_mode_paiement" ) );
-
- vbox = new_vbox_with_title_and_icon ( _("Payment methods"), "payment.png" );
-
- gtk_box_pack_start ( GTK_BOX ( vbox_onglet ), vbox, FALSE, FALSE, 0 );
- gtk_box_reorder_child ( GTK_BOX ( vbox_onglet ), vbox, 0 );
-
- gtk_widget_set_sensitive ( utils_gtkbuilder_get_widget_by_name ( etat_config_builder,
- "vbox_mode_paiement_etat", NULL ), FALSE );
-
- /* on crée la liste des catégories */
- sw = gsb_etats_config_get_liste_mode_paiement ( "sw_mode_paiement" );
-
- /* on met la connection pour rendre sensitif la vbox_generale_comptes_etat */
- g_signal_connect ( G_OBJECT ( utils_gtkbuilder_get_widget_by_name ( etat_config_builder,
- "bouton_detaille_mode_paiement_etat", NULL ) ),
- "toggled",
- G_CALLBACK ( sens_desensitive_pointeur ),
- utils_gtkbuilder_get_widget_by_name ( etat_config_builder, "vbox_mode_paiement_etat", NULL ) );
-
- return vbox_onglet;
-}
-
-
-/**
- *
- *
- *
- */
-GtkWidget *gsb_etats_config_get_liste_mode_paiement ( gchar *sw_name )
-{
- GtkWidget *sw;
- GtkListStore *list_store;
- GSList *liste_nom_types = NULL;
- GSList *list_tmp;
-
- list_store = gtk_list_store_new ( 2, G_TYPE_STRING, G_TYPE_INT );
-
- gtk_tree_sortable_set_sort_column_id ( GTK_TREE_SORTABLE ( list_store ),
- 0, GTK_SORT_ASCENDING );
-
- /* create a list of unique names */
- list_tmp = gsb_data_payment_get_payments_list ( );
-
- while (list_tmp)
- {
- GtkTreeIter iter;
- gchar *name;
- gint payment_number;
-
- payment_number = gsb_data_payment_get_number (list_tmp -> data);
- name = my_strdup ( gsb_data_payment_get_name ( payment_number ) );
-
- if ( !g_slist_find_custom ( liste_nom_types,
- name,
- ( GCompareFunc ) cherche_string_equivalente_dans_slist ) )
- {
- liste_nom_types = g_slist_append ( liste_nom_types, name );
- gtk_list_store_append ( list_store, &iter );
- gtk_list_store_set ( list_store, &iter, 0, name, 1, payment_number, -1 );
- }
- else
- g_free ( name );
-
- list_tmp = list_tmp -> next;
- }
-
- /* on libère la mémoire utilisée par liste_nom_types */
- g_slist_foreach ( liste_nom_types, ( GFunc ) g_free, NULL );
- g_slist_free ( liste_nom_types );
-
- sw = gsb_etats_config_get_scrolled_window_with_tree_view ( sw_name, GTK_TREE_MODEL ( list_store ) );
-
- gtk_widget_show_all ( sw );
-
- return sw;
-}
-
-
-/**
- *
- *
- *
- */
GtkWidget *gsb_etats_config_onglet_etat_divers ( void )
{
GtkWidget *vbox_onglet;
@@ -2057,131 +2210,6 @@ GtkWidget *gsb_etats_config_affichage_etat_devises ( void )
}
-/**
- *
- *
- *
- */
-gint gsb_etats_config_categ_budget_sort_function ( GtkTreeModel *model,
- GtkTreeIter *iter_1,
- GtkTreeIter *iter_2,
- gchar *sw_name )
-{
- gchar *name_1;
- gchar *name_2;
- gchar *without_name;
- gchar *without_sub_name;
- gint number_1;
- gint number_2;
- gint sub_number_1;
- gint sub_number_2;
- gint return_value = 0;
-
- if ( strcmp ( sw_name, "sw_categ" ) == 0 )
- {
- without_name = _("No category");
- without_sub_name = _("No subcategory");
- }
- else
- {
- without_name = _("No budgetary line");
- without_sub_name = _("No sub-budgetary line");
- }
-
- /* first, we sort by date (col 0) */
- gtk_tree_model_get ( model,
- iter_1,
- GSB_ETAT_CATEG_BUDGET_LIST_NAME, &name_1,
- GSB_ETAT_CATEG_BUDGET_LIST_NUMBER, &number_1,
- GSB_ETAT_CATEG_BUDGET_LIST_SUB_NUMBER, &sub_number_1,
- -1 );
-
- gtk_tree_model_get ( model,
- iter_2,
- GSB_ETAT_CATEG_BUDGET_LIST_NAME, &name_2,
- GSB_ETAT_CATEG_BUDGET_LIST_NUMBER, &number_2,
- GSB_ETAT_CATEG_BUDGET_LIST_SUB_NUMBER, &sub_number_2,
- -1 );
-
-
- if ( number_1 != -1 && number_2 != -1 && number_1 - number_2 )
- {
- if ( number_1 == 0 )
- return_value = -1;
- else if ( number_2 == 0 )
- return_value = 1;
- else
- return_value = strcmp ( g_utf8_collate_key ( name_1, -1 ),
- g_utf8_collate_key ( name_2, -1 ) );
-
- if ( name_1) g_free ( name_1);
- if ( name_2) g_free ( name_2);
- }
-
- if ( return_value )
- return return_value;
-
- if ( sub_number_1 == 0 )
- return_value = -1;
- else if ( sub_number_2 == 0 )
- return_value = 1;
- else
- return_value = strcmp ( g_utf8_collate_key ( name_1, -1 ),
- g_utf8_collate_key ( name_2, -1 ) );
-
- if ( name_1) g_free ( name_1);
- if ( name_2) g_free ( name_2);
-
- return return_value;
-}
-
-
-/**
- *
- *
- *
- */
-GtkWidget *gsb_etats_config_get_scrolled_window_with_tree_view ( gchar *sw_name,
- GtkTreeModel *model )
-{
- GtkWidget *sw;
- GtkWidget *tree_view;
- GtkCellRenderer *cell;
- GtkTreeViewColumn *column;
-
-/* devel_debug (sw_name); */
-
- tree_view = gtk_tree_view_new_with_model ( GTK h_tree_view ( gchar *sw_name, EL ( list_store ) ); t", NULL ) ); + @<ÿ °<ÿ uzá7+ â7+ 8+ þ8+ °<ÿ 9+ <ÿ p<ÿ ká7+ 6 è è! è! @<ÿ °<ÿ xDþ8+ <ÿ rá7+ á7+ @<ÿ `rá7+ <ÿ À?b9+ uzá7+ 0b9+ Ø4b9+ ¨9b9+ â7+ xDþ8+ <ÿ p<ÿ ká7+ à! à! @<ÿ °<ÿ HÞ8+ <ÿ rá7+ á7+ @<ÿ `rá7+ <ÿ p<ÿ h<ÿ 88+ p °<ÿ uzá7+ â7+ <ÿ P<ÿ ká7+ G H I J K M N O P @<ÿ °<ÿ HÅ´8+ <ÿ rá7+ á7+ @<ÿ 0?b9+ uzá7+ Pþ8+ ù8+ 0b9+ Ø4b9+ ¨9b9+ â7+ HÅ´8+ <ÿ
`<ÿ ká7+ 8Å´8+ <ÿ <ÿ ká7+ (Å´8+ <ÿ À<ÿ ká7+ Å´8+ <ÿ ð<ÿ ká7+ ¨>b9+ uzá7+ ¨9b9+ p<ÿ H8+ eyá7+ Ø4b9+ <ÿ yH8+ eyá7+ 0b9+ À<ÿ ZH8+ eyá7+ Øô8+ Pþ8+ ù8+ 0b9+ ØTþ8+ Ø4b9+ ¨9b9+ â7+ 88+ ½]8+ °<ÿ p8+ p<ÿ @<ÿ ká7+ 5 6 7 8 : < = > ? @ B D @<ÿ °<ÿ à½Z8+ °<ÿ uzá7+ 8+ ð<ÿ ½]8+ eyá7+ 8+ Õ_ at fÆS Qöl±íÁÓ)8+ °<ÿ à½Z8+ <ÿ P<ÿ ká7+ u]ÞÓ 4Q ÷U^Qʧ ¶uª¹ñìò*Äv@<ÿ °<ÿ H'8+ Tc8+ ð<ÿ ¦`Å9+ ¦`Å9+ ¦`8+ <ÿ °<ÿ h<ÿ Ð<ÿ _þ8+ uzá7+ ØTþ8+ 0<ÿ ¢`Å9+ <ÿ <
ÿ ÿÿÿÿÿÿÿÿ¢`Å9+ ¸<ÿ _TREE_MODEL ( model ) );
- gtk_tree_view_set_headers_visible ( GTK_TREE_VIEW ( tree_view ), FALSE );
- utils_set_tree_view_selection_and_text_color ( tree_view );
-
- gtk_tree_selection_set_mode (
- gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) ),
- GTK_SELECTION_MULTIPLE );
- g_object_unref ( G_OBJECT ( model ) );
-
- /* 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_append_column ( GTK_TREE_VIEW ( tree_view ),
- GTK_TREE_VIEW_COLUMN ( column ) );
- gtk_tree_view_column_set_resizable ( column, TRUE );
-
- /* get the container */
- sw = GTK_WIDGET ( gtk_builder_get_object ( etat_config_builder, sw_name ) );
- gtk_container_add ( GTK_CONTAINER ( sw ), tree_view );
-
- g_object_set_data ( G_OBJECT ( sw ), "tree_view", tree_view );
-
- gtk_widget_show_all ( sw );
-
- return sw;
-}
-
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/gsb_etats_config.h b/src/gsb_etats_config.h
index 55c0a34..d659804 100644
--- a/src/gsb_etats_config.h
+++ b/src/gsb_etats_config.h
@@ -6,15 +6,25 @@
/* START_DECLARATION */
void gsb_etats_config_personnalisation_etat ( void );
+
+GtkTreeModel *gsb_etats_config_onglet_categ_budget_get_model ( gboolean is_categ );
+gboolean gsb_etats_config_onglet_categ_budget_select_partie_liste ( GtkWidget *button,
+ GdkEventButton *event,
+ GtkWidget *tree_view );
+gboolean gsb_etats_config_onglet_categ_budget_toggled ( GtkCellRendererToggle *radio_renderer,
+ gchar *path_str,
+ GtkTreeStore *store );
+void gsb_etats_config_onglet_categ_budget_tree_model_check_uncheck_all ( GtkTreeModel *model,
+ gboolean toggle_value );
+
GtkTreeModel *gsb_etats_config_onglet_get_liste_comptes ( void );
GtkTreeModel *gsb_etats_config_onglet_get_liste_exercices ( void );
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 );
-void gsb_etats_config_tree_model_check_uncheck_all ( GtkTreeModel *model,
- gboolean toggle_value );
/* END_DECLARATION */
diff --git a/src/ui/etats_config.ui b/src/ui/etats_config.ui
index 5691bd8..1131af4 100644
--- a/src/ui/etats_config.ui
+++ b/src/ui/etats_config.ui
@@ -58,6 +58,11 @@
<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>
@@ -71,8 +76,7 @@
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Report properties</property>
- <property name="modal">True</property>
- <property name="window_position">mouse</property>
+ <property name="window_position">center</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
@@ -192,6 +196,26 @@
<action-widget response="-5">button_OK</action-widget>
</action-widgets>
</object>
+ <object class="GtkImage" id="image_tiers_dernier">
+ <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>
+ </object>
<object class="GtkVBox" id="liste_montant_etat">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -247,7 +271,7 @@
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
- <object class="GtkCheckButton" id="button_detail_categ_etat">
+ <object class="GtkCheckButton" id="bouton_detaille_categ_etat">
<property name="label" translatable="yes">Detail categories</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -294,7 +318,10 @@
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
- <placeholder/>
+ <object class="GtkTreeView" id="treeview_categ">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
</child>
</object>
<packing>
@@ -310,78 +337,14 @@
<property name="homogeneous">True</property>
<child>
<object class="GtkToggleButton" id="togglebutton_select_all_categ">
+ <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.05000000074505806</property>
- <property name="yalign">0</property>
<property name="draw_indicator">True</property>
- <child>
- <object class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <object class="GtkVBox" id="vbox8">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkHBox" id="hbox_toggle_select_all_categ">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Select all</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox_toggle_unselect_all_categ">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <child>
- <object class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Unselect all</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -398,6 +361,7 @@
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="relief">none</property>
+ <property name="focus_on_click">False</property>
<property name="xalign">0.05000000074505806</property>
</object>
<packing>
@@ -415,6 +379,7 @@
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="relief">none</property>
+ <property name="focus_on_click">False</property>
<property name="xalign">0.05000000074505806</property>
</object>
<packing>
@@ -803,7 +768,10 @@
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
- <placeholder/>
+ <object class="GtkTreeView" id="treeview_budget">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
</child>
</object>
<packing>
@@ -819,78 +787,14 @@
<property name="homogeneous">True</property>
<child>
<object class="GtkToggleButton" id="togglebutton_select_all_budget">
+ <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.05000000074505806</property>
- <property name="yalign">0</property>
<property name="draw_indicator">True</property>
- <child>
- <object class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <object class="GtkVBox" id="vbox11">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkHBox" id="hbox_toggle_select_all_budget">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Select all</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox_toggle_unselect_all_budget">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <child>
- <object class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Unselect all</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -1113,7 +1017,10 @@
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
- <placeholder/>
+ <object class="GtkTreeView" id="treeview_mode_paiement">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
</child>
</object>
<packing>
@@ -1126,16 +1033,16 @@
<object class="GtkVBox" id="vbox14">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="homogeneous">True</property>
<child>
- <object class="GtkButton" id="button1_mode_paiement">
+ <object class="GtkToggleButton" id="togglebutton_select_all_mode_paiement">
<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.019999999552965164</property>
+ <property name="xalign">0.05000000074505806</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1144,27 +1051,11 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="button2_mode_paiement">
- <property name="label" translatable="yes">Unselect 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.029999999329447746</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">10</property>
- <property name="position">1</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
@@ -1741,6 +1632,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
@@ -1768,14 +1660,123 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox3">
+ <object class="GtkVBox" id="vbox8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0.05000000074505806</property>
+ <property name="label" translatable="yes">Navigation</property>
+ </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="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkButton" id="button_tiers_premier">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">10</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_tiers_precedent">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">10</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_tiers_suivant">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">10</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_tiers_dernier">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">10</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </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="padding">10</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label18">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Search : </property>
+ <property name="tooltip_text" translatable="yes"><Ctrl> + left click of mouse to add to the selection</property>
+ <property name="xalign">0.05000000074505806</property>
+ <property name="label" translatable="yes">Search</property>
</object>
<packing>
<property name="expand">True</property>
@@ -1802,11 +1803,29 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label_tiers_search_help">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0.05000000074505806</property>
+ <property name="label" translatable="yes"><Ctrl> + left click of mouse
+to add at the selection</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="foreground" value="#2def22609c95"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -2082,6 +2101,16 @@
<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