[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-144-g55fc022
Pierre Biava
nobody at users.sourceforge.net
Sat Apr 23 11:39:41 CEST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".
The branch, master has been updated
via 55fc0225903133919437c1e476801c88d945fe73 (commit)
via 7e818164be11935039b9344e15706cd09a1c9d45 (commit)
from c4a6d9a81dd14376ad8ecf7692430d48c59d439f (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 55fc0225903133919437c1e476801c88d945fe73
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Apr 23 11:31:47 2011 +0200
Deletion of global variables in barre_outils.c
commit 7e818164be11935039b9344e15706cd09a1c9d45
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Apr 23 09:14:44 2011 +0200
Improved management of toolbars by Philippe Delorme.
Deletion of global variables of payees toolbar.
-----------------------------------------------------------------------
Changes:
diff --git a/src/affichage.c b/src/affichage.c
index d258196..c907b74 100644
--- a/src/affichage.c
+++ b/src/affichage.c
@@ -697,12 +697,19 @@ gboolean update_homepage_title (GtkEntry *entry, gchar *value,
*/
gboolean change_toolbar_display_mode ( GtkRadioButton *button )
{
- if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button)) )
- {
- etat.display_toolbar = GPOINTER_TO_INT (g_object_get_data ( G_OBJECT(button), "display" ));
- }
+ /* Do not execute this callback twice,
+ * as it is triggered for both unselected button and newly selected one.
+ * We keep the call for the newly selected radio button */
+ if ( !gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( button ) ) )
+ return FALSE;
+
+ /* save the new parameter */
+ etat.display_toolbar = GPOINTER_TO_INT (g_object_get_data ( G_OBJECT(button), "display" ));
+ /* update toolbars */
gsb_gui_update_transaction_toolbar ();
+ gsb_gui_update_scheduler_toolbar ();
+ gsb_gui_update_payee_toolbar ();
return FALSE;
}
diff --git a/src/barre_outils.c b/src/barre_outils.c
index 1635363..475fb80 100644
--- a/src/barre_outils.c
+++ b/src/barre_outils.c
@@ -40,10 +40,12 @@
#include "gsb_data_import_rule.h"
#include "navigation.h"
#include "menu.h"
+#include "metatree.h"
#include "import.h"
#include "gsb_reconcile.h"
#include "gsb_scheduler_list.h"
#include "gsb_transactions_list.h"
+#include "tiers_onglet.h"
#include "traitement_variables.h"
#include "print_transactions_list.h"
#include "utils_buttons.h"
@@ -53,6 +55,8 @@
/*START_STATIC*/
static GtkWidget *creation_barre_outils ( void );
+static GtkWidget *creation_barre_outils_echeancier ( void );
+static GtkWidget *creation_barre_outils_tiers ( void );
static gboolean popup_scheduled_view_mode_menu ( GtkWidget * button );
static gboolean popup_transaction_rules_menu ( GtkWidget * button,
gpointer null );
@@ -77,8 +81,6 @@ GtkWidget *menu_import_rules;
/*START_EXTERN*/
-extern GtkWidget *barre_outils;
-extern gboolean block_menu_cb;
/*END_EXTERN*/
@@ -140,7 +142,7 @@ GtkWidget *creation_barre_outils ( void )
menu = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
GTK_STOCK_SELECT_COLOR, _("View"),
- G_CALLBACK(popup_transaction_view_mode_menu),
+ G_CALLBACK (popup_transaction_view_mode_menu),
NULL );
gtk_widget_set_tooltip_text ( GTK_WIDGET (menu),
_("Change display mode of the list"));
@@ -148,7 +150,7 @@ GtkWidget *creation_barre_outils ( void )
menu_import_rules = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
GTK_STOCK_EXECUTE, _("Import rules"),
- G_CALLBACK(popup_transaction_rules_menu),
+ G_CALLBACK (popup_transaction_rules_menu),
NULL );
gtk_widget_set_tooltip_text ( GTK_WIDGET (menu_import_rules),
_("Quick file import by rules"));
@@ -173,21 +175,23 @@ GtkWidget *creation_barre_outils ( void )
*/
void gsb_gui_update_transaction_toolbar ( void )
{
+ GtkWidget *transaction_toolbar;
GList * list = NULL;
- list = gtk_container_get_children ( GTK_CONTAINER ( barre_outils ) );
+ transaction_toolbar = gsb_transactions_list_get_toolbar ( );
+
+ list = gtk_container_get_children ( GTK_CONTAINER ( transaction_toolbar ) );
if ( list )
{
- gtk_container_remove ( GTK_CONTAINER ( barre_outils ),
- GTK_WIDGET ( list -> data ) );
- g_list_free ( list );
+ gtk_container_remove ( GTK_CONTAINER ( transaction_toolbar ),
+ GTK_WIDGET ( list -> data ) );
+ g_list_free ( list );
}
- gtk_container_add ( GTK_CONTAINER ( barre_outils ), creation_barre_outils () );
+ gtk_container_add ( GTK_CONTAINER ( transaction_toolbar ), creation_barre_outils ( ) );
}
-
/**
*
*
@@ -262,6 +266,7 @@ static gboolean popup_transaction_view_mode_menu ( GtkWidget * button,
return FALSE;
}
+
/**
*
*
@@ -319,6 +324,7 @@ gboolean popup_transaction_rules_menu ( GtkWidget * button,
gboolean change_aspect_liste ( gint demande )
{
GtkUIManager *ui_manager = gsb_menu_get_ui_manager ( );
+
switch ( demande )
{
case 0:
@@ -329,7 +335,7 @@ gboolean change_aspect_liste ( gint demande )
case 1 :
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowOneLine" ) ),
TRUE );
gsb_transactions_list_set_visible_rows_number ( demande );
@@ -338,7 +344,7 @@ gboolean change_aspect_liste ( gint demande )
break;
case 2 :
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowTwoLines" ) ),
TRUE );
gsb_transactions_list_set_visible_rows_number ( demande );
@@ -347,7 +353,7 @@ gboolean change_aspect_liste ( gint demande )
break;
case 3 :
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowThreeLines" ) ),
TRUE );
gsb_transactions_list_set_visible_rows_number ( demande );
@@ -356,7 +362,7 @@ gboolean change_aspect_liste ( gint demande )
break;
case 4 :
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowFourLines" ) ),
TRUE );
gsb_transactions_list_set_visible_rows_number ( demande );
@@ -372,12 +378,12 @@ gboolean change_aspect_liste ( gint demande )
if ( etat.modification_fichier == 0 )
modification_fichier ( TRUE );
- block_menu_cb = TRUE;
+ gsb_menu_set_block_menu_cb ( TRUE );
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowReconciled" ) ),
TRUE );
- block_menu_cb = FALSE;
+ gsb_menu_set_block_menu_cb ( FALSE );
break;
@@ -389,12 +395,12 @@ gboolean change_aspect_liste ( gint demande )
if ( etat.modification_fichier == 0 )
modification_fichier ( TRUE );
- block_menu_cb = TRUE;
+ gsb_menu_set_block_menu_cb ( TRUE );
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowReconciled" ) ),
FALSE );
- block_menu_cb = FALSE;
+ gsb_menu_set_block_menu_cb ( FALSE );
break;
case 7 :
@@ -405,12 +411,12 @@ gboolean change_aspect_liste ( gint demande )
if ( etat.modification_fichier == 0 )
modification_fichier ( TRUE );
- block_menu_cb = TRUE;
+ gsb_menu_set_block_menu_cb ( TRUE );
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowArchived" ) ),
TRUE );
- block_menu_cb = FALSE;
+ gsb_menu_set_block_menu_cb ( FALSE );
break;
@@ -422,12 +428,12 @@ gboolean change_aspect_liste ( gint demande )
if ( etat.modification_fichier == 0 )
modification_fichier ( TRUE );
- block_menu_cb = TRUE;
+ gsb_menu_set_block_menu_cb ( TRUE );
gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (
- gtk_ui_manager_get_action ( ui_manager,
+ gtk_ui_manager_get_action ( ui_manager,
"/menubar/ViewMenu/ShowArchived" ) ),
FALSE );
- block_menu_cb = FALSE;
+ gsb_menu_set_block_menu_cb ( FALSE );
break;
}
@@ -481,12 +487,9 @@ gboolean popup_scheduled_view_mode_menu ( GtkWidget * button )
*/
GtkWidget *creation_barre_outils_echeancier ( void )
{
- GtkWidget *hbox, *handlebox, *button;
+ GtkWidget *hbox, *button;
- /* HandleBox + inner hbox */
- handlebox = gtk_handle_box_new ();
hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_container_add ( GTK_CONTAINER(handlebox), hbox );
/* Common actions */
button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
@@ -542,19 +545,151 @@ GtkWidget *creation_barre_outils_echeancier ( void )
button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
GTK_STOCK_SELECT_COLOR, _("View"),
- G_CALLBACK(popup_scheduled_view_mode_menu),
+ G_CALLBACK (popup_scheduled_view_mode_menu),
NULL );
gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
_("Change display mode of scheduled transaction list"));
gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, FALSE, 0 );
- gtk_widget_show_all ( handlebox );
+ gtk_widget_show_all ( hbox );
- return ( handlebox );
+ return ( hbox );
}
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_scheduler_toolbar ( void )
+{
+ GtkWidget *scheduler_toolbar;
+ GList * list = NULL;
+
+ scheduler_toolbar = gsb_scheduler_list_get_toolbar ( );
+
+ list = gtk_container_get_children ( GTK_CONTAINER ( scheduler_toolbar ) );
+
+ if ( list )
+ {
+ gtk_container_remove ( GTK_CONTAINER ( scheduler_toolbar ),
+ GTK_WIDGET ( list -> data ) );
+ g_list_free ( list );
+ }
+ gtk_container_add ( GTK_CONTAINER ( scheduler_toolbar ), creation_barre_outils_echeancier () );
+}
+
+
+
+/**
+ * Create a button bar allowing to act on the payee list. Some of
+ * these buttons are "linked" to the selection status of the payee
+ * metatree. That is, if nothing is selected, they will become
+ * unsensitive.
+ *
+ * \return A newly-allocated widget.
+ */
+GtkWidget *creation_barre_outils_tiers ( void )
+{
+ GtkWidget *hbox, *button;
+ GtkWidget *payee_tree;
+ GtkTreeStore *payee_tree_model;
+
+ /* Hbox */
+ hbox = gtk_hbox_new ( FALSE, 0 );
+
+ /* get the tree_model and the tree_view */
+ payee_tree_model = gsb_payee_get_tree_store ( );
+ payee_tree = gsb_payee_get_tree_view ( );
+
+ /* Add various icons */
+ button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+ _("New payee"), "new-payee.png",
+ G_CALLBACK ( appui_sur_ajout_payee ),
+ payee_tree_model );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+ _("Create a new payee"));
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+ button = gsb_automem_stock_button_new ( etat.display_toolbar,
+ GTK_STOCK_DELETE, _("Delete"),
+ G_CALLBACK ( supprimer_division ),
+ payee_tree );
+ metatree_register_widget_as_linked ( GTK_TREE_MODEL ( payee_tree_model ), button, "selection" );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+ _("Delete selected payee"));
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+ button = gsb_automem_stock_button_new ( etat.display_toolbar,
+ GTK_STOCK_PROPERTIES, _("Properties"),
+ G_CALLBACK ( edit_payee ),
+ payee_tree );
+ metatree_register_widget_as_linked ( GTK_TREE_MODEL ( payee_tree_model ), button, "selection" );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+ _("Edit selected payee"));
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+ button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
+ GTK_STOCK_SELECT_COLOR,
+ _("View"),
+ G_CALLBACK ( popup_payee_view_mode_menu ),
+ NULL );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+ _("Change view mode"));
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+ button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
+ _("Manage payees"), "payeesmg.png",
+ G_CALLBACK ( appui_sur_manage_tiers ),
+ NULL );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+ _("Manage the payees"));
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+ button = gsb_automem_stock_button_new ( etat.display_toolbar,
+ GTK_STOCK_DELETE, _("Remove unused payees"),
+ G_CALLBACK ( payee_remove_unused ),
+ NULL );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( button ),
+ _("Remove orphan payees"));
+ gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
+
+ gtk_widget_show_all ( hbox );
+
+ metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL( payee_tree_model ),
+ FALSE, "selection" );
+
+ return ( hbox );
+}
+
+
+
+/**
+ *
+ *
+ *
+ */
+void gsb_gui_update_payee_toolbar ( void )
+{
+ GtkWidget *payee_toolbar;
+ GList * list = NULL;
+
+ payee_toolbar = gsb_payee_get_toolbar ( );
+
+ list = gtk_container_get_children ( GTK_CONTAINER ( payee_toolbar ) );
+
+ if ( list )
+ {
+ gtk_container_remove ( GTK_CONTAINER ( payee_toolbar ),
+ GTK_WIDGET ( list -> data ) );
+ g_list_free ( list );
+ }
+ gtk_container_add ( GTK_CONTAINER ( payee_toolbar ), creation_barre_outils_tiers () );
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
diff --git a/src/barre_outils.h b/src/barre_outils.h
index e8d2d73..79c0f57 100644
--- a/src/barre_outils.h
+++ b/src/barre_outils.h
@@ -9,7 +9,8 @@
/* START_DECLARATION */
gboolean change_aspect_liste ( gint demande );
-GtkWidget *creation_barre_outils_echeancier ( void );
+void gsb_gui_update_payee_toolbar ( void );
+void gsb_gui_update_scheduler_toolbar ( void );
void gsb_gui_update_transaction_toolbar ( void );
/* END_DECLARATION */
#endif
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index 896d6f3..ab560b0 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -150,6 +150,9 @@ gint scheduler_col_width[SCHEDULER_COL_VISIBLE_COLUMNS];
gint scheduler_current_tree_view_width = 0;
+/* toolbar */
+static GtkWidget *scheduler_toolbar;
+
static GtkSortType sort_type;
/**
@@ -190,9 +193,12 @@ GtkWidget *gsb_scheduler_list_create_list ( void )
gtk_widget_show ( vbox );
/* create the toolbar */
+ scheduler_toolbar = gtk_handle_box_new ();
+ gtk_widget_show ( scheduler_toolbar );
+ gsb_gui_update_scheduler_toolbar ();
gtk_box_pack_start ( GTK_BOX ( vbox ),
- creation_barre_outils_echeancier(),
- FALSE, FALSE, 0 );
+ scheduler_toolbar,
+ FALSE, FALSE, 0 );
/* create the scrolled window */
scrolled_window = gtk_scrolled_window_new ( NULL, NULL);
@@ -2602,6 +2608,16 @@ gboolean gsb_scheduler_list_update_white_child ( gint white_line_number,
}
+/**
+ *
+ *
+ *
+ */
+GtkWidget *gsb_scheduler_list_get_toolbar ( void )
+{
+ return scheduler_toolbar;
+}
+
/* Local Variables: */
/* c-basic-offset: 4 */
diff --git a/src/gsb_scheduler_list.h b/src/gsb_scheduler_list.h
index e10fa4a..63b79d4 100644
--- a/src/gsb_scheduler_list.h
+++ b/src/gsb_scheduler_list.h
@@ -72,6 +72,7 @@ gboolean gsb_scheduler_list_fill_list ( GtkWidget *tree_view );
gint gsb_scheduler_list_get_current_scheduled_number ( void );
GDate *gsb_scheduler_list_get_end_date_scheduled_showed ( void );
gint gsb_scheduler_list_get_last_scheduled_number ( void );
+GtkWidget *gsb_scheduler_list_get_toolbar ( void );
GtkWidget *gsb_scheduler_list_get_tree_view ( void );
void gsb_scheduler_list_init_variables ( void );
gboolean gsb_scheduler_list_redraw ( void );
diff --git a/src/gsb_transactions_list.c b/src/gsb_transactions_list.c
index 2274c24..2caec03 100644
--- a/src/gsb_transactions_list.c
+++ b/src/gsb_transactions_list.c
@@ -131,7 +131,7 @@ gint transaction_col_width[CUSTOM_MODEL_VISIBLE_COLUMNS];
gint transaction_col_align[CUSTOM_MODEL_VISIBLE_COLUMNS];
/* adr de la barre d'outils */
-GtkWidget *barre_outils;
+static GtkWidget *transaction_toolbar;
/* contient les tips et titres des colonnes des listes d'opé */
gchar *tips_col_liste_operations[CUSTOM_MODEL_VISIBLE_COLUMNS];
@@ -291,9 +291,9 @@ GtkWidget *creation_fenetre_operations ( void )
win_operations = gtk_vbox_new ( FALSE, 6 );
/* création de la barre d'outils */
- barre_outils = gtk_handle_box_new ();
+ transaction_toolbar = gtk_handle_box_new ();
gsb_gui_update_transaction_toolbar ();
- gtk_box_pack_start ( GTK_BOX ( win_operations ), barre_outils, FALSE, FALSE, 0);
+ gtk_box_pack_start ( GTK_BOX ( win_operations ), transaction_toolbar, FALSE, FALSE, 0);
/* tree_view_vbox will contain the tree_view, we will see later to set it directly */
tree_view_vbox = gtk_vbox_new ( FALSE, 0 );
@@ -3829,6 +3829,17 @@ gboolean gsb_transactions_list_set_largeur_col ( void )
}
+/**
+ *
+ *
+ *
+ */
+GtkWidget *gsb_transactions_list_get_toolbar ( void )
+{
+ return transaction_toolbar;
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/gsb_transactions_list.h b/src/gsb_transactions_list.h
index 106f507..9677f55 100644
--- a/src/gsb_transactions_list.h
+++ b/src/gsb_transactions_list.h
@@ -56,6 +56,7 @@ gboolean gsb_transactions_list_edit_transaction ( gint transaction_number );
gboolean gsb_transactions_list_edit_transaction_by_pointer ( gint *transaction_number );
gboolean gsb_transactions_list_fill_archive_store ( void );
gfloat gsb_transactions_list_get_row_align ( void );
+GtkWidget *gsb_transactions_list_get_toolbar ( void );
GtkWidget *gsb_transactions_list_get_tree_view (void);
gchar *gsb_transactions_list_grep_cell_content ( gint transaction_number,
gint cell_content_number );
diff --git a/src/menu.c b/src/menu.c
index 29973d7..264b2dd 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -81,7 +81,7 @@ extern gchar **tab_noms_derniers_fichiers_ouverts;
/*END_EXTERN*/
-gboolean block_menu_cb = FALSE;
+static gboolean block_menu_cb = FALSE;
static GtkUIManager *ui_manager;
static gint merge_id = -1;
static gint recent_files_merge_id = -1;
@@ -590,7 +590,8 @@ gboolean gsb_gui_toggle_show_form ( void )
devel_debug (NULL);
/* FIXME benj: ugly but I cannot find a way to block this ... */
- if ( block_menu_cb ) return FALSE;
+ if ( block_menu_cb )
+ return FALSE;
gsb_form_switch_expander ( );
@@ -859,6 +860,20 @@ gboolean gsb_menu_reinit_largeur_col_menu ( void )
}
+/**
+ *
+ *
+ *
+ */
+gboolean gsb_menu_set_block_menu_cb ( gboolean etat )
+{
+
+ block_menu_cb = etat;
+
+ return FALSE;
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/menu.h b/src/menu.h
index 3c78bf1..765bf75 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -28,6 +28,7 @@ void gsb_gui_toggle_line_view_mode ( GtkRadioAction *action,
gboolean gsb_gui_toggle_show_archived ( void );
gboolean gsb_gui_toggle_show_reconciled ( void );
GtkUIManager *gsb_menu_get_ui_manager ( void );
+gboolean gsb_menu_set_block_menu_cb ( gboolean etat );
gboolean gsb_menu_transaction_operations_set_sensitive ( gboolean sensitive );
gboolean gsb_menu_update_accounts_in_menus ( void );
gboolean gsb_menu_update_view_menu ( gint account_number );
diff --git a/src/parametres.c b/src/parametres.c
index a724499..51ecc5c 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -128,7 +128,6 @@ extern gint mise_a_jour_liste_comptes_accueil;
extern gchar *nom_fichier_comptes;
extern gint nb_days_before_scheduled;
extern gint nb_max_derniers_fichiers_ouverts;
-extern GtkWidget *payee_tree;
/*END_EXTERN*/
@@ -1179,6 +1178,7 @@ gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
GdkEventButton *event,
gint *pointeur )
{
+ GtkWidget *payee_tree;
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -1194,6 +1194,7 @@ gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
}
page_number = gsb_gui_navigation_get_current_page ( );
+ payee_tree = gsb_payee_get_tree_view ( );
switch ( page_number )
{
diff --git a/src/tiers_onglet.c b/src/tiers_onglet.c
index ddc3567..2acfd16 100644
--- a/src/tiers_onglet.c
+++ b/src/tiers_onglet.c
@@ -39,7 +39,7 @@
/*START_INCLUDE*/
#include "tiers_onglet.h"
-#include "metatree.h"
+#include "barre_outils.h"
#include "gsb_assistant.h"
#include "gsb_automem.h"
#include "gsb_data_form.h"
@@ -47,26 +47,23 @@
#include "gsb_data_payee.h"
#include "gsb_data_scheduled.h"
#include "gsb_data_transaction.h"
-#include "utils_editables.h"
#include "gsb_form_widget.h"
-#include "import.h"
#include "gsb_status.h"
-#include "utils_str.h"
+#include "gsb_transactions_list.h"
#include "gtk_combofix.h"
+#include "import.h"
+#include "metatree.h"
+#include "structures.h"
#include "traitement_variables.h"
+#include "transaction_list.h"
#include "utils.h"
#include "utils_buttons.h"
-#include "transaction_list.h"
-#include "gsb_transactions_list.h"
-#include "structures.h"
+#include "utils_editables.h"
+#include "utils_str.h"
#include "erreur.h"
/*END_INCLUDE*/
/*START_STATIC*/
-static void appui_sur_ajout_payee ( GtkTreeModel * model );
-static void appui_sur_manage_tiers ( void );
-static GtkWidget *creation_barre_outils_tiers ( void );
-static gboolean edit_payee ( GtkTreeView * view );
static void gsb_assistant_payees_clicked ( GtkButton *button, GtkWidget *assistant );
static gboolean gsb_assistant_payees_enter_page_2 ( GtkWidget *assistant );
static gboolean gsb_assistant_payees_enter_page_3 ( GtkWidget *assistant );
@@ -95,18 +92,16 @@ static gboolean payee_drag_data_get ( GtkTreeDragSource * drag_source, GtkTreePa
static gboolean payee_list_button_press ( GtkWidget *tree_view,
GdkEventButton *ev,
gpointer null );
-static gboolean payee_remove_unused ( GtkWidget *button,
- gpointer null );
static void payee_tree_update_transactions ( GtkTreeModel * model,
MetatreeInterface * iface, GtkTreeIter * iter,
gint division, gchar * old_payee );
-static gboolean popup_payee_view_mode_menu ( GtkWidget * button );
/*END_STATIC*/
gint no_devise_totaux_tiers;
-GtkWidget *payee_tree = NULL;
-GtkTreeStore *payee_tree_model = NULL;
+static GtkWidget *payee_toolbar;
+static GtkWidget *payee_tree = NULL;
+static GtkTreeStore *payee_tree_model = NULL;
/* variable for the management of the cancelled edition */
static gboolean sortie_edit_payee = FALSE;
@@ -185,11 +180,12 @@ GtkWidget *onglet_tiers ( void )
payee_tree_model = gtk_tree_store_new ( META_TREE_NUM_COLUMNS, META_TREE_COLUMN_TYPES );
/* on y ajoute la barre d'outils */
+ payee_toolbar = gtk_handle_box_new ();
+ gtk_widget_show ( payee_toolbar );
+ gsb_gui_update_payee_toolbar ();
gtk_box_pack_start ( GTK_BOX ( onglet ),
- creation_barre_outils_tiers ( ),
- FALSE,
- FALSE,
- 0 );
+ payee_toolbar,
+ FALSE, FALSE, 0 );
/* création de l'arbre principal */
scroll_window = gtk_scrolled_window_new ( NULL, NULL );
@@ -307,86 +303,6 @@ GtkWidget *onglet_tiers ( void )
/**
- * Create a button bar allowing to act on the payee list. Some of
- * these buttons are "linked" to the selection status of the payee
- * metatree. That is, if nothing is selected, they will become
- * unsensitive.
- *
- * \return A newly-allocated widget.
- */
-GtkWidget *creation_barre_outils_tiers ( void )
-{
- GtkWidget *hbox, *handlebox, *button;
-
- /* HandleBox */
- handlebox = gtk_handle_box_new ();
-
- /* Hbox */
- hbox = gtk_hbox_new ( FALSE, 0 );
- gtk_container_add ( GTK_CONTAINER(handlebox), hbox );
-
- /* Add various icons */
- button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
- _("New payee"), "new-payee.png",
- G_CALLBACK(appui_sur_ajout_payee),
- payee_tree_model );
- gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
- _("Create a new payee"));
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_DELETE, _("Delete"),
- G_CALLBACK(supprimer_division),
- payee_tree );
- metatree_register_widget_as_linked ( GTK_TREE_MODEL (payee_tree_model), button, "selection" );
- gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
- _("Delete selected payee"));
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_PROPERTIES, _("Properties"),
- G_CALLBACK(edit_payee),
- payee_tree );
- metatree_register_widget_as_linked ( GTK_TREE_MODEL (payee_tree_model), button, "selection" );
- gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
- _("Edit selected payee"));
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
- button = gsb_automem_stock_button_menu_new ( etat.display_toolbar,
- GTK_STOCK_SELECT_COLOR,
- _("View"),
- G_CALLBACK(popup_payee_view_mode_menu),
- NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
- _("Change view mode"));
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
- button = gsb_automem_imagefile_button_new ( etat.display_toolbar,
- _("Manage payees"), "payeesmg.png",
- G_CALLBACK( appui_sur_manage_tiers ),
- NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
- _("Manage the payees"));
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
- button = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_DELETE, _("Remove unused payees"),
- G_CALLBACK(payee_remove_unused),
- NULL );
- gtk_widget_set_tooltip_text ( GTK_WIDGET (button),
- _("Remove orphan payees"));
- gtk_box_pack_start ( GTK_BOX ( hbox ), button, FALSE, TRUE, 0 );
-
- gtk_widget_show_all ( handlebox );
-
- metatree_set_linked_widgets_sensitive ( GTK_TREE_MODEL(payee_tree_model),
- FALSE, "selection" );
-
- return ( handlebox );
-}
-
-
-/**
* called by button delete unused payees
* show a message to be sure and remove all the payees without transactions
*
@@ -1717,6 +1633,39 @@ gboolean payee_list_button_press ( GtkWidget *tree_view,
}
+/**
+ *
+ *
+ *
+ */
+GtkTreeStore *gsb_payee_get_tree_store ( void )
+{
+ return payee_tree_model;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+GtkWidget *gsb_payee_get_tree_view ( void )
+{
+ return payee_tree;
+}
+
+
+/**
+ *
+ *
+ *
+ */
+GtkWidget *gsb_payee_get_toolbar ( void )
+{
+ return payee_toolbar;
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/tiers_onglet.h b/src/tiers_onglet.h
index 25b417c..bfc7942 100644
--- a/src/tiers_onglet.h
+++ b/src/tiers_onglet.h
@@ -11,10 +11,19 @@
gint classement_alphabetique_tree ( GtkWidget *tree,
GtkCListRow *ligne_1,
GtkCListRow *ligne_2 );
+GtkWidget *gsb_payee_get_toolbar ( void );
+GtkTreeStore *gsb_payee_get_tree_store ( void );
+GtkWidget *gsb_payee_get_tree_view ( void );
gboolean gsb_payee_update_combofix ( void );
GtkWidget *onglet_tiers ( void );
void payee_fill_tree ( void );
gboolean payee_hold_position_set_expand ( gboolean expand );
gboolean payee_hold_position_set_path ( GtkTreePath *path );
+void appui_sur_ajout_payee ( GtkTreeModel * model );
+void appui_sur_manage_tiers ( void );
+gboolean edit_payee ( GtkTreeView * view );
+gboolean popup_payee_view_mode_menu ( GtkWidget * button );
+gboolean payee_remove_unused ( GtkWidget *button,
+ gpointer null );
/* END_DECLARATION */
#endif
diff --git a/src/utils_operations.c b/src/utils_operations.c
index 6ff9471..93ec10f 100644
--- a/src/utils_operations.c
+++ b/src/utils_operations.c
@@ -35,6 +35,7 @@
#include "gsb_data_category.h"
#include "gsb_data_payee.h"
#include "metatree.h"
+#include "tiers_onglet.h"
#include "erreur.h"
/*END_INCLUDE*/
@@ -56,8 +57,6 @@ extern GtkTreeStore *budgetary_line_tree_model;
extern GtkTreeStore *categ_tree_model;
extern MetatreeInterface * category_interface;
extern MetatreeInterface * payee_interface;
-extern GtkWidget *payee_tree;
-extern GtkTreeStore *payee_tree_model;
/*END_EXTERN*/
@@ -132,7 +131,9 @@ void update_transaction_in_payee_tree ( gint transaction_number )
{
/* FIXME: Kludgeish, we should maintain a state. */
gsb_data_payee_update_counters ();
- update_transaction_in_tree ( payee_interface, GTK_TREE_MODEL (payee_tree_model), transaction_number );
+ update_transaction_in_tree ( payee_interface,
+ GTK_TREE_MODEL ( gsb_payee_get_tree_store ( ) ),
+ transaction_number );
}
/**
@@ -168,8 +169,10 @@ void delete_transaction_in_budgetary_line_tree ( gint transaction_number )
void delete_transaction_in_payee_tree ( gint transaction_number )
{
gsb_data_payee_remove_transaction_from_payee (transaction_number);
- metatree_remove_transaction ( GTK_TREE_VIEW (payee_tree), payee_interface,
- transaction_number, FALSE);
+ metatree_remove_transaction ( GTK_TREE_VIEW ( gsb_payee_get_tree_view ( ) ),
+ payee_interface,
+ transaction_number,
+ FALSE );
}
hooks/post-receive
--
grisbi
More information about the cvs
mailing list