[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_95-3-gb2ddeb4
Pierre Biava
nobody at users.sourceforge.net
Sun Dec 12 17:58:22 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 b2ddeb49dd032fde0b2b1adf246b21e942153119 (commit)
via 2b4a45906cd4ec79f65e8645e3750745061bdf96 (commit)
from c4a541a0688010b8d8b6310d3f4cc1fccd8b3582 (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 b2ddeb49dd032fde0b2b1adf246b21e942153119
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Dec 12 17:57:37 2010 +0100
changes for compiling under Windows
commit 2b4a45906cd4ec79f65e8645e3750745061bdf96
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Dec 12 17:56:42 2010 +0100
Fixed a display bug in forecast when the thousands separator is a dot
-----------------------------------------------------------------------
Changes:
diff --git a/src/bet_data.c b/src/bet_data.c
index 10a2a25..62782d5 100644
--- a/src/bet_data.c
+++ b/src/bet_data.c
@@ -836,7 +836,7 @@ GPtrArray *bet_data_get_strings_to_save ( void )
shd -> account_nb,
shd -> div_number,
shd -> div_edited,
- gsb_real_save_real_to_string ( shd -> amount,
+ gsb_real_safe_real_to_string ( shd -> amount,
gsb_data_account_get_currency_floating_point ( shd -> account_nb ) ),
0, 0, "0.00" );
@@ -860,10 +860,10 @@ GPtrArray *bet_data_get_strings_to_save ( void )
shd -> account_nb,
shd -> div_number,
shd -> div_edited,
- gsb_real_save_real_to_string ( shd -> amount, floating_point ),
+ gsb_real_safe_real_to_string ( shd -> amount, floating_point ),
sub_shd -> div_number,
sub_shd -> div_edited,
- gsb_real_save_real_to_string ( sub_shd -> amount, floating_point ) );
+ gsb_real_safe_real_to_string ( sub_shd -> amount, floating_point ) );
g_ptr_array_add ( tab, tmp_str );
}
@@ -879,7 +879,7 @@ GPtrArray *bet_data_get_strings_to_save ( void )
gchar *limit_date;
/* set the real */
- amount = gsb_real_save_real_to_string ( scheduled -> amount,
+ amount = gsb_real_safe_real_to_string ( scheduled -> amount,
gsb_data_account_get_currency_floating_point ( scheduled -> account_number ) );
/* set the dates */
diff --git a/src/bet_finance_ui.c b/src/bet_finance_ui.c
index 03e1fb5..dc81931 100644
--- a/src/bet_finance_ui.c
+++ b/src/bet_finance_ui.c
@@ -1621,7 +1621,6 @@ GtkWidget *bet_finance_create_account_page ( void )
* */
void bet_finance_ui_update_amortization_tab ( gint account_number )
{
- GtkWidget *page;
GtkWidget *label;
GtkWidget *tree_view;
GtkTreeModel *store;
@@ -1639,15 +1638,14 @@ void bet_finance_ui_update_amortization_tab ( gint account_number )
struct_amortissement *s_amortissement;
gboolean amortization_initial_date;
- /* devel_debug ( NULL ); */
+ devel_debug ( NULL );
if ( gsb_gui_navigation_get_current_account ( ) != account_number )
return;
s_amortissement = g_malloc0 ( sizeof ( struct_amortissement ) );
s_amortissement -> origin = SPP_ORIGIN_FINANCE;
- /* récupère la page du tableau d'amortissement et le tableau */
- page = gtk_notebook_get_nth_page ( GTK_NOTEBOOK ( finance_notebook ), 1 );
+ /* récupère le tableau d'amortissement */
tree_view = g_object_get_data ( G_OBJECT ( account_page ), "bet_finance_tree_view" );
amortization_initial_date = GPOINTER_TO_INT ( g_object_get_data (
G_OBJECT ( tree_view ), "amortization_initial_date" ) );
diff --git a/src/bet_hist.c b/src/bet_hist.c
index 3d5dac7..74d7eb8 100644
--- a/src/bet_hist.c
+++ b/src/bet_hist.c
@@ -263,7 +263,7 @@ gboolean bet_historical_div_toggle_clicked ( GtkCellRendererToggle *renderer,
account_number, div, sub_div); */
bet_data_hist_add_div ( account_number, div_number, sub_div_nb );
bet_data_set_div_amount ( account_number, div_number, sub_div_nb,
- gsb_real_import_from_string ( str_amount ) );
+ gsb_real_safe_real_from_string ( str_amount ) );
gtk_tree_store_set ( GTK_TREE_STORE ( model ), &iter,
SPP_HISTORICAL_SELECT_COLUMN, 1,
SPP_HISTORICAL_RETAINED_COLUMN, str_average,
@@ -307,7 +307,7 @@ gboolean bet_historical_div_toggle_clicked ( GtkCellRendererToggle *renderer,
amount = bet_historical_get_children_amount ( model, &parent );
if ( str_amount )
g_free ( str_amount );
- str_amount = gsb_real_save_real_to_string ( amount,
+ str_amount = gsb_real_safe_real_to_string ( amount,
gsb_data_account_get_currency_floating_point ( account_number ) );
if ( str_average )
g_free ( str_average );
@@ -414,6 +414,8 @@ void bet_historical_div_cell_edited (GtkCellRendererText *cell,
number = gsb_real_get_from_string ( new_text );
currency_number = gsb_data_account_get_currency ( account_number );
tmp_str = gsb_real_get_string_with_currency ( number, currency_number, TRUE );
+ str_amount = gsb_real_safe_real_to_string ( number,
+ gsb_data_currency_get_floating_point ( currency_number ) );
if ( bet_data_search_div_hist ( account_number, div_number, sub_div_nb ) == FALSE )
bet_data_hist_add_div ( account_number, div_number, sub_div_nb );
@@ -423,12 +425,13 @@ void bet_historical_div_cell_edited (GtkCellRendererText *cell,
gtk_tree_store_set ( GTK_TREE_STORE ( model ), &iter,
SPP_HISTORICAL_SELECT_COLUMN, TRUE,
SPP_HISTORICAL_RETAINED_COLUMN, tmp_str,
- SPP_HISTORICAL_RETAINED_AMOUNT, new_text,
+ SPP_HISTORICAL_RETAINED_AMOUNT, str_amount,
-1 );
+ g_free ( str_amount );
g_free ( tmp_str );
if ( is_parent )
- gtk_tree_store_set ( GTK_TREE_STORE ( model ),
+ gtk_tree_store_set ( GTK_TREE_STORE ( model ),
&parent,
SPP_HISTORICAL_EDITED_COLUMN, FALSE,
-1);
@@ -437,7 +440,7 @@ void bet_historical_div_cell_edited (GtkCellRendererText *cell,
{
number = bet_historical_get_children_amount ( model, &parent );
bet_data_set_div_amount ( account_number, div_number, 0, number );
- str_amount = gsb_real_save_real_to_string ( number,
+ str_amount = gsb_real_safe_real_to_string ( number,
gsb_data_currency_get_floating_point ( currency_number ) );
tmp_str = gsb_real_get_string_with_currency ( number, currency_number, TRUE );
gtk_tree_store_set ( GTK_TREE_STORE ( model ),
@@ -807,7 +810,7 @@ void bet_historical_populate_div_model ( gpointer key,
str_balance = gsb_real_get_string_with_currency ( sbr -> current_balance, currency_number, TRUE );
average = gsb_real_div ( sbr -> current_balance, period );
- str_amount = gsb_real_save_real_to_string ( average,
+ str_amount = gsb_real_safe_real_to_string ( average,
gsb_data_currency_get_floating_point ( currency_number ) );
str_average = gsb_real_get_string_with_currency ( average, currency_number, TRUE );
@@ -837,7 +840,7 @@ void bet_historical_populate_div_model ( gpointer key,
retained = bet_data_hist_get_div_amount ( account_nb, div_number, 0 );
if ( str_amount )
g_free ( str_amount );
- str_amount = gsb_real_save_real_to_string ( retained,
+ str_amount = gsb_real_safe_real_to_string ( retained,
gsb_data_currency_get_floating_point ( currency_number ) );
str_retained = gsb_real_get_string_with_currency ( retained, currency_number, TRUE );
gtk_tree_store_set ( GTK_TREE_STORE ( model ),
@@ -884,7 +887,7 @@ void bet_historical_populate_div_model ( gpointer key,
str_balance = gsb_real_get_string_with_currency ( sub_sbr -> current_balance,
currency_number, TRUE );
average = gsb_real_div ( sub_sbr -> current_balance, period );
- str_amount = gsb_real_save_real_to_string ( average,
+ str_amount = gsb_real_safe_real_to_string ( average,
gsb_data_currency_get_floating_point ( currency_number ) );
str_average = gsb_real_get_string_with_currency ( average,
currency_number, TRUE );
@@ -914,7 +917,7 @@ void bet_historical_populate_div_model ( gpointer key,
retained = bet_data_hist_get_div_amount ( account_nb, div_number, sub_sh -> div );
if ( str_amount )
g_free ( str_amount );
- str_amount = gsb_real_save_real_to_string ( retained,
+ str_amount = gsb_real_safe_real_to_string ( retained,
gsb_data_currency_get_floating_point ( currency_number ) );
str_retained = gsb_real_get_string_with_currency ( retained, currency_number, TRUE );
@@ -953,7 +956,7 @@ void bet_historical_populate_div_model ( gpointer key,
amount = bet_historical_get_children_amount ( model, &parent );
if ( str_amount )
g_free ( str_amount );
- str_amount = gsb_real_save_real_to_string ( amount,
+ str_amount = gsb_real_safe_real_to_string ( amount,
gsb_data_currency_get_floating_point ( currency_number ) );
str_retained = gsb_real_get_string_with_currency ( amount, currency_number, TRUE );
@@ -1184,10 +1187,10 @@ gboolean bet_historical_set_full_sub_div ( GtkTreeModel *model, GtkTreeIter *par
SPP_HISTORICAL_EDITED_COLUMN, &edited,
-1 );
- retained = gsb_real_import_from_string ( str_amount );
+ retained = gsb_real_safe_real_from_string ( str_amount );
bet_data_hist_add_div ( account_nb, div_number, sub_div_nb );
bet_data_set_div_amount ( account_nb, div_number, sub_div_nb,
- gsb_real_import_from_string ( str_amount ) );
+ gsb_real_safe_real_from_string ( str_amount ) );
str_retained = gsb_real_get_string_with_currency ( retained,
gsb_data_account_get_currency ( account_nb ), TRUE );
gtk_tree_store_set ( GTK_TREE_STORE ( model ), &fils_iter,
@@ -1276,7 +1279,7 @@ gsb_real bet_historical_get_children_amount ( GtkTreeModel *model, GtkTreeIter *
SPP_HISTORICAL_RETAINED_AMOUNT, &str_amount,
-1 );
amount = gsb_real_add ( amount,
- gsb_real_get_from_string ( str_amount ) );
+ gsb_real_safe_real_from_string ( str_amount ) );
}
while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &fils_iter ) );
}
@@ -1330,8 +1333,8 @@ gboolean bet_historical_amount_differ_average ( GtkTreeModel *model,
SPP_HISTORICAL_RETAINED_AMOUNT, &str_amount,
-1 );
- return gsb_real_cmp ( gsb_real_get_from_string ( str_average ),
- gsb_real_get_from_string ( str_amount ) );
+ return gsb_real_cmp ( gsb_real_safe_real_from_string ( str_average ),
+ gsb_real_safe_real_from_string ( str_amount ) );
}
@@ -1475,7 +1478,7 @@ void bet_historical_add_last_amount ( GtkWidget *menu_item,
gsb_data_account_get_bet_hist_data ( account_number ) );
currency_number = gsb_data_account_get_currency ( account_number );
- str_amount = gsb_real_save_real_to_string ( amount,
+ str_amount = gsb_real_safe_real_to_string ( amount,
gsb_data_currency_get_floating_point ( currency_number ) );
tmp_str = gsb_real_get_string_with_currency ( amount, currency_number, TRUE );
diff --git a/src/bet_tab.c b/src/bet_tab.c
index e9697ff..658eb98 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -177,8 +177,8 @@ gint bet_array_col_width[BET_ARRAY_COLUMNS];
gint bet_array_current_tree_view_width = 0;
- enum bet_estimation_tree_columns
- {
+enum bet_estimation_tree_columns
+{
SPP_ESTIMATE_TREE_SELECT_COLUMN, /* select column for the balance */
SPP_ESTIMATE_TREE_ORIGIN_DATA, /* origin of data : transaction, scheduled, hist, future */
SPP_ESTIMATE_TREE_DIVISION_COLUMN, /* div_number, transaction_number, futur_number, scheduled_number*/
@@ -283,8 +283,8 @@ static gint bet_array_date_sort_function ( GtkTreeModel *model,
result = -1;
else
{
- amount_a = gsb_real_import_from_string ( str_amount_a );
- amount_b = gsb_real_import_from_string ( str_amount_b );
+ amount_a = gsb_real_safe_real_from_string ( str_amount_a );
+ amount_b = gsb_real_safe_real_from_string ( str_amount_b );
result = - ( gsb_real_cmp ( amount_a, amount_b ) );
}
@@ -350,7 +350,7 @@ static gboolean bet_array_update_average_column ( GtkTreeModel *model,
gtk_tree_model_get ( model, iter, SPP_ESTIMATE_TREE_AMOUNT_COLUMN, &tmp_str, -1 );
- amount = gsb_real_get_from_string ( tmp_str );
+ amount = gsb_real_safe_real_from_string ( tmp_str );
tmp_range -> current_balance = gsb_real_add ( tmp_range -> current_balance, amount );
str_balance = gsb_real_get_string_with_currency ( tmp_range -> current_balance,
@@ -432,7 +432,7 @@ void bet_array_refresh_estimate_tab ( gint account_number )
currency_number = gsb_data_account_get_currency ( account_number );
- str_amount = gsb_real_save_real_to_string ( current_balance,
+ str_amount = gsb_real_safe_real_to_string ( current_balance,
gsb_data_currency_get_floating_point ( currency_number ) );
str_current_balance = gsb_real_get_string_with_currency ( current_balance, currency_number, TRUE );
@@ -872,7 +872,7 @@ void bet_array_refresh_scheduled_data ( GtkTreeModel *tab_model,
continue;
currency_number = gsb_data_scheduled_get_currency_number ( scheduled_number );
- str_amount = gsb_real_save_real_to_string ( amount,
+ str_amount = gsb_real_safe_real_to_string ( amount,
gsb_data_currency_get_floating_point ( currency_number ) );
if (amount.mantissa < 0)
str_debit = gsb_real_get_string_with_currency ( gsb_real_abs ( amount ), currency_number, TRUE );
@@ -1023,7 +1023,7 @@ void bet_array_refresh_transactions_data ( GtkTreeModel *tab_model,
g_value_set_boxed ( &date_value, date );
currency_number = gsb_data_transaction_get_currency_number ( transaction_number);
- str_amount = gsb_real_save_real_to_string ( amount,
+ str_amount = gsb_real_safe_real_to_string ( amount,
gsb_data_currency_get_floating_point ( currency_number ) );
if (amount.mantissa < 0)
@@ -1123,7 +1123,7 @@ void bet_array_list_add_new_hist_line ( GtkTreeModel *tab_model,
str_description = bet_data_get_div_name ( div_number, sub_div_nb, NULL );
}
- amount = gsb_real_get_from_string ( str_amount );
+ amount = gsb_real_safe_real_from_string ( str_amount );
if ( amount.mantissa < 0 )
str_debit = gsb_real_get_string_with_currency ( gsb_real_opposite ( amount ),
@@ -1259,7 +1259,7 @@ gboolean bet_array_refresh_futur_data ( GtkTreeModel *tab_model,
amount = scheduled -> amount;
currency_number = gsb_data_account_get_currency ( account_number );
- str_amount = gsb_real_save_real_to_string ( amount,
+ str_amount = gsb_real_safe_real_to_string ( amount,
gsb_data_currency_get_floating_point ( currency_number ) );
if ( amount.mantissa < 0 )
@@ -1836,7 +1836,7 @@ void bet_array_adjust_hist_amount ( gint div_number,
date_today = gdate_today ( );
if ( g_date_get_month ( date ) - g_date_get_month ( date_today ) == 0 )
{
- number = gsb_real_import_from_string ( str_amount );
+ number = gsb_real_safe_real_from_string ( str_amount );
if ( number.mantissa != 0 )
{
sign = bet_data_get_div_type ( div_number );
@@ -1850,7 +1850,7 @@ void bet_array_adjust_hist_amount ( gint div_number,
{
if ( number.mantissa < 0 )
{
- str_amount = gsb_real_save_real_to_string ( number,
+ str_amount = gsb_real_safe_real_to_string ( number,
gsb_data_currency_get_floating_point ( currency_number ) );
str_debit = gsb_real_get_string_with_currency (
gsb_real_abs ( number ),
@@ -1872,7 +1872,7 @@ void bet_array_adjust_hist_amount ( gint div_number,
{
if ( number.mantissa > 0 )
{
- str_amount = gsb_real_save_real_to_string ( number,
+ str_amount = gsb_real_safe_real_to_string ( number,
gsb_data_currency_get_floating_point ( currency_number ) );
str_credit = gsb_real_get_string_with_currency (
gsb_real_abs ( number ),
@@ -1936,7 +1936,7 @@ void bet_array_list_update_balance ( GtkTreeModel *model )
gtk_tree_model_get ( model, &iter,
SPP_ESTIMATE_TREE_AMOUNT_COLUMN, &str_current_balance, -1 );
- current_balance = gsb_real_get_from_string ( str_current_balance );
+ current_balance = gsb_real_safe_real_from_string ( str_current_balance );
tmp_range = struct_initialise_bet_range ( );
tmp_range -> first_pass = TRUE;
@@ -2617,7 +2617,7 @@ gboolean bet_array_refresh_transfert_data ( GtkTreeModel *tab_model,
amount = gsb_data_partial_balance_get_current_amount (
transfert -> replace_account );
- str_amount = gsb_real_save_real_to_string ( amount,
+ str_amount = gsb_real_safe_real_to_string ( amount,
gsb_data_account_get_currency_floating_point ( account_number ) );
if ( amount.mantissa < 0 )
@@ -2893,7 +2893,7 @@ gboolean bet_array_shows_balance_at_beginning_of_month ( GtkTreeModel *tab_model
g_date_add_months ( date, 1 );
g_date_set_day ( date, 1 );
- str_amount = gsb_real_save_real_to_string ( null_real,
+ str_amount = gsb_real_safe_real_to_string ( null_real,
gsb_data_currency_get_floating_point (
bet_data_get_selected_currency ( ) ) );
diff --git a/src/fenetre_principale.h b/src/fenetre_principale.h
index efecee6..8f3215f 100644
--- a/src/fenetre_principale.h
+++ b/src/fenetre_principale.h
@@ -6,7 +6,7 @@ typedef enum GSB_GENERAL_NOTEBOOK_PAGES {
GSB_ACCOUNT_PAGE,
GSB_SCHEDULER_PAGE,
GSB_PAYEES_PAGE,
- GSB_GENERAL_FINANCIAL_PAGE,
+ GSB_SIMULATOR_PAGE,
GSB_CATEGORIES_PAGE,
GSB_BUDGETARY_LINES_PAGE,
GSB_REPORTS_PAGE,
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index 23209cb..8ef7b68 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -1641,7 +1641,7 @@ void gsb_file_load_account_part ( const gchar **attribute_names,
"Initial_balance" ))
{
gsb_data_account_set_init_balance ( account_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -1650,7 +1650,7 @@ void gsb_file_load_account_part ( const gchar **attribute_names,
"Minimum_wanted_balance" ))
{
gsb_data_account_set_mini_balance_wanted ( account_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -1659,7 +1659,7 @@ void gsb_file_load_account_part ( const gchar **attribute_names,
"Minimum_authorised_balance" ))
{
gsb_data_account_set_mini_balance_authorized ( account_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -2212,7 +2212,7 @@ void gsb_file_load_transactions ( const gchar **attribute_names,
{
/* get the entire real, even if the floating point of the currency is less deep */
gsb_data_transaction_set_amount ( transaction_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -2232,7 +2232,7 @@ void gsb_file_load_transactions ( const gchar **attribute_names,
"Exr" ))
{
gsb_data_transaction_set_exchange_rate ( transaction_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -2242,7 +2242,7 @@ void gsb_file_load_transactions ( const gchar **attribute_names,
"Exf" ))
{
gsb_data_transaction_set_exchange_fees ( transaction_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -2493,7 +2493,7 @@ void gsb_file_load_scheduled_transactions ( const gchar **attribute_names,
"Am" ))
{
gsb_data_scheduled_set_amount ( scheduled_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -3212,7 +3212,7 @@ void gsb_file_load_currency_link ( const gchar **attribute_names,
"Ex" ))
{
gsb_data_currency_link_set_change_rate ( link_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -3661,7 +3661,7 @@ void gsb_file_load_reconcile ( const gchar **attribute_names,
"Ibal" ))
{
gsb_data_reconcile_set_init_balance ( reconcile_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -3670,7 +3670,7 @@ void gsb_file_load_reconcile ( const gchar **attribute_names,
"Fbal" ))
{
gsb_data_reconcile_set_final_balance ( reconcile_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -3972,7 +3972,7 @@ void gsb_file_load_bet_historical ( const gchar **attribute_names,
if ( !strcmp ( attribute_names[i], "Damount" ) )
{
- shd -> amount = gsb_real_import_from_string ( attribute_values[i] );
+ shd -> amount = gsb_real_safe_real_from_string ( attribute_values[i] );
i++;
continue;
}
@@ -4000,7 +4000,7 @@ void gsb_file_load_bet_historical ( const gchar **attribute_names,
if ( !strcmp ( attribute_names[i], "SDamount" ) )
{
- sub_shd -> amount = gsb_real_import_from_string ( attribute_values[i] );
+ sub_shd -> amount = gsb_real_safe_real_from_string ( attribute_values[i] );
i++;
continue;
}
@@ -4073,7 +4073,7 @@ void gsb_file_load_bet_future_data ( const gchar **attribute_names,
if ( !strcmp ( attribute_names[i], "Am" ) )
{
- scheduled -> amount = gsb_real_import_from_string ( attribute_values[i] );
+ scheduled -> amount = gsb_real_safe_real_from_string ( attribute_values[i] );
i++;
continue;
}
@@ -5321,7 +5321,7 @@ void gsb_file_load_amount_comparison ( const gchar **attribute_names,
"Amount_1" ))
{
gsb_data_report_amount_comparison_set_first_amount ( amount_comparison_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
@@ -5330,7 +5330,7 @@ void gsb_file_load_amount_comparison ( const gchar **attribute_names,
"Amount_2" ))
{
gsb_data_report_amount_comparison_set_second_amount ( amount_comparison_number,
- gsb_real_import_from_string (attribute_values[i]));
+ gsb_real_safe_real_from_string (attribute_values[i]));
i++;
continue;
}
diff --git a/src/gsb_file_save.c b/src/gsb_file_save.c
index 14d99d2..8bab3e7 100644
--- a/src/gsb_file_save.c
+++ b/src/gsb_file_save.c
@@ -1084,13 +1084,13 @@ gulong gsb_file_save_account_part ( gulong iterator,
/* set the reals */
floating_point = gsb_data_account_get_currency_floating_point ( account_number );
- init_balance = gsb_real_save_real_to_string (
+ init_balance = gsb_real_safe_real_to_string (
gsb_data_account_get_init_balance ( account_number, -1 ),
floating_point );
- mini_wanted = gsb_real_save_real_to_string (
+ mini_wanted = gsb_real_safe_real_to_string (
gsb_data_account_get_mini_balance_wanted ( account_number ),
floating_point );
- mini_auto = gsb_real_save_real_to_string (
+ mini_auto = gsb_real_safe_real_to_string (
gsb_data_account_get_mini_balance_authorized ( account_number ),
floating_point );
@@ -1355,12 +1355,12 @@ gulong gsb_file_save_transaction_part ( gulong iterator,
/* set the reals. On met en forme le résultat pour avoir une cohérence dans les montants
* enregistrés dans le fichier à valider */
floating_point = gsb_data_transaction_get_currency_floating_point ( transaction_number );
- amount = gsb_real_save_real_to_string (
+ amount = gsb_real_safe_real_to_string (
gsb_data_transaction_get_amount ( transaction_number ),
floating_point );
- exchange_rate = gsb_real_save_real_to_string (
+ exchange_rate = gsb_real_safe_real_to_string (
gsb_data_transaction_get_exchange_rate ( transaction_number ), -1 );
- exchange_fees = gsb_real_save_real_to_string (
+ exchange_fees = gsb_real_safe_real_to_string (
gsb_data_transaction_get_exchange_fees ( transaction_number ),
floating_point );
@@ -1452,7 +1452,7 @@ gulong gsb_file_save_scheduled_part ( gulong iterator,
/* set the real */
floating_point = gsb_data_transaction_get_currency_floating_point ( scheduled_number );
- amount = gsb_real_save_real_to_string (
+ amount = gsb_real_safe_real_to_string (
gsb_data_scheduled_get_amount ( scheduled_number ),
floating_point );
@@ -1786,7 +1786,7 @@ gulong gsb_file_save_currency_link_part ( gulong iterator,
link_number = gsb_data_currency_link_get_no_currency_link (list_tmp -> data);
/* set the number */
- change_rate = gsb_real_save_real_to_string (
+ change_rate = gsb_real_safe_real_to_string (
gsb_data_currency_link_get_change_rate ( link_number ), -1 );
/* set the date of modification */
@@ -2027,10 +2027,10 @@ gulong gsb_file_save_reconcile_part ( gulong iterator,
/* set the balances strings */
floating_point = gsb_data_account_get_currency_floating_point ( gsb_data_reconcile_get_account (
reconcile_number ) );
- init_balance = gsb_real_save_real_to_string (
+ init_balance = gsb_real_safe_real_to_string (
gsb_data_reconcile_get_init_balance ( reconcile_number ),
floating_point );
- final_balance = gsb_real_save_real_to_string (
+ final_balance = gsb_real_safe_real_to_string (
gsb_data_reconcile_get_final_balance ( reconcile_number ),
floating_point );
@@ -2697,11 +2697,11 @@ gulong gsb_file_save_report_part ( gulong iterator,
/* set the numbers */
floating_point = gsb_data_currency_get_floating_point (
gsb_data_report_get_currency_general ( report_number ) );
- first_amount = gsb_real_save_real_to_string (
+ first_amount = gsb_real_safe_real_to_string (
gsb_data_report_amount_comparison_get_first_amount (
amount_comparison_number ),
floating_point );
- second_amount = gsb_real_save_real_to_string (
+ second_amount = gsb_real_safe_real_to_string (
gsb_data_report_amount_comparison_get_second_amount (
amount_comparison_number ),
floating_point );
diff --git a/src/gsb_real.c b/src/gsb_real.c
index c7cc8bd..212ee73 100644
--- a/src/gsb_real.c
+++ b/src/gsb_real.c
@@ -358,7 +358,7 @@ gsb_real gsb_real_raw_get_from_string ( const gchar *string,
*
* \return the number in the string transformed to gsb_real
*/
-gsb_real gsb_real_import_from_string ( const gchar *string )
+gsb_real gsb_real_safe_real_from_string ( const gchar *string )
{
unsigned nb_digits = 0;
gint64 mantissa = 0;
@@ -861,7 +861,13 @@ gboolean gsb_real_raw_truncate_number ( gint64 *mantissa, gint *exponent )
}
-gchar *gsb_real_save_real_to_string ( gsb_real number, gint default_exponent )
+/**
+ * retourne une chaine représentative d'un nombre avec le point comme séparateur décimal
+ * et pas de separateur de milliers
+ *
+ * The returned string should be freed with g_free() when no longer needed.
+ * */
+gchar *gsb_real_safe_real_to_string ( gsb_real number, gint default_exponent )
{
gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
gchar format[40];
diff --git a/src/gsb_real.h b/src/gsb_real.h
index 4bc767d..edbceb4 100644
--- a/src/gsb_real.h
+++ b/src/gsb_real.h
@@ -32,7 +32,6 @@ gchar *gsb_real_get_decimal_point ( void );
gsb_real gsb_real_get_from_string ( const gchar *string );
gchar *gsb_real_get_string ( gsb_real number );
gchar *gsb_real_get_thousands_sep ( void );
-gsb_real gsb_real_import_from_string ( const gchar *string );
gsb_real gsb_real_mul ( gsb_real number_1,
gsb_real number_2 );
gsb_real gsb_real_new ( gint64 mantissa, gint exponent );
@@ -45,7 +44,8 @@ gsb_real gsb_real_raw_get_from_string ( const gchar *string,
const gchar *mon_thousands_sep,
const gchar *mon_decimal_point );
gdouble gsb_real_real_to_double ( gsb_real number );
-gchar *gsb_real_save_real_to_string ( gsb_real number, gint default_exponent );
+gsb_real gsb_real_safe_real_from_string ( const gchar *string );
+gchar *gsb_real_safe_real_to_string ( gsb_real number, gint default_exponent );
void gsb_real_set_decimal_point ( const gchar *decimal_point );
void gsb_real_set_thousands_sep ( const gchar *thousands_sep );
gsb_real gsb_real_sub ( gsb_real number_1,
diff --git a/src/navigation.c b/src/navigation.c
index 4f08a5c..1d3e7e3 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -298,7 +298,7 @@ GtkWidget * create_navigation_pane ( void )
NAVIGATION_TEXT, _("Credits simulator"),
NAVIGATION_PIX_VISIBLE, TRUE,
NAVIGATION_FONT, 800,
- NAVIGATION_PAGE, GSB_GENERAL_FINANCIAL_PAGE,
+ NAVIGATION_PAGE, GSB_SIMULATOR_PAGE,
NAVIGATION_ACCOUNT, -1,
NAVIGATION_REPORT, -1,
NAVIGATION_SENSITIVE, 1,
@@ -1193,7 +1193,7 @@ gboolean gsb_gui_navigation_select_line ( GtkTreeSelection *selection,
payee_fill_tree ();
break;
- case GSB_GENERAL_FINANCIAL_PAGE:
+ case GSB_SIMULATOR_PAGE:
notice_debug ("Credits simulator page selected");
/* set the title */
diff --git a/src/parametres.c b/src/parametres.c
index 3c104c2..5eb667a 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -34,6 +34,8 @@
#include "affichage.h"
#include "affichage_liste.h"
#include "bet_config.h"
+#include "bet_data.h"
+#include "bet_finance_ui.h"
#include "categories_onglet.h"
#include "dialog.h"
#include "fenetre_principale.h"
@@ -70,7 +72,6 @@
static GtkWidget * create_preferences_tree ( );
static GtkWidget *gsb_config_scheduler_page ( void );
static gboolean gsb_config_scheduler_switch_balances_with_scheduled ( void );
-static void gsb_config_update_affichage ( gint type_maj );
static gboolean gsb_gui_delete_msg_toggled ( GtkCellRendererToggle *cell, gchar *path_str,
GtkTreeModel * model );
static gboolean gsb_gui_messages_toggled ( GtkCellRendererToggle *cell, gchar *path_str,
@@ -80,6 +81,7 @@ static gboolean gsb_localisation_format_date_toggle ( GtkToggleButton *togglebut
GdkEventButton *event,
gpointer user_data);
static void gsb_localisation_thousands_sep_changed ( GtkComboBox *widget, gpointer user_data );
+static void gsb_localisation_update_affichage ( gint type_maj );
static GtkWidget *onglet_delete_messages ( void );
static GtkWidget *onglet_fichier ( void );
static GtkWidget *onglet_localisation ( void );
@@ -108,6 +110,7 @@ static gint width_spin_button = 50;
/*START_EXTERN*/
+extern GtkWidget *account_page;
extern gboolean balances_with_scheduled;
extern struct conditional_message delete_msg[];
extern gboolean execute_scheduled_of_month;
@@ -1347,7 +1350,7 @@ gboolean gsb_localisation_format_date_toggle ( GtkToggleButton *togglebutton,
if ( GPOINTER_TO_INT ( user_data ) == GTK_ORIENTATION_HORIZONTAL )
return FALSE;
- gsb_config_update_affichage ( 0 );
+ gsb_localisation_update_affichage ( 0 );
return FALSE;
}
@@ -1486,7 +1489,7 @@ void gsb_localisation_decimal_point_changed ( GtkComboBox *widget, gpointer user
if ( GPOINTER_TO_INT ( user_data ) == GTK_ORIENTATION_HORIZONTAL )
return;
- gsb_config_update_affichage ( 1 );
+ gsb_localisation_update_affichage ( 1 );
}
@@ -1534,7 +1537,7 @@ void gsb_localisation_thousands_sep_changed ( GtkComboBox *widget, gpointer user
if ( GPOINTER_TO_INT ( user_data ) == GTK_ORIENTATION_HORIZONTAL )
return;
- gsb_config_update_affichage ( 1 );
+ gsb_localisation_update_affichage ( 1 );
}
@@ -1544,7 +1547,7 @@ void gsb_localisation_thousands_sep_changed ( GtkComboBox *widget, gpointer user
*\param type_maj 0 = ELEMENT_DATE 1 = ELEMENT_CREDIT && ELEMENT_DEBIT
*
* */
-void gsb_config_update_affichage ( gint type_maj )
+void gsb_localisation_update_affichage ( gint type_maj )
{
gint current_page;
@@ -1574,6 +1577,36 @@ void gsb_config_update_affichage ( gint type_maj )
gsb_transactions_list_update_tree_view ( gsb_gui_navigation_get_current_account ( ), FALSE );
}
+ /* update home page */
+ if ( current_page == GSB_ACCOUNT_PAGE )
+ {
+ gint account_number;
+ gint account_current_page;
+ kind_account kind;
+
+ account_number = gsb_gui_navigation_get_current_account ( );
+ account_current_page = gtk_notebook_get_current_page ( GTK_NOTEBOOK ( account_page ) );
+
+ kind = gsb_data_account_get_kind ( account_number );
+ switch ( kind )
+ {
+ case GSB_TYPE_BANK:
+ case GSB_TYPE_CASH:
+ if ( account_current_page == 1 || account_current_page == 2 )
+ {
+ gsb_data_account_set_bet_maj ( account_number, BET_MAJ_ALL );
+ bet_data_update_bet_module ( account_number, -1 );
+ }
+ break;
+ case GSB_TYPE_LIABILITIES:
+ if ( account_current_page == 3 )
+ bet_finance_ui_update_amortization_tab ( account_number );
+ break;
+ case GSB_TYPE_ASSET:
+ break;
+ }
+ }
+
/* update payees, categories and budgetary lines */
if ( current_page == GSB_PAYEES_PAGE )
payee_fill_tree ( );
@@ -1581,6 +1614,11 @@ void gsb_config_update_affichage ( gint type_maj )
remplit_arbre_categ ( );
else if ( current_page == GSB_BUDGETARY_LINES_PAGE )
remplit_arbre_imputation ( );
+
+ /* update simulator page */
+ if ( current_page == GSB_SIMULATOR_PAGE )
+ bet_finance_switch_simulator_page ( );
+
}
diff --git a/src/utils_str.c b/src/utils_str.c
index 1b53ca3..bf9b3f3 100644
--- a/src/utils_str.c
+++ b/src/utils_str.c
@@ -928,21 +928,31 @@ gdouble utils_str_safe_strtod ( const gchar *str_number, gchar **endptr )
* */
gdouble utils_str_strtod ( const gchar *str_number, gchar **endptr )
{
- gchar *mon_thousands_sep;
+ gchar *p, *q;
gdouble number;
if ( str_number == NULL )
return 0.0;
- mon_thousands_sep = gsb_real_get_thousands_sep ( );
-
- /* on supprime le séparateur des milliers */
- if ( mon_thousands_sep && g_strrstr ( str_number, mon_thousands_sep ) )
- str_number = my_strdelimit ( str_number, mon_thousands_sep, "" );
+ /* on supprime les espaces si necessaires */
+ if ( g_strrstr ( str_number, " " ) )
+ str_number = my_strdelimit ( str_number, " ", "" );
/* on met le . comme séparateur décimal */
- if ( g_strrstr ( str_number, "," ) )
- str_number = my_strdelimit ( str_number, ",", "." );
+ if ( ( p = g_strrstr ( str_number, "," ) ) )
+ {
+ if ( ( q = g_strrstr ( str_number, "." ) ) == NULL )
+ str_number = my_strdelimit ( str_number, ",", "." );
+ else if ( p - q > 0 )
+ {
+ str_number = my_strdelimit ( str_number, ".", "" );
+ str_number = my_strdelimit ( str_number, ",", "." );
+ }
+ else
+ {
+ str_number = my_strdelimit ( str_number, ",", "" );
+ }
+ }
number = g_ascii_strtod ( str_number, endptr);
diff --git a/win32-msvc/prepare_Win32.cmd b/win32-msvc/prepare_Win32.cmd
index 1a83bd6..79cfa81 100644
--- a/win32-msvc/prepare_Win32.cmd
+++ b/win32-msvc/prepare_Win32.cmd
@@ -4,7 +4,7 @@
:: Get this file name from http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.18/
:: Specify the BUNDLE file
:: Don't include the extension
-SET GTK_DEV_FILE_BASENAME=gtk+-bundle_2.18.7-20100213_win32
+SET GTK_DEV_FILE_BASENAME=gtk+-bundle_2.22.0-20101016_win32
:: The rest of the script should do the rest
@@ -46,7 +46,7 @@ MOVE plugins-dev\%ICONV_FILE_BASENAME% plugins-dev\iconv
PAUSE
:: Download and install openssl, copy the required files in the right place
-SET OPENSSL_FILE_BASENAME=Win32OpenSSL-0_9_8o
+SET OPENSSL_FILE_BASENAME=Win32OpenSSL-1_0_0c
cd %DOWNLOADS_DIR%
wget -nc -c http://www.slproweb.com/download/%OPENSSL_FILE_BASENAME%.exe
IF NOT EXIST "C:\OpenSSL\readme.txt" (
hooks/post-receive
--
grisbi
More information about the cvs
mailing list