[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_3-68-g68410dc
Pierre Biava
nobody at users.sourceforge.net
Tue Oct 5 22:49:09 CEST 2010
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 68410dc27ac5d3cdf03e8cb33e6cb55d591137f3 (commit)
from c3e34ca527862fa6fa80a797ee85340b1dc9f771 (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 68410dc27ac5d3cdf03e8cb33e6cb55d591137f3
Author: pbiava <pierre.biava at nerim.net>
Date: Tue Oct 5 22:48:10 2010 +0200
standardization of treatment of popup menus of the credits simulator
-----------------------------------------------------------------------
Changes:
diff --git a/src/bet_finance_ui.c b/src/bet_finance_ui.c
index 182b005..76eccc5 100644
--- a/src/bet_finance_ui.c
+++ b/src/bet_finance_ui.c
@@ -296,6 +296,8 @@ GtkWidget *bet_finance_create_simulator_page ( void )
/* création de la liste des données */
tree_view = bet_finance_create_data_tree_view ( page );
+ g_object_set_data ( G_OBJECT ( tree_view ), "origin",
+ GINT_TO_POINTER ( SPP_ORIGIN_SIMULATOR ) );
g_object_set_data ( G_OBJECT ( page ), "tree_view", tree_view );
g_object_set_data ( G_OBJECT ( tree_view ), "label_title", label_title );
@@ -989,6 +991,7 @@ void bet_finance_data_list_context_menu ( GtkWidget *tree_view, gint page_num )
GtkTreeSelection *tree_selection;
GtkTreeIter iter;
gchar *tmp_str;
+ gint origin;
tree_selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view ) );
@@ -998,40 +1001,40 @@ void bet_finance_data_list_context_menu ( GtkWidget *tree_view, gint page_num )
menu = gtk_menu_new ();
- tmp_str = g_build_filename ( GRISBI_PIXMAPS_DIR, "ac_liability_16.png", NULL);
- image = gtk_image_new_from_file ( tmp_str );
- gtk_image_set_pixel_size ( GTK_IMAGE ( image ), GTK_ICON_SIZE_MENU );
- g_free ( tmp_str );
-
- if ( page_num == 0 )
+ origin = GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( tree_view ), "origin" ) );
+ if ( origin == SPP_ORIGIN_SIMULATOR )
{
- menu_item = gtk_image_menu_item_new_with_label ( _("View amortization table") );
- g_signal_connect ( G_OBJECT ( menu_item ),
+ tmp_str = g_build_filename ( GRISBI_PIXMAPS_DIR, "ac_liability_16.png", NULL);
+ image = gtk_image_new_from_file ( tmp_str );
+ gtk_image_set_pixel_size ( GTK_IMAGE ( image ), GTK_ICON_SIZE_MENU );
+ g_free ( tmp_str );
+
+ if ( page_num == 0 )
+ {
+ menu_item = gtk_image_menu_item_new_with_label ( _("View amortization table") );
+ g_signal_connect ( G_OBJECT ( menu_item ),
"activate",
G_CALLBACK ( bet_finance_fill_amortization_array ),
tree_selection );
-
- tmp_str = g_strdup ( _("Print the array") );
- }
- else
- {
- menu_item = gtk_image_menu_item_new_with_label ( _("View credits simulator") );
- g_signal_connect ( G_OBJECT ( menu_item ),
+ }
+ else
+ {
+ menu_item = gtk_image_menu_item_new_with_label ( _("View credits simulator") );
+ g_signal_connect ( G_OBJECT ( menu_item ),
"activate",
G_CALLBACK ( bet_finance_switch_simulator_page ),
NULL );
+ }
+
+ gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ), image );
+ gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
- tmp_str = g_strdup ( _("Print amortization table") );
+ /* Separator */
+ gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new() );
}
-
- gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ), image );
- gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
-
- /* Separator */
- gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), gtk_separator_menu_item_new() );
/* Print list */
- menu_item = gtk_image_menu_item_new_with_label ( tmp_str );
+ menu_item = gtk_image_menu_item_new_with_label ( _("Print the array") );
gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
gtk_image_new_from_stock ( GTK_STOCK_PRINT, GTK_ICON_SIZE_MENU ) );
g_signal_connect ( G_OBJECT ( menu_item ),
@@ -1039,7 +1042,16 @@ void bet_finance_data_list_context_menu ( GtkWidget *tree_view, gint page_num )
G_CALLBACK ( print_tree_view_list ),
tree_view );
gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
- g_free ( tmp_str );
+
+ /* Export list */
+ menu_item = gtk_image_menu_item_new_with_label ( _("Export the array") );
+ gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
+ gtk_image_new_from_stock ( GTK_STOCK_SAVE, GTK_ICON_SIZE_MENU ) );
+ g_signal_connect ( G_OBJECT ( menu_item ),
+ "activate",
+ G_CALLBACK ( bet_finance_ui_export_tab ),
+ tree_view );
+ gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
/* Finish all. */
gtk_widget_show_all ( menu );
@@ -1117,7 +1129,9 @@ GtkWidget *bet_finance_create_amortization_page ( void )
gtk_box_pack_start ( GTK_BOX ( hbox ), label, FALSE, FALSE, 0 );
/* création de la liste des données */
- tree_view = bet_finance_create_amortization_tree_view ( page, 0 );
+ tree_view = bet_finance_create_amortization_tree_view ( page, SPP_ORIGIN_SIMULATOR );
+ g_object_set_data ( G_OBJECT ( tree_view ), "origin",
+ GINT_TO_POINTER ( SPP_ORIGIN_SIMULATOR ) );
g_object_set_data ( G_OBJECT ( page ), "tree_view", tree_view );
g_object_set_data ( G_OBJECT ( tree_view ), "label_title", label_title );
@@ -1296,8 +1310,7 @@ GtkWidget *bet_finance_create_amortization_tree_view ( GtkWidget *container, gin
GINT_TO_POINTER ( BET_AMORTIZATION_ECHEANCE_COLUMN ) );
g_free ( title );
- if ( origin != SPP_ORIGIN_FINANCE )
- g_signal_connect ( G_OBJECT ( tree_view ),
+ g_signal_connect ( G_OBJECT ( tree_view ),
"button-press-event",
G_CALLBACK ( bet_finance_data_list_button_press ),
container );
@@ -1494,8 +1507,6 @@ GtkWidget *bet_finance_create_account_page ( void )
GtkWidget *label_title;
GtkWidget *label;
GtkWidget *tree_view;
- GtkWidget *handlebox;
- GtkWidget *button;
GtkWidget *toolbar;
devel_debug (NULL);
@@ -1553,6 +1564,8 @@ GtkWidget *bet_finance_create_account_page ( void )
/* création de la liste des données */
tree_view = bet_finance_create_amortization_tree_view ( page, SPP_ORIGIN_FINANCE );
+ g_object_set_data ( G_OBJECT ( tree_view ), "origin",
+ GINT_TO_POINTER ( SPP_ORIGIN_FINANCE ) );
g_object_set_data ( G_OBJECT ( account_page ), "bet_finance_tree_view", tree_view );
g_object_set_data ( G_OBJECT ( tree_view ), "label_title", label_title );
diff --git a/src/bet_tab.c b/src/bet_tab.c
index 860de80..fe2f33b 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -1537,6 +1537,16 @@ void bet_array_list_context_menu ( GtkWidget *tree_view )
tree_view );
gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+ /* Export list */
+ menu_item = gtk_image_menu_item_new_with_label ( SPACIFY ( _("Export the array") ) );
+ gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( menu_item ),
+ gtk_image_new_from_stock ( GTK_STOCK_SAVE, GTK_ICON_SIZE_MENU ) );
+ g_signal_connect ( G_OBJECT ( menu_item ),
+ "activate",
+ G_CALLBACK ( bet_array_export_tab ),
+ tree_view );
+ gtk_menu_shell_append ( GTK_MENU_SHELL ( menu ), menu_item );
+
/* Finish all. */
gtk_widget_show_all ( menu );
gtk_menu_popup ( GTK_MENU( menu ), NULL, NULL, NULL, NULL, 3,
diff --git a/src/structures.h b/src/structures.h
index a82ba97..eb97b64 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -209,15 +209,16 @@ enum alignement
enum bet_array_origin_data
{
- SPP_ORIGIN_TRANSACTION,
- SPP_ORIGIN_SCHEDULED,
- SPP_ORIGIN_HISTORICAL,
- SPP_ORIGIN_FUTURE,
- SPP_ORIGIN_ACCOUNT,
- SPP_ORIGIN_ARRAY,
- SPP_ORIGIN_CONFIG,
- SPP_ORIGIN_FINANCE,
- SPP_ORIGIN_SOLDE
+ SPP_ORIGIN_TRANSACTION, /* Ligne issue d'une opération */
+ SPP_ORIGIN_SCHEDULED, /* Ligne issue d'une opération plannifiée */
+ SPP_ORIGIN_HISTORICAL, /* Ligne issue d'une donnée historique */
+ SPP_ORIGIN_FUTURE, /* Ligne issue d'une opération future */
+ SPP_ORIGIN_ACCOUNT, /* Ligne issue d'un compte */
+ SPP_ORIGIN_ARRAY, /* Donnée provenant du tableau de prévision */
+ SPP_ORIGIN_CONFIG, /* Donnée provenant de la page des préférences */
+ SPP_ORIGIN_SIMULATOR, /* Donnée provenant du tableau du simulateur de crédit */
+ SPP_ORIGIN_FINANCE, /* Donnée provenant du tableau d'amortissement du simulateur */
+ SPP_ORIGIN_SOLDE /* Ligne de solde au premier du mois */
};
enum bet_type_maj
hooks/post-receive
--
grisbi
More information about the cvs
mailing list