[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_98-18-g6e5464f

Pierre Biava nobody at users.sourceforge.net
Mon Jan 17 22:50:52 CET 2011


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  6e5464f2dfad334839e04803f6b3c8e1d0d3b70b (commit)
       via  fb06836ca7fd627d6d50a802ea324d766fdad28b (commit)
      from  96a98bd5f204caed38bfa4a91090eeffabb72a32 (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 6e5464f2dfad334839e04803f6b3c8e1d0d3b70b
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Jan 17 22:39:39 2011 +0100

    Added option "Automatically recover the children of the associated transaction"

commit fb06836ca7fd627d6d50a802ea324d766fdad28b
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Jan 17 22:34:35 2011 +0100

    Fixed a bug detection open file

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

Changes:
diff --git a/src/affichage_liste.c b/src/affichage_liste.c
index 2481988..155b17e 100644
--- a/src/affichage_liste.c
+++ b/src/affichage_liste.c
@@ -54,8 +54,8 @@ static void gsb_transactions_list_display_show_gives_balance ( void );
 static gboolean gsb_transactions_list_display_sort_changed ( GtkWidget *checkbutton,
                         GdkEventButton *event,
                         gint *pointeur );
-static gboolean gsb_transactions_list_display_update_auto_completion ( GtkWidget *checkbutton,
-                        GtkWidget *button );
+static gboolean gsb_transactions_list_display_update_auto_checkbutton ( GtkWidget *checkbutton,
+                        GtkWidget *container );
 static gboolean gsb_transactions_list_display_update_combofix ( void );
 /*END_STATIC*/
 
@@ -511,21 +511,30 @@ GtkWidget *onglet_form_completion ( void )
 
     vbox_pref = new_vbox_with_title_and_icon ( _("Form completion"), "form.png" );
 
-    button = gsb_automem_checkbutton_new (
-                        _("Limit the filling with payees belonging to the current account"),
-                        &etat.limit_completion_to_current_account,
-                        NULL, NULL);
-    gtk_widget_set_sensitive ( button, etat.automatic_completion_payee );
-
     gtk_box_pack_start ( GTK_BOX ( vbox_pref ),
                         gsb_automem_checkbutton_new (
                         _("Automatic filling transactions from payee"),
-                        &etat.automatic_completion_payee,
-                        G_CALLBACK ( gsb_transactions_list_display_update_auto_completion ),
-                        button ),
+                        &conf.automatic_completion_payee,
+                        G_CALLBACK ( gsb_transactions_list_display_update_auto_checkbutton ),
+                        vbox_pref ),
                         FALSE, FALSE, 0 );
 
-    gtk_box_pack_start ( GTK_BOX ( vbox_pref ),button, FALSE, FALSE, 0 );
+    button = gsb_automem_checkbutton_new (
+                        _("Automatically recover the children of the associated transaction"),
+                        &conf.automatic_recover_splits,
+                        NULL,
+                        NULL );
+    g_object_set_data ( G_OBJECT ( vbox_pref ), "button_1", button );
+    gtk_widget_set_sensitive ( button, conf.automatic_completion_payee );
+    gtk_box_pack_start ( GTK_BOX ( vbox_pref ), button, FALSE, FALSE, 0 );
+
+    button = gsb_automem_checkbutton_new (
+                        _("Limit the filling with payees belonging to the current account"),
+                        &conf.limit_completion_to_current_account,
+                        NULL, NULL);
+    g_object_set_data ( G_OBJECT ( vbox_pref ), "button_2", button );
+    gtk_widget_set_sensitive ( button, conf.automatic_completion_payee );
+    gtk_box_pack_start ( GTK_BOX ( vbox_pref ), button, FALSE, FALSE, 0 );
 
     gtk_box_pack_start ( GTK_BOX (vbox_pref),
                         gsb_automem_checkbutton_new (_("Mix credit/debit categories"),
@@ -539,12 +548,6 @@ GtkWidget *onglet_form_completion ( void )
                         G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
                         FALSE, FALSE, 0 );
 
-/*    gtk_box_pack_start ( GTK_BOX (vbox_pref),
-                        gsb_automem_checkbutton_new (_("Enter keeps current completion"),
-                        &etat.combofix_enter_select_completion,
-                        G_CALLBACK ( gsb_transactions_list_display_update_combofix), NULL),
-                        FALSE, FALSE, 0 ); */
-
     gtk_box_pack_start ( GTK_BOX (vbox_pref),
                         gsb_automem_checkbutton_new (_("Don't allow new payee creation"),
                         &etat.combofix_force_payee,
@@ -610,8 +613,6 @@ gboolean gsb_transactions_list_display_update_combofix ( void )
 				     etat.combofix_max_item );
 	gtk_combofix_set_case_sensitive ( GTK_COMBOFIX (combofix),
 					  etat.combofix_case_sensitive );
-/*  gtk_combofix_set_enter_function ( GTK_COMBOFIX (combofix),
-					  etat.combofix_enter_select_completion );*/
     }
 
     combofix = gsb_form_widget_get_widget ( TRANSACTION_FORM_CATEGORY );
@@ -623,8 +624,6 @@ gboolean gsb_transactions_list_display_update_combofix ( void )
 				     etat.combofix_max_item );
 	gtk_combofix_set_case_sensitive ( GTK_COMBOFIX (combofix),
 					  etat.combofix_case_sensitive );
-/*  gtk_combofix_set_enter_function ( GTK_COMBOFIX (combofix),
-                        etat.combofix_enter_select_completion ); */
 	gtk_combofix_set_mixed_sort ( GTK_COMBOFIX (combofix),
 				      etat.combofix_mixed_sort );
     }
@@ -688,13 +687,25 @@ void gsb_transactions_list_display_show_gives_balance ( void )
  *
  * \return FALSE
  * */
-gboolean gsb_transactions_list_display_update_auto_completion ( GtkWidget *checkbutton,
-                        GtkWidget *button )
+gboolean gsb_transactions_list_display_update_auto_checkbutton ( GtkWidget *checkbutton,
+                        GtkWidget *container )
 {
+    GtkWidget *button;
+
     if ( gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( checkbutton ) ) )
+    {
+        button = g_object_get_data ( G_OBJECT ( container ), "button_1" );
         gtk_widget_set_sensitive ( button, TRUE );
+        button = g_object_get_data ( G_OBJECT ( container ), "button_2" );
+        gtk_widget_set_sensitive ( button, TRUE );
+    }
     else
+    {
+        button = g_object_get_data ( G_OBJECT ( container ), "button_1" );
         gtk_widget_set_sensitive ( button, FALSE );
+        button = g_object_get_data ( G_OBJECT ( container ), "button_2" );
+        gtk_widget_set_sensitive ( button, FALSE );
+    }
  
     return FALSE;
 }
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 074f58b..6c0e045 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -219,7 +219,7 @@ gboolean gsb_file_open_menu ( void )
 {
     GtkWidget *selection_fichier;
     GtkFileFilter * filter;
-devel_debug (NULL);
+
     selection_fichier = gtk_file_chooser_dialog_new ( _("Open an accounts file"),
 					   GTK_WINDOW ( window ),
 					   GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -799,7 +799,7 @@ static gint gsb_file_dialog_save ( void )
     gchar* message;
 	gchar* tmpstr1;
 	gchar* tmpstr2;
-devel_debug (NULL);
+
     /*     si le fichier n'est pas modifié on renvoie qu'on ne veut pas enregistrer */
 
     if ( !etat.modification_fichier )
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index e4fbc0d..e6272d6 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -422,15 +422,20 @@ devel_debug (NULL);
                         "Automatic completion payee",
                         &err );
     if ( err == NULL )
-        etat.automatic_completion_payee = int_ret;
+        conf.automatic_completion_payee = int_ret;
     else
         err = NULL;
 
-    etat.limit_completion_to_current_account = g_key_file_get_integer ( config,
+    conf.limit_completion_to_current_account = g_key_file_get_integer ( config,
                         "Display",
                         "Limit payee completion",
                         NULL );
 
+    conf.automatic_recover_splits = g_key_file_get_integer ( config,
+                        "Display",
+                        "Automatic_recover_splits",
+                        NULL );
+
     etat.display_toolbar = g_key_file_get_integer ( config,
                         "Display",
                         "Display toolbar",
@@ -817,12 +822,17 @@ gboolean gsb_file_config_save_config ( void )
     g_key_file_set_integer ( config,
                         "Display",
                         "Automatic completion payee",
-                        etat.automatic_completion_payee );
+                        conf.automatic_completion_payee );
 
     g_key_file_set_integer ( config,
                         "Display",
                         "Limit payee completion",
-                        etat.limit_completion_to_current_account );
+                        conf.limit_completion_to_current_account );
+
+    g_key_file_set_integer ( config,
+                        "Display",
+                        "Automatic_recover_splits",
+                        conf.automatic_recover_splits );
 
     g_key_file_set_integer ( config,
                         "Display",
@@ -1350,7 +1360,6 @@ void gsb_file_config_clean_config ( void )
     conf.prefs_width = 600;
 
     conf.force_enregistrement = 1;
-    etat.utilise_logo = 1;
 
     conf.r_modifiable = 0;       /* we can not change the reconciled transaction */
     conf.dernier_fichier_auto = 1;   /*  on n'ouvre pas directement le dernier fichier */
@@ -1361,8 +1370,9 @@ void gsb_file_config_clean_config ( void )
     conf.balances_with_scheduled = TRUE;
     etat.formulaire_toujours_affiche = 0;       /* le formulaire ne s'affiche que lors de l'edition d'1 opé */
     etat.affichage_exercice_automatique = 0;        /* l'exercice est choisi en fonction de la date */
-    etat.automatic_completion_payee = 1;        /* by default automatic completion */
-    etat.limit_completion_to_current_account = 0;        /* By default, do full search */
+    conf.automatic_completion_payee = 1;        /* by default automatic completion */
+    conf.limit_completion_to_current_account = 0;        /* By default, do full search */
+    conf.automatic_recover_splits = 1;
 
     conf.display_grisbi_title = GSB_ACCOUNTS_TITLE;  /* show Accounts file title par défaut */
     etat.display_toolbar = GSB_BUTTON_BOTH;         /* How to display toolbar icons. */
diff --git a/src/gsb_file_util.c b/src/gsb_file_util.c
index 97c1719..3d9dc7f 100644
--- a/src/gsb_file_util.c
+++ b/src/gsb_file_util.c
@@ -282,8 +282,8 @@ gboolean gsb_file_util_modify_lock ( gboolean create_lock )
     gchar *lock_filename;
 
     devel_debug_int ( create_lock );
-    /* if the file was already opened and we don't force the saving, we do nothing */
-    if ( ( etat.fichier_deja_ouvert && !conf.force_enregistrement )
+    /* if the file was already opened we do nothing */
+    if ( ( etat.fichier_deja_ouvert )
 	 ||
 	 !nom_fichier_comptes
 	 ||
@@ -296,7 +296,7 @@ gboolean gsb_file_util_modify_lock ( gboolean create_lock )
         return FALSE;
 
     /* Create the name of the lock file */
-    lock_filename = g_strconcat ( gsb_file_get_backup_path ( ),
+    lock_filename = g_strconcat ( g_get_tmp_dir ( ),
                         G_DIR_SEPARATOR_S,
 #ifndef _WIN32
                         ".",
@@ -314,8 +314,7 @@ gboolean gsb_file_util_modify_lock ( gboolean create_lock )
         /* check if the file lock exists */
         if ( g_file_test ( lock_filename, G_FILE_TEST_EXISTS ) )
         {
-            if ( ! conf.force_enregistrement )
-                dialog_message ( "account-already-opened", nom_fichier_comptes );
+            dialog_message ( "account-already-opened", nom_fichier_comptes );
 
             /* the lock is already created, return TRUE */
             etat.fichier_deja_ouvert = 1;
@@ -342,13 +341,11 @@ gboolean gsb_file_util_modify_lock ( gboolean create_lock )
         fclose ( fichier );
         return TRUE;
     }
-    else
+    else if ( etat.fichier_deja_ouvert == 0 )
     {
         /* delete the lock file */
         gint result;
 
-        etat.fichier_deja_ouvert = 0;
-
         /* check if it exits, if not, just go away */
         if ( !g_file_test ( lock_filename, G_FILE_TEST_EXISTS ) )
             return TRUE;
@@ -369,6 +366,12 @@ gboolean gsb_file_util_modify_lock ( gboolean create_lock )
         }
         return TRUE;
     }
+    else
+    {
+        /* si le fichier est déjà ouvert on ne fait rien */
+        etat.fichier_deja_ouvert = 0;
+        return TRUE;
+    }
 }
 
 /**
diff --git a/src/gsb_form_transaction.c b/src/gsb_form_transaction.c
index c6d2ba4..78b9e13 100644
--- a/src/gsb_form_transaction.c
+++ b/src/gsb_form_transaction.c
@@ -126,7 +126,7 @@ gboolean gsb_form_transaction_complete_form_by_payee ( const gchar *payee_name )
         return TRUE;
 
     /* find the last transaction with that payee */
-    if ( etat.automatic_completion_payee )
+    if ( conf.automatic_completion_payee )
     transaction_number = gsb_form_transactions_look_for_last_party ( payee_number,
                         0,
                         account_number );
@@ -169,8 +169,9 @@ gboolean gsb_form_transaction_complete_form_by_payee ( const gchar *payee_name )
         &&
         gsb_data_transaction_get_split_of_transaction (transaction_number))
         {
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (form_button_recover_split), TRUE);
-        gtk_widget_show (form_button_recover_split);
+            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON ( form_button_recover_split ),
+                        conf.automatic_recover_splits );
+            gtk_widget_show ( form_button_recover_split );
         }
     }
     else if ( element -> element_number == TRANSACTION_FORM_TYPE )
@@ -276,7 +277,7 @@ gint gsb_form_transactions_look_for_last_party ( gint no_party,
 
     /* if we don't want to complete with a transaction in another account,
      * go away here */
-    if ( etat.limit_completion_to_current_account )
+    if ( conf.limit_completion_to_current_account )
 	return 0;
 
     return last_transaction_with_party_not_in_account;
diff --git a/src/structures.h b/src/structures.h
index cff59ee..900ffa6 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -57,9 +57,7 @@ struct gsb_etat_t
 
     /* formulaire */
     gint formulaire_toujours_affiche;
-    gint affichage_exercice_automatique;            /* automatic fyear :0 to set according to the date, 2 according to value date */
-    gint automatic_completion_payee;                /* 1 pour autoriser la completion automatique des opérations */
-    gboolean limit_completion_to_current_account;   /* Limit payee completion to current account or do a full search. */
+    gint affichage_exercice_automatique;    /* automatic fyear :0 to set according to the date, 2 according to value date */
     gint affiche_nb_ecritures_listes;
     gint largeur_auto_colonnes;
     gint retient_affichage_par_compte;      /* à 1 si les caractéristiques de l'affichage (R, non R ...) diffèrent par compte */
@@ -145,7 +143,6 @@ extern struct gsb_etat_t etat;
  */
 struct gsb_conf_t
 {
-
     /* geometry */
     gint root_x;                                    /* main_window x position */
     gint root_y;                                    /* main_window y position */
@@ -183,6 +180,11 @@ struct gsb_conf_t
     gint make_bakup_single_file;                    /* TRUE if a single backup file */
     gint compress_backup;                           /* TRUE if we want to compress the backup */
 
+    /* formulaire */
+    gint automatic_completion_payee;                /* 1 pour autoriser la completion automatique des opérations */
+    gboolean limit_completion_to_current_account;   /* Limit payee completion to current account or do a full search. */
+    gboolean automatic_recover_splits;              /* 1 pour recréer automatiquement les sous opérations */
+
 #if IS_DEVELOPMENT_VERSION == 1
     /* config file */
     gint stable_config_file_model;                  /* TRUE for use the stable config file as model */
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index fc95c51..4caeee7 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -324,6 +324,7 @@ void init_variables ( void )
     if ( etat.name_logo && strlen ( etat.name_logo ) )
         g_free ( etat.name_logo );
     etat.name_logo = NULL;
+    etat.utilise_logo = 1;
     gsb_select_icon_init_logo_variables ();
 
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list