rem: gtk_widget_grab_focus ( tree_view_liste_echeances );
add: gtk_widget_grab_focus ( tree_view_scheduler_list );
context: void gsb_scheduler_validate_form ( void ){    gint scheduled_number;    gchar **tab_char;    gint compte_virement;    compte_virement = 0;    if ( !gsb_scheduler_check_form ())	return;    /* get the scheduled transaction, will be NULL if it's a new one */    scheduled_number = GPOINTER_TO_INT (gtk_object_get_data ( GTK_OBJECT ( formulaire_echeancier ),							      "scheduled_number" ));    /* if the label label_saisie_modif is Input, it's a modification or new scheduled transaction,     * else we want to create a transaction from that scheduled transaction */    if ( strcmp ( GTK_LABEL ( label_saisie_modif ) -> label,		  _("Input") ) )    {	/* it's a modification/new scheduled transaction */	/* si c'est une nouvelle échéance, on la crée */	/* et on lui met son numéro tout de suite */	if ( !scheduled_number )	    gsb_data_scheduled_new_scheduled ();	/* récupère la date */	gsb_data_scheduled_set_date ( scheduled_number,				      gsb_parse_date_string (gtk_entry_get_text ( GTK_ENTRY (widget_formulaire_echeancier[SCHEDULER_FORM_DATE]))));	/* récupération du tiers, s'il n'existe pas, on le crée */	if ( gtk_widget_get_style ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_PARTY] ) -> entry ) == style_entree_formulaire[ENCLAIR] )	{	    gsb_data_scheduled_set_party_number ( scheduled_number,						  gsb_data_payee_get_number_by_name ( gtk_combofix_get_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_PARTY])),										      TRUE ));	}	/* récupération du montant */	if ( gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT] ) == style_entree_formulaire[ENCLAIR] )	    gsb_data_scheduled_set_amount ( scheduled_number,					    -calcule_total_entree (widget_formulaire_echeancier[SCHEDULER_FORM_DEBIT]));	else	    gsb_data_scheduled_set_amount ( scheduled_number,					    calcule_total_entree (widget_formulaire_echeancier[SCHEDULER_FORM_CREDIT]));	/* récupération de la devise */	gsb_data_scheduled_set_currency_number ( scheduled_number,						 ((struct struct_devise *)( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_DEVISE] ) -> menu_item ),												  "adr_devise" ))) -> no_devise);	/* récupération du no de compte */	gsb_data_scheduled_set_account_number ( scheduled_number,						recupere_no_compte ( widget_formulaire_echeancier[SCHEDULER_FORM_ACCOUNT]));	/*   récupération des catégories / sous-catég, s'ils n'existent pas, on les crée */	/* s'il n'y a pas de catég, ce n'es pas un virement non plus, donc on met compte_virement à -1 */	if ( gtk_widget_get_style ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY] ) -> entry ) == style_entree_formulaire[ENCLAIR] )	{	    tab_char = g_strsplit ( gtk_combofix_get_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_CATEGORY] )),				    ":",				    2 );	    tab_char[0] = g_strstrip ( tab_char[0] );	    if ( tab_char[1] )		tab_char[1] = g_strstrip ( tab_char[1] );	    if ( strlen ( tab_char[0] ) )	    {		if ( !strcmp ( tab_char[0],			       _("Transfer") )		     && tab_char[1]		     && strlen ( tab_char[1]) )		{		    /* c'est un virement, il n'y a donc aucune catégorie */		    gsb_data_scheduled_set_category_number ( scheduled_number,							     0 );		    gsb_data_scheduled_set_sub_category_number ( scheduled_number,								 0 );		    gsb_data_scheduled_set_breakdown_of_scheduled ( scheduled_number,								    0 );		    /* recherche le no de compte du virement */		    gsb_data_scheduled_set_account_number_transfer ( scheduled_number,								     gsb_data_account_get_no_account_by_name ( tab_char[1] ));		}		else		{		    /* 		    si c'est une opération ventilée, c'est ici que ça se passe ! */		    if ( !strcmp ( tab_char[0],				   _("Breakdown of transaction") ))		    {			/* c'est une ventilation, il n'y a donc aucune catégorie */			/* on va appeler la fonction validation_ope_de_ventilation */			/* qui va créer les nouvelles opé*/			gsb_data_scheduled_set_category_number ( scheduled_number,								 0 );			gsb_data_scheduled_set_sub_category_number ( scheduled_number,								     0 );			gsb_data_scheduled_set_breakdown_of_scheduled ( scheduled_number,									1 );			gsb_data_scheduled_set_account_number_transfer ( scheduled_number,									 0 );		    }		    else		    {			/* it's a normal category */			gsb_data_scheduled_set_category_number ( scheduled_number,								 gsb_data_category_get_number_by_name ( tab_char[0],													TRUE,													gsb_data_scheduled_get_amount (scheduled_number) < 0));			gsb_data_scheduled_set_sub_category_number ( scheduled_number,								     gsb_data_category_get_sub_category_number_by_name ( gsb_data_scheduled_get_category_number (scheduled_number),															 tab_char[1],															 TRUE ));			gsb_data_scheduled_set_breakdown_of_scheduled ( scheduled_number,									0 );			gsb_data_scheduled_set_account_number_transfer ( scheduled_number,									 0 );		    }		}	    }	    g_strfreev ( tab_char );	}	else	    gsb_data_scheduled_set_account_number_transfer ( scheduled_number,							     -1 );	/* récupération du type d'opération */	if ( GTK_WIDGET_VISIBLE ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ))	{	    gsb_data_scheduled_set_method_of_payment_number ( scheduled_number,							      GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_TYPE] ) -> menu_item ),												      "no_type" )));	    if ( GTK_WIDGET_VISIBLE ( widget_formulaire_echeancier[SCHEDULER_FORM_CHEQUE] )		 &&		 gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_CHEQUE] ) == style_entree_formulaire[ENCLAIR] )		gsb_data_scheduled_set_method_of_payment_content ( scheduled_number,								   gtk_entry_get_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_CHEQUE] )));	}	/* récupération du no d'exercice */	gsb_data_scheduled_set_financial_year_number ( scheduled_number,						       GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_EXERCICE] ) -> menu_item ),											       "no_exercice" )));	/* récupération de l'imputation budgétaire */	if ( gtk_widget_get_style ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] ) -> entry ) == style_entree_formulaire[ENCLAIR] )	{	    tab_char = g_strsplit ( gtk_combofix_get_text ( GTK_COMBOFIX ( widget_formulaire_echeancier[SCHEDULER_FORM_BUDGETARY] )),				    ":",				    2 );	    tab_char[0] = g_strstrip ( tab_char[0] );	    if ( tab_char[1] )		tab_char[1] = g_strstrip ( tab_char[1] );	    if ( strlen ( tab_char[0] ) )	    {		gsb_data_scheduled_set_budgetary_number ( scheduled_number,		gsb_data_budget_get_number_by_name ( tab_char[0],						     TRUE,						     gsb_data_scheduled_get_amount (scheduled_number) < 0));		gsb_data_scheduled_set_sub_budgetary_number ( scheduled_number,							      gsb_data_budget_get_sub_budget_number_by_name ( gsb_data_scheduled_get_budgetary_number (scheduled_number),													      tab_char[1],													      TRUE ));	    }	    g_strfreev ( tab_char );	}	/*       récupération de auto_man */	gsb_data_scheduled_set_automatic_scheduled ( scheduled_number,						     GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_MODE]  ) -> menu_item ),											     "auto_man" )));	/* récupération des notes */	if ( gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] ) == style_entree_formulaire[ENCLAIR] )	    gsb_data_scheduled_set_notes ( scheduled_number,					   gtk_entry_get_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_NOTES] )));	/* récupération de la fréquence */	gsb_data_scheduled_set_frequency ( scheduled_number,					   GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_FREQUENCY]  ) -> menu_item ),										   "periodicite" )));	if ( gsb_data_scheduled_get_frequency (scheduled_number) == 4 )	{	    gsb_data_scheduled_set_user_interval ( scheduled_number,						   GPOINTER_TO_INT ( gtk_object_get_data ( GTK_OBJECT ( GTK_OPTION_MENU ( widget_formulaire_echeancier[SCHEDULER_FORM_FREQ_CUSTOM_MENU]  ) -> menu_item ),											   "intervalle_perso" )));	    gsb_data_scheduled_set_user_entry ( scheduled_number,						my_strtod (gtk_entry_get_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_FREQ_CUSTOM_NB] )),							   NULL ));	}	if ( gsb_data_scheduled_get_frequency (scheduled_number)	     &&	     gtk_widget_get_style ( widget_formulaire_echeancier[SCHEDULER_FORM_FINAL_DATE] ) == style_entree_formulaire[ENCLAIR] )	{	    /* traitement de la date limite */	    	    gsb_data_scheduled_set_limit_date ( scheduled_number,						gsb_parse_date_string ( gtk_entry_get_text ( GTK_ENTRY ( widget_formulaire_echeancier[SCHEDULER_FORM_FINAL_DATE]))));	}    }    else    {	gint transaction_number;	transaction_number = gsb_scheduler_create_transaction_from_scheduled_form ();	/* the scheduled transaction goes to the next date */	gsb_scheduler_increase_scheduled_transaction (scheduled_number);	/* réaffiche les option menu de la périodicité, des banques et de l'automatisme, effacés pour une saisie d'opé */	gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_MODE] );	gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_FREQUENCY] );	gtk_widget_show ( widget_formulaire_echeancier[SCHEDULER_FORM_FREQUENCY] );	update_transaction_in_trees (gsb_data_transaction_get_pointer_to_transaction (transaction_number));        }    if ( mise_a_jour_combofix_categ_necessaire )	mise_a_jour_combofix_categ ();    formulaire_echeancier_a_zero ();    if ( !etat.formulaire_echeancier_toujours_affiche )	gtk_expander_set_expanded ( GTK_EXPANDER(frame_formulaire_echeancier), FALSE );    mise_a_jour_liste_echeances_manuelles_accueil = 1;    mise_a_jour_liste_echeances_auto_accueil = 1;    remplissage_liste_echeance ();    gtk_widget_grab_focus ( tree_view_liste_echeances );    mise_a_jour_accueil();    modification_fichier ( TRUE );}