[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_4-112-g7a15901
Pierre Biava
nobody at users.sourceforge.net
Sun Nov 28 23:15:18 CET 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 7a15901d708d1e0cb1fedc1f8a64259c488728af (commit)
from e3aebd83b9e446f2b6c36c0a3613d9dd340b76af (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 7a15901d708d1e0cb1fedc1f8a64259c488728af
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Nov 28 23:13:58 2010 +0100
fixed a bug of selection by date of transactions at print
-----------------------------------------------------------------------
Changes:
diff --git a/src/print_transactions_list.c b/src/print_transactions_list.c
index ffe9cf6..0f0c6bb 100644
--- a/src/print_transactions_list.c
+++ b/src/print_transactions_list.c
@@ -203,6 +203,9 @@ GtkWidget * print_transactions_list_layout_config ( GtkPrintOperation * operatio
final_date_entry,
FALSE, FALSE, 0);
+ g_object_set_data ( G_OBJECT ( operation ), "init_date_entry", init_date_entry );
+ g_object_set_data ( G_OBJECT ( operation ), "final_date_entry", final_date_entry );
+
check_button = gsb_autofunc_checkbutton_new (_("Use value date"),
gsb_data_print_config_get_draw_dates_are_value_dates (),
NULL, NULL,
@@ -214,7 +217,6 @@ GtkWidget * print_transactions_list_layout_config ( GtkPrintOperation * operatio
if (!gsb_data_print_config_get_draw_interval_dates ())
gtk_widget_set_sensitive (hbox, FALSE);
-
/* set up all the checkbuttons */
check_button = gsb_autofunc_checkbutton_new (_("Draw the lines between transactions"),
gsb_data_print_config_get_draw_lines (),
@@ -338,13 +340,26 @@ gboolean print_transactions_list_apply ( GtkPrintOperation * operation,
gpointer null )
{
GtkFontButton * font_button_transactions, * font_button_title;
+ GtkWidget *calendar;
- font_button_transactions = g_object_get_data ( G_OBJECT(operation), "font_transaction_button" );
- font_button_title = g_object_get_data ( G_OBJECT(operation), "font_title_button" );
-
- gsb_data_print_config_set_font_transaction ( pango_font_description_from_string ( gtk_font_button_get_font_name ( font_button_transactions ) ) );
- gsb_data_print_config_set_font_title ( pango_font_description_from_string ( gtk_font_button_get_font_name ( font_button_title ) ) );
+ font_button_transactions = g_object_get_data ( G_OBJECT ( operation ), "font_transaction_button" );
+ font_button_title = g_object_get_data ( G_OBJECT( operation ), "font_title_button" );
+ gsb_data_print_config_set_font_transaction ( pango_font_description_from_string (
+ gtk_font_button_get_font_name ( font_button_transactions ) ) );
+ gsb_data_print_config_set_font_title ( pango_font_description_from_string (
+ gtk_font_button_get_font_name ( font_button_title ) ) );
+
+
+ if ( gsb_data_print_config_get_draw_interval_dates () )
+ {
+ calendar = g_object_get_data ( G_OBJECT(operation), "init_date_entry" );
+ draw_initial_date = gsb_calendar_entry_get_date ( calendar );
+
+ calendar = g_object_get_data ( G_OBJECT(operation), "final_date_entry" );
+ draw_final_date = gsb_calendar_entry_get_date ( calendar );
+ }
+
return FALSE;
}
@@ -604,51 +619,57 @@ gboolean print_transactions_list_get_visibles_lines ( gint *number_of_archives,
for (i=0 ; i<custom_list -> num_visibles_rows ; i++)
{
- CustomRecord *record;
-
- record = custom_list -> visibles_rows[i];
- switch (record -> what_is_line)
- {
- case IS_ARCHIVE:
- if (gsb_data_print_config_get_draw_archives ())
- archives_nb++;
- break;
- case IS_TRANSACTION:
- if (gsb_data_print_config_get_draw_interval_dates () && draw_initial_date && draw_final_date)
- {
- /* we want an interval, so check the transaction */
- gint transaction_number;
- const GDate *date;
-
- transaction_number = gsb_data_transaction_get_transaction_number (record -> transaction_pointer);
- if (gsb_data_print_config_get_draw_dates_are_value_dates ())
- {
- date = gsb_data_transaction_get_value_date (transaction_number);
-
- /* if no value date, get the date */
- if (!date)
- date = gsb_data_transaction_get_date (transaction_number);
- }
- else
- date = gsb_data_transaction_get_date (transaction_number);
-
- if (date
- &&
- g_date_compare (date,
- draw_initial_date) >= 0
- &&
- g_date_compare (date,
- draw_final_date) <= 0)
- transactions_nb++;
- }
- else
- transactions_nb++;
- break;
- }
+ CustomRecord *record;
+
+ record = custom_list -> visibles_rows[i];
+ switch (record -> what_is_line)
+ {
+ case IS_ARCHIVE:
+ if (gsb_data_print_config_get_draw_archives ())
+ archives_nb++;
+ break;
+ case IS_TRANSACTION:
+ if ( gsb_data_print_config_get_draw_interval_dates () && draw_initial_date && draw_final_date )
+ {
+ /* we want an interval, so check the transaction */
+ gint transaction_number;
+ const GDate *date;
+
+ transaction_number = gsb_data_transaction_get_transaction_number (record -> transaction_pointer);
+ if (gsb_data_print_config_get_draw_dates_are_value_dates ())
+ {
+ date = gsb_data_transaction_get_value_date (transaction_number);
+
+ /* if no value date, get the date */
+ if (!date)
+ date = gsb_data_transaction_get_date (transaction_number);
+ }
+ else
+ date = gsb_data_transaction_get_date (transaction_number);
+
+ if (date
+ &&
+ g_date_compare (date,
+ draw_initial_date) >= 0
+ &&
+ g_date_compare (date,
+ draw_final_date) <= 0)
+ transactions_nb++;
+ }
+ else
+ transactions_nb++;
+
+ break;
+ }
}
+
/* before returning the value, transactions_nb is in fact the number of lines of visibles transactions,
- * so need to divide by the number of lines for 1 transaction, and remove the white line */
- transactions_nb = (transactions_nb - custom_list -> nb_rows_by_transaction) / custom_list -> nb_rows_by_transaction;
+ * so need to divide by the number of lines for 1 transaction, and remove the white line if necessary */
+ if ( gsb_data_print_config_get_draw_interval_dates () && draw_initial_date && draw_final_date )
+ transactions_nb = ( transactions_nb ) / custom_list -> nb_rows_by_transaction;
+ else
+ transactions_nb = (transactions_nb - custom_list -> nb_rows_by_transaction)
+ / custom_list -> nb_rows_by_transaction;
*number_of_archives = archives_nb;
*number_of_transactions = transactions_nb;
hooks/post-receive
--
grisbi
More information about the cvs
mailing list