[grisbi-cvs] grisbi/src accueil.c, 1.219, 1.220 balance_estimate_config.c, 1.5, 1.6 balance_estimate_tab.c, 1.38, 1.39 gsb_autofunc.c, 1.25, 1.26 gsb_form.c, 1.147, 1.148 gsb_form_widget.c, 1.47, 1.48 gsb_form_widget.h, 1.6, 1.7 menu.c, 1.148, 1.149

Pierre Biava pbiava at users.sourceforge.net
Thu Feb 4 21:04:54 CET 2010


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9799/src

Modified Files:
	accueil.c balance_estimate_config.c balance_estimate_tab.c 
	gsb_autofunc.c gsb_form.c gsb_form_widget.c gsb_form_widget.h 
	menu.c 
Log Message:
fixed bug 888 and minor corrections

Index: gsb_form_widget.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_widget.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- gsb_form_widget.c	30 Jan 2010 17:04:12 -0000	1.47
+++ gsb_form_widget.c	4 Feb 2010 20:04:51 -0000	1.48
@@ -75,6 +75,8 @@
 
 static gchar *old_debit = NULL;
 static gchar *old_credit = NULL;
+static gint old_credit_payement_number = 0;
+static gint old_debit_payement_number = 0;
 
 /**
  * return the list wich contains the widgets of the form
@@ -778,7 +780,6 @@
     gint element_number;
     gint account_number;
 
-    devel_debug (NULL);
     /* still not found, if change the content of the form, something come in entry
      * wich is nothing, so protect here */
     if ( !GTK_IS_WIDGET (entry)
@@ -795,6 +796,7 @@
     }
     element_number = GPOINTER_TO_INT (ptr_origin);
     account_number = gsb_form_get_account_number ();
+    devel_debug_int (element_number);
 
     switch ( element_number )
     {
@@ -827,6 +829,9 @@
             /* change the signe of the method of payment and the contra */
             if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_CREDIT )
             {
+                old_credit_payement_number = gsb_payment_method_get_selected_number (
+                        widget );
+
                 gsb_payment_method_create_combo_list ( widget,
                                         GSB_PAYMENT_DEBIT,
                                         account_number, 0 );
@@ -867,6 +872,9 @@
             /* change the signe of the method of payment and the contra */
             if ( gsb_payment_method_get_combo_sign (widget) == GSB_PAYMENT_DEBIT)
             {
+                old_debit_payement_number = gsb_payment_method_get_selected_number (
+                        widget );
+
                 gsb_payment_method_create_combo_list ( widget,
                                         GSB_PAYMENT_CREDIT,
                                         account_number, 0 );
@@ -1072,3 +1080,27 @@
     }
     return FALSE;
 }
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gint gsb_form_widget_get_old_credit_payement ( void )
+{
+    return old_credit_payement_number;
+}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gint gsb_form_widget_get_old_debit_payement ( void )
+{
+    return old_debit_payement_number;
+}

Index: balance_estimate_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_config.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- balance_estimate_config.c	31 Jan 2010 20:47:24 -0000	1.5
+++ balance_estimate_config.c	4 Feb 2010 20:04:51 -0000	1.6
@@ -149,11 +149,6 @@
         //~ gtk_widget_set_name ( GTK_WIDGET ( widget ), "fyear_combo" );
         //~ gtk_widget_set_tooltip_text ( GTK_WIDGET ( widget ),
                           //~ SPACIFY(_("Choose the financial year or 12 months rolling") ) );
-        //~ g_signal_connect ( G_OBJECT ( widget ),
-                        //~ "changed",
-                        //~ G_CALLBACK (bet_historical_fyear_clicked),
-                        //~ NULL );
-
         //~ gtk_box_pack_start ( GTK_BOX ( hbox ), widget, FALSE, FALSE, 5);
 
         //~ /* hide the present financial year */
@@ -171,6 +166,11 @@
                         //~ etat.bet_hist_fyear );
         //~ }
 
+        //~ /* set the signal */
+        //~ g_signal_connect ( G_OBJECT ( widget ),
+                        //~ "changed",
+                        //~ G_CALLBACK (bet_historical_fyear_clicked),
+                        //~ NULL );
     //~ }
     return hbox;
 }

Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- gsb_form.c	30 Jan 2010 08:16:49 -0000	1.147
+++ gsb_form.c	4 Feb 2010 20:04:51 -0000	1.148
@@ -1501,6 +1501,7 @@
     GtkWidget *widget;
     gint account_number;
     gint transaction_number;
+    gint payement_number;
 
     /* still not found, if change the content of the form, something come in entry
      * wich is nothing, so protect here */
@@ -1604,8 +1605,10 @@
                     /* change the signe of the method of payment and the contra */
                     if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_DEBIT )
                     {
-                    gint payement_number =  
-                        gsb_data_transaction_get_method_of_payment_number (
+                    if ( transaction_number == -1 )
+                        payement_number =  gsb_form_widget_get_old_credit_payement ( );
+                    else
+                        payement_number = gsb_data_transaction_get_method_of_payment_number (
                         transaction_number );
 
                     gsb_payment_method_create_combo_list ( widget,
@@ -1692,8 +1695,10 @@
                     /* change the signe of the method of payment and the contra */
                     if ( gsb_payment_method_get_combo_sign ( widget ) == GSB_PAYMENT_CREDIT )
                     {
-                    gint payement_number =
-                        gsb_data_transaction_get_method_of_payment_number (
+                    if ( transaction_number == -1 )
+                        payement_number =  gsb_form_widget_get_old_debit_payement ( );
+                    else
+                        payement_number = gsb_data_transaction_get_method_of_payment_number (
                         transaction_number );
 
                     gsb_payment_method_create_combo_list ( widget,
@@ -2141,7 +2146,7 @@
 							     element_number,
 							     GSB_RIGHT );
 
-        /* si élément = date de valeur fix the bug 578 */
+        /* if element = value_date fix the bug 578 */
         if ( element_number == TRANSACTION_FORM_VALUE_DATE )
         {
             widget_prov = gsb_form_widget_get_widget (

Index: gsb_form_widget.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_widget.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gsb_form_widget.h	23 Jan 2010 19:35:10 -0000	1.6
+++ gsb_form_widget.h	4 Feb 2010 20:04:51 -0000	1.7
@@ -25,6 +25,8 @@
 gchar *gsb_form_widget_get_name ( gint element_number );
 gchar *gsb_form_widget_get_old_credit ( void );
 gchar *gsb_form_widget_get_old_debit ( void );
+gint gsb_form_widget_get_old_credit_payement ( void );
+gint gsb_form_widget_get_old_debit_payement ( void );
 GtkWidget *gsb_form_widget_get_widget ( gint element_number );
 gint gsb_form_widget_next_element ( gint account_number,
                         gint element_number,

Index: accueil.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/accueil.c,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -d -r1.219 -r1.220
--- accueil.c	26 Dec 2009 16:57:13 -0000	1.219
+++ accueil.c	4 Feb 2010 20:04:51 -0000	1.220
@@ -208,7 +208,7 @@
 
     /* mise en place de la partie fin des comptes passif */
     paddingbox = new_paddingbox_with_title ( base, FALSE,
-					     _("Closed liabilities accounts") );
+                         _("Closed liabilities accounts") );
     frame_etat_fin_compte_passif = gtk_notebook_new ();
     gtk_notebook_set_show_tabs ( GTK_NOTEBOOK(frame_etat_fin_compte_passif), FALSE );
     gtk_notebook_set_show_border ( GTK_NOTEBOOK(frame_etat_fin_compte_passif), FALSE );
@@ -1779,7 +1779,7 @@
 
     if ( !force
 	 &&
-	 !mise_a_jour_fin_comptes_passifs  )
+	 !mise_a_jour_fin_comptes_passifs )
 	return;
 
     devel_debug (NULL);
@@ -1789,6 +1789,9 @@
     gtk_notebook_remove_page ( GTK_NOTEBOOK(frame_etat_fin_compte_passif), 0 );
     hide_paddingbox ( frame_etat_fin_compte_passif );
 
+    if ( !etat.show_closed_accounts )
+        return;
+
     list_tmp = gsb_data_account_get_list_accounts ();
     liste_tmp = NULL;
 

Index: balance_estimate_tab.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- balance_estimate_tab.c	31 Jan 2010 20:47:24 -0000	1.38
+++ balance_estimate_tab.c	4 Feb 2010 20:04:51 -0000	1.39
@@ -751,7 +751,7 @@
     GtkWidget *ancestor;
     GtkWidget *widget;
     const gchar *name;
-
+devel_debug (NULL);
     etat.bet_hist_fyear = bet_fyear_get_fyear_from_combobox ( combo );
 
     name = gtk_widget_get_name ( GTK_WIDGET ( combo ) );
@@ -1167,10 +1167,7 @@
         gtk_widget_set_name ( GTK_WIDGET ( widget ), "fyear_combo" );
         gtk_widget_set_tooltip_text ( GTK_WIDGET ( widget ),
                         SPACIFY(_("Choose the financial year or 12 months rolling") ) );
-        g_signal_connect ( G_OBJECT ( widget ),
-                        "changed",
-                        G_CALLBACK (bet_historical_fyear_clicked),
-                        NULL );
+
         g_object_set_data ( G_OBJECT ( notebook ), "bet_historical_fyear", widget );
 
         gtk_box_pack_start ( GTK_BOX ( hbox ), widget, FALSE, FALSE, 5);
@@ -1189,6 +1186,12 @@
                         bet_fyear_model_filter,
                         etat.bet_hist_fyear );
         }
+
+        /* set the signal */
+        g_signal_connect ( G_OBJECT ( widget ),
+                        "changed",
+                        G_CALLBACK (bet_historical_fyear_clicked),
+                        NULL );
     }
 
     /* création de la liste des données */

Index: menu.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/menu.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- menu.c	26 Dec 2009 16:57:13 -0000	1.148
+++ menu.c	4 Feb 2010 20:04:51 -0000	1.149
@@ -645,6 +645,7 @@
     etat.show_closed_accounts = ! etat.show_closed_accounts;
 
     create_account_list ( navigation_model );
+    gsb_gui_navigation_update_home_page ( );
 
     if ( etat.modification_fichier == 0 )
         modification_fichier ( TRUE );

Index: gsb_autofunc.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_autofunc.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- gsb_autofunc.c	28 Jan 2010 20:25:12 -0000	1.25
+++ gsb_autofunc.c	4 Feb 2010 20:04:51 -0000	1.26
@@ -1342,22 +1342,23 @@
     /* create and fill the combobox */
     combobox = gsb_currency_make_combobox (set_name);
 
-    gsb_currency_set_combobox_history (combobox, currency_number);
+    if ( combobox && currency_number )
+        gsb_currency_set_combobox_history (combobox, currency_number);
 
     /* set the default func :
      * the func will be sent to gsb_autofunc_currency_changed by the data,
      * the number_for_func will be set as data for object */
     g_object_set_data ( G_OBJECT (combobox),
-			"number_for_func", GINT_TO_POINTER (number_for_func));
+            "number_for_func", GINT_TO_POINTER (number_for_func));
 
     if (default_func)
-	g_object_set_data ( G_OBJECT (combobox), "changed", 
-			    (gpointer) g_signal_connect_after (G_OBJECT(combobox), "changed",
-							       G_CALLBACK (gsb_autofunc_currency_changed), default_func ));
+    g_object_set_data ( G_OBJECT (combobox), "changed", 
+                    (gpointer) g_signal_connect_after (G_OBJECT(combobox), "changed",
+                    G_CALLBACK (gsb_autofunc_currency_changed), default_func ));
     if ( hook )
-	g_object_set_data ( G_OBJECT (combobox), "changed-hook", 
-			    (gpointer) g_signal_connect_after (G_OBJECT(combobox), "changed",
-							       G_CALLBACK (hook), data ));
+    g_object_set_data ( G_OBJECT (combobox), "changed-hook", 
+                    (gpointer) g_signal_connect_after (G_OBJECT(combobox), "changed",
+                    G_CALLBACK (hook), data ));
      return combobox;
 }
 



More information about the cvs mailing list