[grisbi-cvs] [SCM] grisbi branch, master, updated. 21b73e746529243b3c7b14bf13c664e29e912c91
Pierre Biava
nobody at users.sourceforge.net
Sun Jul 4 16:18:57 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 21b73e746529243b3c7b14bf13c664e29e912c91 (commit)
via bf89cf148246eb2d6f7943db6d31dd73565a67e8 (commit)
via 98fc57a7d6a22f36957602e512ba00bc0155ac65 (commit)
via b3b926ad995e317ed9a000088b1493ac9abf7934 (commit)
via 9622bb6d05305737f1ba6b958ba0ee88543bf9c3 (commit)
via 9ccc8321f2cd77c076ef30cab345b9d6d55bbaea (commit)
via ef39a81ee7b2f35cd3f1832942f54c8db3a7db9a (commit)
via 78dca5dbafdfdd6833cd9a4cb1a3290e80752a4a (commit)
from ac76dcc70def6d90310dcf0e6b38d3be08237b0f (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 21b73e746529243b3c7b14bf13c664e29e912c91
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Jul 4 16:17:59 2010 +0200
Fixed adding and deleting payees in a combofix
commit bf89cf148246eb2d6f7943db6d31dd73565a67e8
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Jul 4 16:16:38 2010 +0200
minor correction
commit 98fc57a7d6a22f36957602e512ba00bc0155ac65
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Jul 4 16:14:15 2010 +0200
Corrects a warning to the execution in function update_transaction_in_tree ()
commit b3b926ad995e317ed9a000088b1493ac9abf7934
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Jul 4 08:40:01 2010 +0200
Remove the destruction and the reconstruction of the form for each change of account
commit 9622bb6d05305737f1ba6b958ba0ee88543bf9c3
Merge: 9ccc8321f2cd77c076ef30cab345b9d6d55bbaea ac76dcc70def6d90310dcf0e6b38d3be08237b0f
Author: pbiava <pierre.biava at nerim.net>
Date: Fri Jul 2 06:35:20 2010 +0200
Merge branch 'master' of ssh://grisbi.git.sourceforge.net/gitroot/grisbi/grisbi
commit 9ccc8321f2cd77c076ef30cab345b9d6d55bbaea
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jul 1 22:26:00 2010 +0200
removes a warning to the execution of grisbi
commit ef39a81ee7b2f35cd3f1832942f54c8db3a7db9a
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jul 1 22:23:21 2010 +0200
update string
commit 78dca5dbafdfdd6833cd9a4cb1a3290e80752a4a
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Jul 1 22:20:18 2010 +0200
mise en forme
-----------------------------------------------------------------------
Changes:
diff --git a/po/fr.po b/po/fr.po
index e571d4e..8e8051c 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8462,7 +8462,7 @@ msgstr "Voulez vous vraiment supprimer l'opération avec le tiers « %s » ?"
#. use transaction as template
#: ../src/gsb_transactions_list.c:2188
msgid "Use selected transaction as a template"
-msgstr "Utiliser l'opération séléctionnée comme modèle"
+msgstr "Utiliser l'opération sélectionnée comme modèle"
#. Clone transaction
#: ../src/gsb_transactions_list.c:2198
diff --git a/src/gsb_data_account.c b/src/gsb_data_account.c
index 33c50a4..60409cb 100644
--- a/src/gsb_data_account.c
+++ b/src/gsb_data_account.c
@@ -1204,12 +1204,17 @@ gint gsb_data_account_get_element_sort ( gint account_number,
||
no_column > CUSTOM_MODEL_VISIBLE_COLUMNS )
{
- /* TODO dOm : the return value of g_strdup_printf was not used ! I add the devel_debug to print it. Is it OK to do that ?*/
- gchar* tmpstr = g_strdup_printf ( _("Bad no column to gsb_data_account_get_element_sort () in data_account.c\nno_column = %d\n" ),
- no_column );
- devel_debug (tmpstr);
- g_free(tmpstr);
- return FALSE;
+ gchar* tmpstr;
+
+ /* TODO dOm : the return value of g_strdup_printf was not used !
+ I add the devel_debug to print it. Is it OK to do that ? */
+ tmpstr = g_strdup_printf ( _("Bad no column to gsb_data_account_get_element_sort () "
+ "in data_account.c\nno_column = %d\n" ),
+ no_column );
+ devel_debug (tmpstr);
+ g_free(tmpstr);
+
+ return FALSE;
}
account = gsb_data_account_get_structure ( account_number );
@@ -1242,10 +1247,16 @@ gboolean gsb_data_account_set_element_sort ( gint account_number,
||
no_column > CUSTOM_MODEL_VISIBLE_COLUMNS )
{
- /* TODO dOm : the value of g_strdup_printf was not used. I add the devel_debug function to print it. Is it OK ? */
- gchar* tmpstr = g_strdup_printf ( _("Bad no column to gsb_data_account_set_element_sort () in data_account.c\nno_column = %d\n" ), no_column );
+ gchar* tmpstr;
+
+ /* TODO dOm : the value of g_strdup_printf was not used.
+ I add the devel_debug function to print it. Is it OK ? */
+ tmpstr = g_strdup_printf ( _("Bad no column to gsb_data_account_set_element_sort () "
+ "in data_account.c\nno_column = %d\n" ),
+ no_column );
devel_debug ( tmpstr );
g_free (tmpstr);
+
return FALSE;
}
diff --git a/src/gsb_data_payee.c b/src/gsb_data_payee.c
index f379724..0eb5159 100644
--- a/src/gsb_data_payee.c
+++ b/src/gsb_data_payee.c
@@ -245,13 +245,21 @@ gint gsb_data_payee_new ( const gchar *name )
{
struct_payee *payee;
- payee = g_malloc0 ( sizeof ( struct_payee ));
+ payee = g_malloc0 ( sizeof ( struct_payee ) );
payee -> payee_number = gsb_data_payee_max_number () + 1;
- if (name)
- payee -> payee_name = my_strdup (name);
+ if ( name )
+ {
+ GtkWidget *combofix;
+
+ payee -> payee_name = my_strdup ( name );
+ combofix = gsb_form_widget_get_widget ( TRANSACTION_FORM_PARTY );
+
+ if ( combofix && name )
+ gtk_combofix_append_text ( GTK_COMBOFIX ( combofix ), name );
+ }
else
- payee -> payee_name = NULL;
+ payee -> payee_name = NULL;
payee_list = g_slist_append ( payee_list, payee );
@@ -289,12 +297,17 @@ static void _gsb_data_payee_free ( struct_payee* payee)
gboolean gsb_data_payee_remove ( gint no_payee )
{
struct_payee *payee;
+ GtkWidget *combofix;
payee = gsb_data_payee_get_structure ( no_payee );
if (!payee)
- return FALSE;
-
+ return FALSE;
+
+ combofix = gsb_form_widget_get_widget ( TRANSACTION_FORM_PARTY );
+ if ( combofix )
+ gtk_combofix_remove_text ( GTK_COMBOFIX ( combofix ), payee -> payee_name );
+
payee_list = g_slist_remove ( payee_list,
payee );
_gsb_data_payee_free (payee);
@@ -360,7 +373,7 @@ gint gsb_data_payee_get_number_by_name ( const gchar *name,
{
payee_number = gsb_data_payee_new (name);
gtk_combofix_append_text ( GTK_COMBOFIX (
- gsb_form_widget_get_widget ( TRANSACTION_FORM_BUDGET ) ), name );
+ gsb_form_widget_get_widget ( TRANSACTION_FORM_PARTY ) ), name );
;
}
}
@@ -428,9 +441,9 @@ gboolean gsb_data_payee_set_name ( gint no_payee,
payee = gsb_data_payee_get_structure ( no_payee );
if (!payee)
- return FALSE;
+ return FALSE;
- combofix = gsb_form_widget_get_widget ( TRANSACTION_FORM_BUDGET );
+ combofix = gsb_form_widget_get_widget ( TRANSACTION_FORM_PARTY );
/* we free the last name */
if ( payee -> payee_name )
diff --git a/src/gsb_data_transaction.c b/src/gsb_data_transaction.c
index 14152ce..60e91a3 100644
--- a/src/gsb_data_transaction.c
+++ b/src/gsb_data_transaction.c
@@ -2593,6 +2593,8 @@ gint gsb_data_transaction_check_content_payment ( gint payment_number,
if ( transaction -> method_of_payment_number == payment_number
&&
+ transaction -> method_of_payment_content
+ &&
g_ascii_strcasecmp (transaction -> method_of_payment_content, number ) == 0 )
return transaction -> transaction_number;
diff --git a/src/gsb_form.c b/src/gsb_form.c
index 885c1a8..d2ff745 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -97,7 +97,6 @@ static gboolean gsb_form_get_categories ( gint transaction_number,
gboolean is_transaction );
static gboolean gsb_form_hide ( void );
static gboolean gsb_form_initialise_transaction_form ( void );
-static void gsb_form_set_current_date_into_date_entry ( void );
static gboolean gsb_form_size_allocate ( GtkWidget *widget,
GtkAllocation *allocation,
gpointer null );
@@ -302,7 +301,6 @@ void gsb_form_create_widgets ( void )
gsb_form_initialise_transaction_form ( );
-
/* the buttons part is a hbox, with the recuperate child split
* on the left and valid/cancel on the right */
form_button_part = gtk_vbox_new ( FALSE, 0 );
@@ -1027,20 +1025,19 @@ gboolean gsb_form_show ( gboolean show )
break;
case ORIGIN_VALUE_SCHEDULED:
- gsb_form_scheduler_set_frequency (2);
- gtk_widget_show (form_scheduled_part);
+ gsb_form_scheduler_set_frequency ( 2 );
+ gtk_widget_show ( form_scheduled_part );
break;
default:
- gtk_widget_hide (form_scheduled_part);
+ gtk_widget_hide ( form_scheduled_part );
}
- gsb_form_fill_from_account (origin);
- gtk_widget_show (form_transaction_part);
+ gsb_form_fill_from_account ( origin );
+ gtk_widget_show ( form_transaction_part );
if ( ! gsb_form_is_visible ( ) && show )
- gtk_expander_set_expanded (GTK_EXPANDER (form_expander),
- TRUE );
+ gtk_expander_set_expanded (GTK_EXPANDER (form_expander), TRUE );
return FALSE;
}
@@ -1176,7 +1173,6 @@ gboolean gsb_form_fill_from_account ( gint account_number )
{
gint row, column;
gint rows_number, columns_number;
- gint form_account_number;
devel_debug_int (account_number);
@@ -1195,8 +1191,41 @@ gboolean gsb_form_fill_from_account ( gint account_number )
break;
}
- gsb_form_clean ( account_number );
+ /* if each account has a separate form, get it here,
+ * else, get the form of the first account */
+
+ rows_number = gsb_data_form_get_nb_rows ( account_number );
+ columns_number = gsb_data_form_get_nb_columns ( account_number );
+
+ for ( row=0 ; row < rows_number ; row++ )
+ for ( column=0 ; column < columns_number ; column++ )
+ {
+ GtkWidget *widget;
+ gint element = gsb_data_form_get_value ( account_number, column, row );
+
+ widget = gsb_form_widget_get_widget ( element );
+
+ if ( !widget )
+ continue;
+
+ /* We want to show all the widgets that are independent of operations and put
+ * the means of payment in accordance with the type of account */
+ if ( element == TRANSACTION_FORM_TYPE )
+ {
+ if ( gsb_data_account_get_default_credit ( account_number ) == 0 )
+ gtk_widget_hide ( widget );
+ else
+ gsb_payment_method_create_combo_list ( widget,
+ GSB_PAYMENT_DEBIT,
+ account_number, 0 );
+ }
+ else if ( element != TRANSACTION_FORM_CONTRA
+ &&
+ element != TRANSACTION_FORM_CHEQUE )
+ gtk_widget_show (widget);
+ }
+ gsb_form_clean (account_number);
return FALSE;
}
@@ -1234,17 +1263,13 @@ gboolean gsb_form_clean ( gint account_number )
switch (element -> element_number)
{
case TRANSACTION_FORM_DATE:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
- gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Date") );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
+ gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ), _("Date") );
break;
case TRANSACTION_FORM_VALUE_DATE:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
- gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Value date") );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
+ gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ), _("Value date") );
break;
case TRANSACTION_FORM_EXERCICE:
@@ -1253,37 +1278,28 @@ gboolean gsb_form_clean ( gint account_number )
gsb_fyear_update_fyear_list ();
/* set the combo_box on 'Automatic' */
- gsb_fyear_set_combobox_history ( element -> element_widget,
- 0 );
+ gsb_fyear_set_combobox_history ( element -> element_widget, 0 );
- gtk_widget_set_sensitive ( GTK_WIDGET ( element -> element_widget ),
- FALSE );
+ gtk_widget_set_sensitive ( GTK_WIDGET ( element -> element_widget ), FALSE );
break;
case TRANSACTION_FORM_PARTY:
- gsb_form_widget_set_empty ( GTK_COMBOFIX ( element -> element_widget ) -> entry,
- TRUE );
- gtk_combofix_set_text ( GTK_COMBOFIX ( element -> element_widget ),
- _("Payee") );
+ gsb_form_widget_set_empty ( GTK_COMBOFIX ( element -> element_widget ) -> entry, TRUE );
+ gtk_combofix_set_text ( GTK_COMBOFIX ( element -> element_widget ), _("Payee") );
break;
case TRANSACTION_FORM_DEBIT:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
- gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Debit") );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
+ gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ), _("Debit") );
break;
case TRANSACTION_FORM_CREDIT:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
- gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Credit") );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
+ gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ), _("Credit") );
break;
case TRANSACTION_FORM_CATEGORY:
- gsb_form_widget_set_empty ( GTK_COMBOFIX ( element -> element_widget ) -> entry,
- TRUE );
+ gsb_form_widget_set_empty ( GTK_COMBOFIX ( element -> element_widget ) -> entry, TRUE );
gtk_combofix_set_text ( GTK_COMBOFIX ( element -> element_widget ),
_("Categories : Sub-categories") );
break;
@@ -1292,24 +1308,19 @@ gboolean gsb_form_clean ( gint account_number )
break;
case TRANSACTION_FORM_BUDGET:
- gsb_form_widget_set_empty ( GTK_COMBOFIX ( element -> element_widget ) -> entry,
- TRUE );
- gtk_combofix_set_text ( GTK_COMBOFIX ( element -> element_widget ),
- _("Budgetary line") );
+ gsb_form_widget_set_empty ( GTK_COMBOFIX ( element -> element_widget ) -> entry, TRUE );
+ gtk_combofix_set_text ( GTK_COMBOFIX ( element -> element_widget ), _("Budgetary line") );
break;
case TRANSACTION_FORM_NOTES:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
- gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Notes") );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
+ gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ), _("Notes") );
break;
case TRANSACTION_FORM_TYPE:
gsb_payment_method_set_combobox_history ( element -> element_widget,
- gsb_data_account_get_default_debit (account_number));
- gtk_widget_set_sensitive ( GTK_WIDGET ( element -> element_widget ),
- FALSE );
+ gsb_data_account_get_default_debit ( account_number ) );
+ gtk_widget_set_sensitive ( GTK_WIDGET ( element -> element_widget ), FALSE );
break;
case TRANSACTION_FORM_CONTRA:
@@ -1317,17 +1328,21 @@ gboolean gsb_form_clean ( gint account_number )
break;
case TRANSACTION_FORM_CHEQUE:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Cheque/Transfer number") );
+ _("Cheque/Transfer number") );
break;
case TRANSACTION_FORM_DEVISE:
+ g_signal_handlers_block_by_func ( G_OBJECT ( element -> element_widget ),
+ G_CALLBACK ( gsb_form_transaction_currency_changed ),
+ NULL );
gsb_currency_set_combobox_history ( element -> element_widget,
- gsb_data_account_get_currency (account_number));
- gtk_widget_set_sensitive ( GTK_WIDGET ( element -> element_widget ),
- FALSE );
+ gsb_data_account_get_currency ( account_number ) );
+ gtk_widget_set_sensitive ( GTK_WIDGET ( element -> element_widget ), FALSE );
+ g_signal_handlers_unblock_by_func ( G_OBJECT ( element -> element_widget ),
+ G_CALLBACK ( gsb_form_transaction_currency_changed ),
+ NULL );
break;
case TRANSACTION_FORM_CHANGE:
@@ -1335,42 +1350,34 @@ gboolean gsb_form_clean ( gint account_number )
break;
case TRANSACTION_FORM_BANK:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
- gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Bank references") );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
+ gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ), _("Bank references") );
break;
case TRANSACTION_FORM_VOUCHER:
- gsb_form_widget_set_empty ( element -> element_widget,
- TRUE );
- gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ),
- _("Voucher") );
+ gsb_form_widget_set_empty ( element -> element_widget, TRUE );
+ gtk_entry_set_text ( GTK_ENTRY ( element -> element_widget ), _("Voucher") );
break;
case TRANSACTION_FORM_OP_NB:
- gtk_label_set_text ( GTK_LABEL ( element -> element_widget ),
- NULL );
+ gtk_label_set_text ( GTK_LABEL ( element -> element_widget ), NULL );
break;
case TRANSACTION_FORM_MODE:
- gtk_label_set_text ( GTK_LABEL ( element -> element_widget ),
- NULL );
+ gtk_label_set_text ( GTK_LABEL ( element -> element_widget ), NULL );
break;
}
}
tmp_list = tmp_list -> next;
}
- g_object_set_data ( G_OBJECT ( transaction_form ),
- "transaction_number_in_form",
- NULL );
+ g_object_set_data ( G_OBJECT ( transaction_form ), "transaction_number_in_form", NULL );
/* don't show the recover button */
- gtk_widget_hide (form_button_recover_split);
+ gtk_widget_hide ( form_button_recover_split );
/* unsensitive the valid and cancel buttons */
- gtk_widget_set_sensitive (GTK_WIDGET (form_button_valid), FALSE);
- gtk_widget_set_sensitive (GTK_WIDGET (form_button_cancel), FALSE);
+ gtk_widget_set_sensitive ( GTK_WIDGET ( form_button_valid ), FALSE );
+ gtk_widget_set_sensitive ( GTK_WIDGET ( form_button_cancel ), FALSE );
return FALSE;
}
@@ -1413,25 +1420,23 @@ gboolean gsb_form_entry_get_focus ( GtkWidget *entry )
/* the entry can be a combofix or a real entry */
if (GTK_IS_COMBOFIX ( entry ))
{
- if ( gsb_form_widget_check_empty (GTK_COMBOFIX (entry) -> entry))
+ if ( gsb_form_widget_check_empty (GTK_COMBOFIX ( entry ) -> entry ) )
{
- gtk_combofix_set_text ( GTK_COMBOFIX (entry), "" );
- gsb_form_widget_set_empty ( GTK_COMBOFIX (entry) -> entry,
- FALSE );
+ gtk_combofix_set_text ( GTK_COMBOFIX ( entry ), "" );
+ gsb_form_widget_set_empty ( GTK_COMBOFIX ( entry) -> entry, FALSE );
}
}
else
{
- if ( gsb_form_widget_check_empty (entry) )
+ if ( gsb_form_widget_check_empty ( entry ) )
{
- gtk_entry_set_text ( GTK_ENTRY (entry), "" );
- gsb_form_widget_set_empty ( entry,
- FALSE );
+ gtk_entry_set_text ( GTK_ENTRY ( entry ), "" );
+ gsb_form_widget_set_empty ( entry, FALSE );
}
}
/* sensitive the valid and cancel buttons */
- gtk_widget_set_sensitive (GTK_WIDGET (form_button_valid), TRUE);
- gtk_widget_set_sensitive (GTK_WIDGET (form_button_cancel), TRUE);
+ gtk_widget_set_sensitive ( GTK_WIDGET ( form_button_valid ), TRUE );
+ gtk_widget_set_sensitive ( GTK_WIDGET ( form_button_cancel ), TRUE );
return FALSE;
}
@@ -1738,8 +1743,7 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
gtk_entry_set_text ( GTK_ENTRY ( entry ), string );
break;
}
- gsb_form_widget_set_empty ( entry,
- TRUE );
+ gsb_form_widget_set_empty ( entry, TRUE );
}
return FALSE;
}
@@ -2005,6 +2009,12 @@ gboolean gsb_form_key_press_event ( GtkWidget *widget,
ev -> keyval == GDK_KP_Enter ))
ev->keyval = GDK_Tab ;
+ if (!g_object_get_data (G_OBJECT (transaction_form), "transaction_number_in_form"))
+ /* set the new transaction number */
+ g_object_set_data ( G_OBJECT ( transaction_form ),
+ "transaction_number_in_form",
+ GINT_TO_POINTER ( -1 ) );
+
switch ( ev -> keyval )
{
case GDK_1:
@@ -2261,7 +2271,7 @@ gboolean gsb_form_finish_edition ( void )
devel_debug (NULL);
- /* get the number of the transaction, stored in the form (<0 if new) */
+ /* get the number of the transaction, stored in the form (< 0 if new ) */
transaction_number = GPOINTER_TO_INT (g_object_get_data ( G_OBJECT ( transaction_form ),
"transaction_number_in_form" ));
@@ -2576,7 +2586,7 @@ gboolean gsb_form_finish_edition ( void )
transaction_list_get_variance ( gsb_data_account_get_current_transaction_number (
account_number ) ) )
transaction_list_select ( mother_number );
-
+
/* if it was a modification of transaction, we need to update the sort and colors
* (done automatically for new transaction) */
if ( !new_transaction && !execute_scheduled )
@@ -2598,9 +2608,19 @@ gboolean gsb_form_finish_edition ( void )
if ( etat.modification_fichier == 0 )
modification_fichier ( TRUE );
- gsb_form_escape_form ( );
- gsb_form_set_current_date_into_date_entry ( );
- gsb_form_widget_set_focus ( TRANSACTION_FORM_DATE );
+ /* If the origin of the operation is a model, so we select the new transaction */
+ if ( GPOINTER_TO_INT (g_object_get_data ( G_OBJECT ( transaction_form ),
+ "transaction_selected_in_form" ) ) == -1 )
+ {
+ transaction_list_select ( transaction_number );
+ return FALSE;
+ }
+
+ /* give the focus to the date widget */
+ if ( is_transaction )
+ gsb_form_widget_set_focus ( TRANSACTION_FORM_DATE );
+ else
+ gsb_scheduler_list_edit_transaction (gsb_scheduler_list_get_current_scheduled_number ());
return FALSE;
}
@@ -3151,9 +3171,9 @@ gboolean gsb_form_get_categories ( gint transaction_number,
{
gint transaction_number_tmp;
- transaction_number_tmp = GPOINTER_TO_INT (children_list -> data);
+ transaction_number_tmp = GPOINTER_TO_INT ( save_children_list -> data );
- if (is_transaction)
+ if ( is_transaction )
gsb_transactions_list_delete_transaction (transaction_number_tmp, FALSE);
else
gsb_scheduler_list_delete_scheduled_transaction (transaction_number_tmp,
@@ -3162,7 +3182,8 @@ gboolean gsb_form_get_categories ( gint transaction_number,
save_children_list = save_children_list -> next;
}
while ( save_children_list );
- g_slist_free ( children_list );
+
+ g_slist_free (save_children_list);
}
gsb_data_mix_set_split_of_transaction ( transaction_number,
0, is_transaction );
@@ -3490,32 +3511,6 @@ GtkWidget *gsb_form_get_element_widget_from_list ( gint element_number,
/**
- *
- *
- *
- *
- * */
-void gsb_form_set_current_date_into_date_entry ( void )
-{
- GtkWidget *date_entry;
-
- date_entry = gsb_form_widget_get_widget ( TRANSACTION_FORM_DATE );
- if ( gsb_form_widget_check_empty ( date_entry )
- ||
- strlen ( gtk_entry_get_text ( GTK_ENTRY ( date_entry ) ) ) == 0 )
- {
- if ( save_form_date )
- gtk_entry_set_text ( GTK_ENTRY ( date_entry ),
- gsb_format_gdate ( save_form_date ) );
- else
- gtk_entry_set_text ( GTK_ENTRY ( date_entry ),
- gsb_date_today ( ) );
-
- gsb_form_widget_set_empty ( date_entry, FALSE );
- }
-}
-
-/**
* initialise le formulaire
*
* \param
diff --git a/src/gtk_combofix.c b/src/gtk_combofix.c
index 9e9c085..c07f1b9 100644
--- a/src/gtk_combofix.c
+++ b/src/gtk_combofix.c
@@ -1445,7 +1445,6 @@ static gboolean gtk_combofix_key_press_event ( GtkWidget *entry,
gtk_editable_select_region ( GTK_EDITABLE (combofix -> entry), 0, 0 );
}
}
- gtk_combofix_append_text ( combofix, gtk_entry_get_text ( GTK_ENTRY ( combofix -> entry ) ) );
/* le traitement de ENTER est fait dans le formulaire */
return FALSE;
break;
diff --git a/src/metatree.c b/src/metatree.c
index fbb486e..be173ed 100644
--- a/src/metatree.c
+++ b/src/metatree.c
@@ -86,12 +86,12 @@ static gboolean metatree_get_row_properties ( GtkTreeModel * tree_model, GtkTree
gchar ** text, gint * no_div, gint * no_sub_div,
gint * no_transaction, gint * data );
static enum meta_tree_row_type metatree_get_row_type ( GtkTreeModel * tree_model,
- GtkTreePath * path );
+ GtkTreePath * path );
static gboolean metatree_model_is_displayed ( GtkTreeModel * model );
static void metatree_new_sub_division ( GtkTreeModel * model, gint div_id );
static void metatree_remove_iter_and_select_next ( GtkTreeView * tree_view,
GtkTreeModel * model,
- GtkTreeIter * iter );
+ GtkTreeIter * iter );
static void move_all_sub_divisions_to_division ( GtkTreeModel *model,
gint orig_division,
gint dest_division );
@@ -210,7 +210,7 @@ gboolean metatree_get_row_properties ( GtkTreeModel * tree_model, GtkTreePath *
* \return Type of entry.
*/
enum meta_tree_row_type metatree_get_row_type ( GtkTreeModel * tree_model,
- GtkTreePath * path )
+ GtkTreePath * path )
{
gint no_div, no_sub_div, no_transaction;
@@ -2124,12 +2124,17 @@ void update_transaction_in_tree ( MetatreeInterface * iface,
GtkTreeModel * model,
gint transaction_number )
{
- GtkTreeIter * transaction_iter, * sub_div_iter = NULL, * div_iter;
- GtkTreePath * div_path, * sub_div_path, * transaction_path;
- gint div_id, sub_div_id;
-
- if ( !transaction_number || ! metatree_model_is_displayed ( model ) )
- return;
+ GtkTreeIter *transaction_iter;
+ GtkTreeIter *div_iter;
+ GtkTreeIter *sub_div_iter = NULL;
+ GtkTreePath *transaction_path;
+ GtkTreePath *div_path;
+ GtkTreePath *sub_div_path = NULL;
+ gint div_id;
+ gint sub_div_id;
+
+ if ( !transaction_number || !metatree_model_is_displayed ( model ) )
+ return;
div_id = iface -> transaction_div_id (transaction_number);
sub_div_id = iface -> transaction_sub_div_id (transaction_number);
@@ -2138,27 +2143,27 @@ void update_transaction_in_tree ( MetatreeInterface * iface,
div_iter = get_iter_from_div ( model, div_id, 0 );
if ( div_iter )
{
- fill_division_row ( model, iface, div_iter, div_id );
+ fill_division_row ( model, iface, div_iter, div_id );
}
else
{
- metatree_fill_new_division ( iface, model, div_id );
- div_iter = get_iter_from_div ( model, div_id, 0 );
+ metatree_fill_new_division ( iface, model, div_id );
+ div_iter = get_iter_from_div ( model, div_id, 0 );
}
/* Fill in sub-division if existing. */
if ( iface -> depth != 1 )
{
- sub_div_iter = get_iter_from_div ( model, div_id, sub_div_id );
- if ( sub_div_iter )
- {
- fill_sub_division_row ( model, iface, sub_div_iter, div_id, sub_div_id );
- }
- else
- {
- metatree_fill_new_sub_division ( iface, model, div_id, sub_div_id );
- sub_div_iter = get_iter_from_div ( model, div_id, sub_div_id );
- }
+ sub_div_iter = get_iter_from_div ( model, div_id, sub_div_id );
+ if ( sub_div_iter )
+ {
+ fill_sub_division_row ( model, iface, sub_div_iter, div_id, sub_div_id );
+ }
+ else
+ {
+ metatree_fill_new_sub_division ( iface, model, div_id, sub_div_id );
+ sub_div_iter = get_iter_from_div ( model, div_id, sub_div_id );
+ }
}
/* Fill in transaction if existing. */
@@ -2166,16 +2171,17 @@ void update_transaction_in_tree ( MetatreeInterface * iface,
if ( transaction_iter )
{
- div_path = gtk_tree_model_get_path ( model, div_iter );
- sub_div_path = gtk_tree_model_get_path ( model, sub_div_iter );
- transaction_path = gtk_tree_model_get_path ( model, transaction_iter );
- if ( ( iface -> depth != 1 &&
- ! gtk_tree_path_is_ancestor ( sub_div_path, transaction_path ) ) ||
- ! gtk_tree_path_is_ancestor ( div_path, transaction_path ) )
- {
- gtk_tree_store_remove ( GTK_TREE_STORE(model), transaction_iter );
- transaction_iter = NULL;
- }
+ div_path = gtk_tree_model_get_path ( model, div_iter );
+ if ( sub_div_iter )
+ sub_div_path = gtk_tree_model_get_path ( model, sub_div_iter );
+ transaction_path = gtk_tree_model_get_path ( model, transaction_iter );
+ if ( ( iface -> depth != 1 &&
+ ! gtk_tree_path_is_ancestor ( sub_div_path, transaction_path ) ) ||
+ ! gtk_tree_path_is_ancestor ( div_path, transaction_path ) )
+ {
+ gtk_tree_store_remove ( GTK_TREE_STORE(model), transaction_iter );
+ transaction_iter = NULL;
+ }
}
/* If no transaction iter is found, this either means transactions
@@ -2188,7 +2194,7 @@ void update_transaction_in_tree ( MetatreeInterface * iface,
gchar *text;
if ( ! gtk_tree_model_iter_children ( model, &child_iter,
- ( iface -> depth == 1 ? div_iter : sub_div_iter ) ) )
+ ( iface -> depth == 1 ? div_iter : sub_div_iter ) ) )
/* Panic, something went wrong. */
return;
@@ -2200,16 +2206,13 @@ void update_transaction_in_tree ( MetatreeInterface * iface,
if ( text )
{
gtk_tree_store_append ( GTK_TREE_STORE(model), &child_iter,
- ( iface -> depth == 1 ? div_iter : sub_div_iter ) );
+ ( iface -> depth == 1 ? div_iter : sub_div_iter ) );
transaction_iter = &child_iter;
}
}
if ( transaction_iter )
- {
-
- fill_transaction_row ( model, transaction_iter, transaction_number );
- }
+ fill_transaction_row ( model, transaction_iter, transaction_number );
}
@@ -2223,7 +2226,7 @@ void update_transaction_in_tree ( MetatreeInterface * iface,
*/
void metatree_remove_iter_and_select_next ( GtkTreeView * tree_view,
GtkTreeModel * model,
- GtkTreeIter * iter )
+ GtkTreeIter * iter )
{
GtkTreeSelection * selection;
hooks/post-receive
--
grisbi
More information about the cvs
mailing list