[grisbi-cvs] [SCM] grisbi branch, master, updated. 3671f0a9f89aee58e8204fea89c0ded427696569

Pierre Biava nobody at users.sourceforge.net
Wed Jun 23 22:29:23 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  3671f0a9f89aee58e8204fea89c0ded427696569 (commit)
       via  f72f3a545f8b848df8e4a50727661bd8cf972237 (commit)
       via  34a18ad58951292c54831224cdaa6b7bc7cf4729 (commit)
      from  658dfd6d9169743a939bcaa5f8fa8c95efd18577 (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 3671f0a9f89aee58e8204fea89c0ded427696569
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Jun 23 22:28:00 2010 +0200

    Changing the management of the form so as not to recreate the form at every change of account.
    WARNING current test

commit f72f3a545f8b848df8e4a50727661bd8cf972237
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Jun 23 21:59:26 2010 +0200

    Deleting a compilation warning

commit 34a18ad58951292c54831224cdaa6b7bc7cf4729
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Jun 23 21:57:25 2010 +0200

    adding the prohibition of creating payees, categories and budgetary lines  in the budget module.

-----------------------------------------------------------------------

Changes:
diff --git a/src/balance_estimate_future.c b/src/balance_estimate_future.c
index 658e089..367bd7e 100644
--- a/src/balance_estimate_future.c
+++ b/src/balance_estimate_future.c
@@ -455,8 +455,7 @@ gboolean bet_form_create_current_form ( GtkWidget *dialog,
     widget = gtk_combofix_new (
                         gsb_data_payee_get_name_and_report_list ( ) );
     gtk_widget_set_size_request ( widget, width, -1 );
-    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget),
-					  etat.combofix_force_payee );
+    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget), TRUE ); /* on ne peut pas créer d'item */
     gtk_combofix_set_max_items ( GTK_COMBOFIX (widget),
 					 etat.combofix_max_item );
     gtk_combofix_set_case_sensitive ( GTK_COMBOFIX (widget),
@@ -545,8 +544,7 @@ gboolean bet_form_create_current_form ( GtkWidget *dialog,
     widget = gtk_combofix_new (
                          gsb_data_category_get_name_list ( TRUE, TRUE, TRUE, FALSE ) );
     gtk_widget_set_size_request ( widget, width, -1 );
-    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget),
-					  etat.combofix_force_category );
+    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget), TRUE ); /* on ne peut pas créer d'item */
     gtk_combofix_set_max_items ( GTK_COMBOFIX (widget),
 					 etat.combofix_max_item );
     gtk_combofix_set_case_sensitive ( GTK_COMBOFIX (widget),
@@ -595,8 +593,7 @@ gboolean bet_form_create_current_form ( GtkWidget *dialog,
     widget = gtk_combofix_new (
                         gsb_data_budget_get_name_list (TRUE, TRUE));
     gtk_widget_set_size_request ( widget, width, -1 );
-    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget),
-					  etat.combofix_force_category );
+    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget), TRUE ); /* on ne peut pas créer d'item */
     gtk_combofix_set_max_items ( GTK_COMBOFIX (widget),
 					 etat.combofix_max_item );
     gtk_combofix_set_case_sensitive ( GTK_COMBOFIX (widget),
diff --git a/src/gsb_data_transaction.c b/src/gsb_data_transaction.c
index f7a31fa..14152ce 100644
--- a/src/gsb_data_transaction.c
+++ b/src/gsb_data_transaction.c
@@ -2572,7 +2572,7 @@ gint gsb_data_transaction_get_white_line ( gint transaction_number )
  * \return the number of the transaction if one is found, FALSE if none found, so can use it
  * */
 gint gsb_data_transaction_check_content_payment ( gint payment_number,
-                        gchar *number )
+                        const gchar *number )
 {
     GSList *tmp_list;
 
diff --git a/src/gsb_data_transaction.h b/src/gsb_data_transaction.h
index 4413f4d..62bf66f 100644
--- a/src/gsb_data_transaction.h
+++ b/src/gsb_data_transaction.h
@@ -19,7 +19,7 @@ enum operation_etat_rapprochement {
 /* START_DECLARATION */
 gboolean gsb_data_transaction_add_archived_to_list ( gint transaction_number );
 gint gsb_data_transaction_check_content_payment ( gint payment_number,
-                        gchar *number );
+                        const gchar *number );
 gboolean gsb_data_transaction_copy_transaction ( gint source_transaction_number,
                         gint target_transaction_number,
                         gboolean reset_mark );
diff --git a/src/gsb_form.c b/src/gsb_form.c
index 26ff881..885c1a8 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -96,6 +96,7 @@ static gboolean gsb_form_get_categories ( gint transaction_number,
                         gint new_transaction,
                         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,
@@ -213,10 +214,10 @@ void gsb_form_create_widgets ( void )
 
     devel_debug (NULL);
 
-    gsb_form_widget_free_list ();
     if ( child && GTK_IS_WIDGET(child) )
     {
-	gtk_container_remove ( GTK_CONTAINER(form_expander), child );
+        gsb_form_widget_free_list ();
+	    gtk_container_remove ( GTK_CONTAINER ( form_expander ), child );
     }
 
     /* Expander has a composite label */
@@ -299,6 +300,9 @@ void gsb_form_create_widgets ( void )
     gtk_container_add ( GTK_CONTAINER (event_box),
 			form_transaction_part );
 
+    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 );
@@ -974,7 +978,6 @@ gboolean gsb_form_activate_expander ( GtkWidget *expander,
     {
         GtkWidget *date_entry;
 
-        gsb_form_widget_free_list ();
         gsb_form_show ( TRUE );
         etat.formulaire_toujours_affiche = TRUE;
         gsb_form_widget_set_focus ( TRANSACTION_FORM_DATE );
@@ -1177,9 +1180,6 @@ gboolean gsb_form_fill_from_account ( gint account_number )
 
     devel_debug_int (account_number);
 
-    /* free the form if necessary */
-    gsb_form_widget_free_list ();
-
     /* account_number can be -1 if come here from the accounts choice button,
      * and -2 if there were a problem with the origin */
     switch (account_number)
@@ -1195,54 +1195,12 @@ gboolean gsb_form_fill_from_account ( gint account_number )
 	    break;
     }
 
-    /* if each account has a separate form, get it here,
-     * else, get the form of the first account */
-	form_account_number = gsb_data_account_first_number ();
-
-    rows_number = gsb_data_form_get_nb_rows (form_account_number);
-    columns_number = gsb_data_form_get_nb_columns (form_account_number);
-
-    gtk_table_resize ( GTK_TABLE (form_transaction_part),
-		       rows_number,
-		       columns_number );
-
-    for ( row=0 ; row < rows_number ; row++ )
-	for ( column=0 ; column < columns_number ; column++ )
-	{
-	    GtkWidget *widget;
-	    gint element = gsb_data_form_get_value ( form_account_number, column, row );
-
-	    /* we use form_account_number to find what is shown or not in the form,
-	     * but to fill the form we need to use account_number because some elements
-	     * are account dependant (ex method of payment) */
-		widget = gsb_form_widget_create ( element, account_number );
+    gsb_form_clean ( account_number );
 
-	    if ( !widget )
-		continue;
-
-	    gtk_table_attach ( GTK_TABLE (form_transaction_part),
-			       widget,
-			       column, column+1,
-			       row, row+1,
-			       gsb_form_get_element_expandable ( element ),
-			       gsb_form_get_element_expandable ( element ),
-			       0, 0);
-	    /* we want to show all the widget created except the method of payment
-	     * and contra, they know themselves if they have to be shown or not,
-	     * so just let them */
-	    if (element != TRANSACTION_FORM_TYPE
-		 &&
-		 element != TRANSACTION_FORM_CONTRA
-         &&
-         element != TRANSACTION_FORM_CHEQUE )
-		gtk_widget_show (widget);
-	}
-    gsb_form_clean (account_number);
     return FALSE;
 }
 
 
-
 /**
  * clean the form according to the account_number
  * and set the default values
@@ -3362,7 +3320,6 @@ gboolean gsb_form_escape_form ( void )
     }
     else
     {
-        gsb_form_widget_free_list ( );
         gtk_expander_set_expanded ( GTK_EXPANDER ( form_expander ), FALSE );
     }
     return FALSE;
@@ -3532,6 +3489,12 @@ GtkWidget *gsb_form_get_element_widget_from_list ( gint element_number,
 }
 
 
+/**
+ *
+ *
+ *
+ *
+ * */
 void gsb_form_set_current_date_into_date_entry ( void )
 {
     GtkWidget *date_entry;
@@ -3552,6 +3515,58 @@ void gsb_form_set_current_date_into_date_entry ( void )
     }
 }
 
+/**
+ * initialise le formulaire
+ *
+ * \param
+ * 
+ * \return FALSE
+ * */
+gboolean gsb_form_initialise_transaction_form ( void )
+{
+    gint row, column;
+    gint rows_number, columns_number;
+    gint form_account_number;
+    gint account_number;
+
+    devel_debug (NULL);
+
+    /* get the form of the first account */
+	form_account_number = gsb_data_account_first_number ();
+    account_number = gsb_data_account_first_number ( );
+
+    rows_number = gsb_data_form_get_nb_rows (form_account_number);
+    columns_number = gsb_data_form_get_nb_columns (form_account_number);
+
+    gtk_table_resize ( GTK_TABLE (form_transaction_part),
+		       rows_number,
+		       columns_number );
+
+    for ( row=0 ; row < rows_number ; row++ )
+	for ( column=0 ; column < columns_number ; column++ )
+	{
+	    GtkWidget *widget;
+	    gint element;
+
+        element = gsb_data_form_get_value ( form_account_number, column, row );
+		widget = gsb_form_widget_create ( element, account_number );
+
+	    if ( !widget )
+		continue;
+
+	    gtk_table_attach ( GTK_TABLE (form_transaction_part),
+			       widget,
+			       column, column+1,
+			       row, row+1,
+			       gsb_form_get_element_expandable ( element ),
+			       gsb_form_get_element_expandable ( element ),
+			       0, 0);
+	}
+
+    return FALSE;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list