[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_100-9-g16d6222

Pierre Biava nobody at users.sourceforge.net
Mon Feb 21 00:17:48 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  16d62222ff535af18ca4c9f7246ab9d3d11ab960 (commit)
       via  fc453ad904ac759efc75f9b1e95acfb59ed368e3 (commit)
       via  ea3a80f16df8b30ba083e09c90b17b1c775252c4 (commit)
      from  fb18c2b3b986be4d90c670ef3c9fa07e788d71f9 (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 16d62222ff535af18ca4c9f7246ab9d3d11ab960
Merge: fc453ad904ac759efc75f9b1e95acfb59ed368e3 fb18c2b3b986be4d90c670ef3c9fa07e788d71f9
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Feb 21 00:14:36 2011 +0100

    Merge branch 'master' of ssh://grisbi.git.sourceforge.net/gitroot/grisbi/grisbi

commit fc453ad904ac759efc75f9b1e95acfb59ed368e3
Author: pbiava <pierre.biava at nerim.net>
Date:   Mon Feb 21 00:13:04 2011 +0100

    new stable version 0.8.0

commit ea3a80f16df8b30ba083e09c90b17b1c775252c4
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Feb 20 23:43:00 2011 +0100

    Added debug functions for Windows for ofx import

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

Changes:
diff --git a/configure.in b/configure.in
index 341d8d3..ca1bad8 100644
--- a/configure.in
+++ b/configure.in
@@ -1,8 +1,8 @@
 dnl Process this file with autoconf to produce a configure script.
 
 m4_define(grisbi_major_version, 0)
-m4_define(grisbi_minor_version, 7)
-m4_define(grisbi_micro_version, 100)
+m4_define(grisbi_minor_version, 8)
+m4_define(grisbi_micro_version, 0)
 m4_define(grisbi_version, grisbi_major_version.grisbi_minor_version.grisbi_micro_version)
 
 AC_INIT([grisbi],[grisbi_version],[http://grisbi.tuxfamily.org/mantis/login_select_proj_page.php?ref=bug_report_page.php],[grisbi],[http://www.grisbi.org/index.fr.html])
@@ -346,7 +346,7 @@ cat << EOF
 This is an unstable version of grisbi. It is for test purposes only.
 Please, DO NOT use it in a production environment. It will probably crash and you will lose your data.
 
-If you are looking for a stable release of grisbi (0.6.0), either download it from:
+If you are looking for a stable release of grisbi (0.8.0), either download it from:
 http://www.grisbi.org/download.fr.html
 
 Thanks,
diff --git a/grisbi.spec b/grisbi.spec
index 86ebe26..2e74809 100644
--- a/grisbi.spec
+++ b/grisbi.spec
@@ -1,5 +1,5 @@
 %define name    grisbi
-%define version 0.7.100
+%define version 0.8.0
 %define release %mkrel 1
 
 %define _disable_ld_no_undefined 1
@@ -76,8 +76,8 @@ rm -rf $RPM_BUILD_ROOT
 %_iconsdir/hicolor/48x48/apps/%name.png
 
 %changelog
-* Sat Feb 19 2011 Pierre Biava <grisbi at pierre.biava.name> 0.7.100-1mdv2010.1
-- new version 0.7.100
+* Sun Feb 20 2011 Pierre Biava <grisbi at pierre.biava.name> 0.7.100-1mdv2010.1
+- new version 0.8.0
 
 * Sun Sep 12 2010 Pierre Biava <grisbi at pierre.biava.name> 0.7.4-1mdv2010.1
 - new version 0.7.4
diff --git a/src/erreur.c b/src/erreur.c
index 0ded072..cbb223e 100644
--- a/src/erreur.c
+++ b/src/erreur.c
@@ -39,6 +39,7 @@
 #include "gsb_plugins.h"
 #include "gsb_real.h"
 #include "gsb_status.h"
+#include "import.h"
 #include "structures.h"
 #include "traitement_variables.h"
 #include "utils.h"
@@ -273,32 +274,36 @@ gchar *get_debug_time ( void )
  *
  * \return
  * */
-G_MODULE_EXPORT extern void debug_message_string ( gchar *prefixe, gchar * file, gint line, const char * function, 
-				   const gchar *message, gint level, gboolean force_debug_display)
+G_MODULE_EXPORT extern void debug_message_string ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        const gchar *message,
+                        gint level,
+                        gboolean force_debug_display )
 {
     /* il faut bien entendu que le mode debug soit actif ou que l'on force l'affichage */
-    if ( ( debugging_grisbi && level <= debugging_grisbi) || force_debug_display || etat.debug_mode) 
+    if ( ( debugging_grisbi && level <= debugging_grisbi) || force_debug_display || etat.debug_mode )
     {
-	gchar* tmpstr;
+        gchar* tmp_str;
 
-	/* on affiche dans la console le message */
-	if (message)
-	    tmpstr = g_strdup_printf(_("%s, %2f : %s - %s:%d:%s - %s\n"),
-				     get_debug_time (), (double )clock()/ CLOCKS_PER_SEC, prefixe,
-				     file, line, function, message);
-	else
-	    tmpstr = g_strdup_printf(_("%s, %2f : %s - %s:%d:%s\n"),
-				     get_debug_time (), (double )clock()/ CLOCKS_PER_SEC, prefixe,
-				     file, line, function);
+        /* on affiche dans la console le message */
+        if (message)
+            tmp_str = g_strdup_printf(_("%s, %2f : %s - %s:%d:%s - %s\n"),
+                        get_debug_time (), (double )clock()/ CLOCKS_PER_SEC, prefixe,
+                        file, line, function, message);
+        else
+            tmp_str = g_strdup_printf(_("%s, %2f : %s - %s:%d:%s\n"),
+                        get_debug_time (), (double )clock()/ CLOCKS_PER_SEC, prefixe,
+                        file, line, function);
 
-	if (etat.debug_mode)
-	{
-	    fwrite ( tmpstr, sizeof (gchar), strlen (tmpstr), debug_file);
-	    fflush (debug_file);
-	}
+        if ( etat.debug_mode )
+        {
+            fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+            fflush ( debug_file );
+        }
 
-	g_print( "%s", tmpstr );
-	g_free ( tmpstr );
+        g_free ( tmp_str );
     }
 }
 
@@ -318,24 +323,31 @@ G_MODULE_EXPORT extern void debug_message_string ( gchar *prefixe, gchar * file,
  *
  * \return
  * */
-extern void debug_message_int ( gchar *prefixe, gchar * file, gint line, const char * function, 
-				gint message, gint level, gboolean force_debug_display)
+extern void debug_message_int ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        gint message,
+                        gint level,
+                        gboolean force_debug_display )
 {
     /* il faut bien entendu que le mode debug soit actif ou que l'on force l'affichage */
-    if ( ( debugging_grisbi && level <= debugging_grisbi) || force_debug_display || etat.debug_mode) 
+    if ( ( debugging_grisbi && level <= debugging_grisbi) || force_debug_display || etat.debug_mode )
     {
-	/* on affiche dans la console le message */
-	gchar* tmpstr = g_strdup_printf(_("%s, %2f : %s - %s:%d:%s - %d\n"),
-					get_debug_time (), (double )clock()/ CLOCKS_PER_SEC, prefixe,
-					file, line, function, message);
+        gchar* tmp_str;
 
-	if (etat.debug_mode)
-	{
-	    fwrite ( tmpstr, sizeof (gchar), strlen (tmpstr), debug_file);
-	    fflush (debug_file);
-	}
-	g_print( "%s", tmpstr );
-	g_free ( tmpstr );
+        /* on affiche dans la console le message */
+        tmp_str = g_strdup_printf(_("%s, %2f : %s - %s:%d:%s - %d\n"),
+                        get_debug_time (), (double )clock()/ CLOCKS_PER_SEC, prefixe,
+                        file, line, function, message);
+
+        if (etat.debug_mode)
+        {
+            fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+            fflush ( debug_file );
+        }
+
+        g_free ( tmp_str );
     }
 }
 
@@ -356,24 +368,31 @@ extern void debug_message_int ( gchar *prefixe, gchar * file, gint line, const c
  *
  * \return
  * */
-extern void debug_message_real ( gchar *prefixe, gchar * file, gint line, const char * function, 
-				gsb_real message, gint level, gboolean force_debug_display)
+extern void debug_message_real ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        gsb_real message,
+                        gint level,
+                        gboolean force_debug_display )
 {
     /* il faut bien entendu que le mode debug soit actif ou que l'on force l'affichage */
-    if ( ( debugging_grisbi && level <= debugging_grisbi) || force_debug_display || etat.debug_mode) 
+    if ( ( debugging_grisbi && level <= debugging_grisbi) || force_debug_display || etat.debug_mode )
     {
-	/* on affiche dans la console le message */
-	gchar* tmpstr = g_strdup_printf ("%s, %2f : %s - %s:%d:%s - %"G_GINT64_MODIFIER"d E %d\n",
+        gchar* tmp_str;
+
+        /* on affiche dans la console le message */
+        tmp_str = g_strdup_printf ("%s, %2f : %s - %s:%d:%s - %"G_GINT64_MODIFIER"d E %d\n",
                         get_debug_time (), (double )clock()/ CLOCKS_PER_SEC, prefixe,
-                        file, line, function, message.mantissa, message.exponent);
+                        file, line, function, message.mantissa, message.exponent );
 
-	if (etat.debug_mode)
-	{
-	    fwrite ( tmpstr, sizeof (gchar), strlen (tmpstr), debug_file);
-	    fflush (debug_file);
-	}
-	g_print( "%s", tmpstr );
-	g_free ( tmpstr );
+        if ( etat.debug_mode )
+        {
+            fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+            fflush ( debug_file );
+        }
+
+        g_free ( tmp_str );
     }
 }
 
@@ -423,43 +442,44 @@ GtkWidget * print_backtrace ( void )
  *
  * \return FALSE
  * */
-gboolean gsb_debug_start_log (void)
+gboolean gsb_debug_start_log ( void )
 {
-    gchar *tmpstr;
+    gchar *tmp_str;
+
+    devel_debug ( NULL );
 
-    if (nom_fichier_comptes)
+    if ( nom_fichier_comptes )
     {
-	gchar * base_filename = g_strdup ( nom_fichier_comptes );
-	gchar * complete_filename;
-	gchar *basename;
+        gchar *base_filename = g_strdup ( nom_fichier_comptes );
+        gchar *complete_filename;
+        gchar *basename;
 
-	base_filename[strlen(base_filename) - 4] = 0;
-	complete_filename = g_strconcat ( base_filename, "-log.txt", NULL);
-	basename = g_path_get_basename ( complete_filename );
+        base_filename [strlen ( base_filename ) - 4] = 0;
+        complete_filename = g_strconcat ( base_filename, "-log.txt", NULL);
+        basename = g_path_get_basename ( complete_filename );
 
-	debug_filename = g_strconcat ( my_get_gsb_file_default_dir (), "/", basename, NULL);
+        debug_filename = g_strconcat ( my_get_gsb_file_default_dir (), "/", basename, NULL);
 
-	g_free ( basename);
-	g_free ( complete_filename );
-	g_free ( base_filename );
+        g_free ( basename);
+        g_free ( complete_filename );
+        g_free ( base_filename );
     }
     else
     {
-	debug_filename = g_strconcat ( my_get_gsb_file_default_dir (), "/", "No_name-log.txt", NULL);
+        debug_filename = g_strconcat ( my_get_gsb_file_default_dir (), "/", "No_name-log.txt", NULL);
     }
 
 
-    tmpstr = g_strdup_printf (_("The debug-mode is starting. Grisbi will write a log into %s. "
+    tmp_str = g_strdup_printf (_("The debug-mode is starting. Grisbi will write a log into %s. "
                         "Please send that file with the obfuscated file into the bug report."),
                         debug_filename );
 
-    dialogue (tmpstr);
-    g_free (tmpstr);
-
+    dialogue ( tmp_str );
+    g_free (tmp_str);
 
     debug_file = g_fopen ( debug_filename, "w" );
 
-    if (debug_file)
+    if ( debug_file )
     {
         GtkWidget *widget;
         struct lconv *conv;
@@ -471,9 +491,21 @@ gboolean gsb_debug_start_log (void)
         if ( widget && GTK_IS_WIDGET ( widget ) )
             gtk_widget_set_sensitive ( widget, FALSE );
 
+        /* début du mode débogage */
+        tmp_str = g_strdup_printf(_("%s, %2f : Debug - %s:%d:%s\n\n"),
+                        get_debug_time ( ),
+                        (double ) clock ( )/ CLOCKS_PER_SEC,
+                        __FILE__,
+                        __LINE__,
+                        __PRETTY_FUNCTION__ );
+        fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+	    fflush ( debug_file );
+
+        g_free ( tmp_str );
+
         /* write locales */
         conv = localeconv();
-        tmpstr = g_strdup_printf ( "Variables d'environnement :\n\n"
+        tmp_str = g_strdup_printf ( "Variables d'environnement :\n\n"
                         "LANG = %s\n\n"
                         "Currency\n"
                         "\tcurrency_symbol = %s\n"
@@ -490,22 +522,22 @@ gboolean gsb_debug_start_log (void)
                         g_locale_to_utf8 ( conv->negative_sign, -1, NULL, NULL, NULL ),
                         conv->frac_digits );
 
-        fwrite ( tmpstr, sizeof (gchar), strlen ( tmpstr ), debug_file);
-	    fflush (debug_file);
+        fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+	    fflush ( debug_file );
 
-        g_free ( tmpstr );
+        g_free ( tmp_str );
 
-        tmpstr = g_strdup_printf ( "gint64\n"
-                        "\tG_GINT64_MODIFIER = \"%s\"\n" 
+        tmp_str = g_strdup_printf ( "gint64\n"
+                        "\tG_GINT64_MODIFIER = \"%s\"\n"
                         "\t%"G_GINT64_MODIFIER"d\n\n",
                         G_GINT64_MODIFIER, G_MAXINT64 );
 
-        fwrite ( tmpstr, sizeof (gchar), strlen ( tmpstr ), debug_file);
-	    fflush (debug_file);
+        fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+	    fflush ( debug_file );
 
-        g_free ( tmpstr );
+        g_free ( tmp_str );
 
-        tmpstr = g_strdup_printf ("Paths\n"
+        tmp_str = g_strdup_printf ("Paths\n"
                         "\tC_GRISBIRC = %s\n"
                         "\tC_PATH_CONFIG = %s\n"
                         "\tC_PATH_CONFIG_ACCELS = %s\n"
@@ -525,10 +557,23 @@ gboolean gsb_debug_start_log (void)
                         GRISBI_PLUGINS_DIR,
                         GRISBI_PIXMAPS_DIR );
 
-        fwrite ( tmpstr, sizeof (gchar), strlen ( tmpstr ), debug_file);
-	    fflush (debug_file);
+        fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+	    fflush ( debug_file );
+
+        g_free ( tmp_str );
+
+        tmp_str = g_strdup ( "Formats importés\n" );
+        fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+	    fflush ( debug_file );
+
+        g_free ( tmp_str );
+
+        tmp_str = gsb_import_formats_get_list_formats_to_string ( );
 
-        g_free ( tmpstr );
+        fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+	    fflush ( debug_file );
+
+        g_free ( tmp_str );
     }
     else
         dialogue_error (_("Grisbi failed to create the log file...") );
@@ -536,6 +581,45 @@ gboolean gsb_debug_start_log (void)
     return FALSE;
 }
 
+
+/**
+ *
+ *
+ *
+ */
+extern void debug_print_log_string ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        const gchar *msg )
+{
+    gchar *tmp_str;
+    gchar *message;
+
+    if ( debug_file == NULL )
+        return;
+
+    if ( msg && strlen ( msg ) )
+        message = g_strdup ( msg );
+    else
+        message = g_strdup ( "(null)" );
+
+    tmp_str = g_strdup_printf(_("%s, %2f : %s - %s:%d:%s - %s\n"),
+                        get_debug_time ( ),
+                        (double ) clock ( )/ CLOCKS_PER_SEC,
+                        prefixe,
+                        file,
+                        line,
+                        function,
+                        message );
+
+    fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+    fflush ( debug_file );
+
+    g_free ( tmp_str );
+    g_free ( message );
+}
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/erreur.h b/src/erreur.h
index a72c6ed..37e8fae 100644
--- a/src/erreur.h
+++ b/src/erreur.h
@@ -24,16 +24,36 @@
 #define important_debug(x) debug_message_string("Important",__FILE__,__LINE__,__PRETTY_FUNCTION__,x,DEBUG_LEVEL_IMPORTANT,FALSE)
 #define alert_debug(x) debug_message_string("Alert",__FILE__,__LINE__,__PRETTY_FUNCTION__,x,DEBUG_LEVEL_ALERT,FALSE)
 #define DEBUG_WHERE_AM_I g_strdup_printf("%s line %05d",__FILE__,__LINE__)
-
+#define devel_print_str(x) debug_print_log_string("Debug",__FILE__,__LINE__,__PRETTY_FUNCTION__,x)
 
 /* START_DECLARATION */
-extern void debug_message_int ( gchar *prefixe, gchar * file, gint line, const char * function, 
-				gint message, gint level, gboolean force_debug_display);
-extern void debug_message_real ( gchar *prefixe, gchar * file, gint line, const char * function, 
-				gsb_real message, gint level, gboolean force_debug_display);
-G_MODULE_EXPORT extern void debug_message_string ( gchar *prefixe, gchar * file, gint line, const char * function, 
-				   const gchar *message, gint level, gboolean force_debug_display);
-gboolean gsb_debug_start_log (void);
+extern void debug_message_int ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        gint message,
+                        gint level,
+                        gboolean force_debug_display );
+extern void debug_message_real ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        gsb_real message,
+                        gint level,
+                        gboolean force_debug_display);
+G_MODULE_EXPORT extern void debug_message_string ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        const gchar *message,
+                        gint level,
+                        gboolean force_debug_display );
+extern void debug_print_log_string ( gchar *prefixe,
+                        gchar *file,
+                        gint line,
+                        const char *function,
+                        const gchar *msg );
+gboolean gsb_debug_start_log ( void );
 void initialize_debugging ( void );
 void traitement_sigsegv ( gint signal_nb );
 /* END_DECLARATION */
diff --git a/src/import.c b/src/import.c
index 303195e..44802bf 100644
--- a/src/import.c
+++ b/src/import.c
@@ -167,7 +167,8 @@ extern GtkWidget *window;
 /*END_EXTERN*/
 
 /* recopie des types de transaction de la libofx en attendant une version propre */
-typedef enum {
+typedef enum
+{
     OFX_CREDIT,     /**< Generic credit */
     OFX_DEBIT,      /**< Generic debit */
     OFX_INT,        /**< Interest earned or paid (Note: Depends on signage of amount) */
@@ -189,7 +190,7 @@ typedef enum {
 
 
 /** Suppported import formats.  Plugins may register themselves. */
-static GSList * import_formats = NULL;
+static GSList *import_formats = NULL;
 
 /* set to TRUE if we import some marked R transactions
  * grisbi cannot associate them to a reconcile number, so if TRUE,
@@ -197,7 +198,8 @@ static GSList * import_formats = NULL;
 static gboolean marked_r_transactions_imported;
 
 /** Known built-in import formats.  Others are plugins.  */
-struct import_format builtin_formats[] = {
+struct import_format builtin_formats[] =
+{
 { "CSV", N_("Comma Separated Values"),     "csv", (import_function) csv_import_csv_account },
 { "QIF", N_("Quicken Interchange Format"), "qif", (import_function) recuperation_donnees_qif },
 { NULL,  NULL,              NULL,       NULL },
@@ -219,7 +221,8 @@ GSList *liste_associations_tiers = NULL;
 /* nombre de transaction à importer qui affiche une barre de progression */
 #define NBRE_TRANSACTION_FOR_PROGRESS_BAR 250
 
-enum import_filesel_columns {
+enum import_filesel_columns
+{
     IMPORT_FILESEL_SELECTED = 0,
     IMPORT_FILESEL_TYPENAME,
     IMPORT_FILESEL_FILENAME,
@@ -230,7 +233,8 @@ enum import_filesel_columns {
 };
 
 /** Page numbering for the import wizard. */
-enum import_pages {
+enum import_pages
+{
     IMPORT_STARTUP_PAGE,
     IMPORT_FILESEL_PAGE,
     IMPORT_CSV_PAGE,
@@ -243,12 +247,13 @@ enum import_pages {
 /**
  * Register built-in import formats as known.
  */
-void register_import_formats ()
+void register_import_formats ( void )
 {
     gint i;
+
     for ( i = 0; builtin_formats [ i ] . name != NULL ; i ++ )
     {
-    register_import_format ( &builtin_formats [ i ] );
+        register_import_format ( &builtin_formats [ i ] );
     }
 }
 
@@ -261,11 +266,13 @@ void register_import_formats ()
  *                      this import format.
  *
  */
-G_MODULE_EXPORT void register_import_format ( struct import_format * format )
+G_MODULE_EXPORT void register_import_format ( struct import_format *format )
 {
-    gchar* tmpstr = g_strdup_printf ( _("Adding '%s' as an import format"), format -> name );
-    devel_debug ( tmpstr );
-    g_free ( tmpstr );
+    gchar *tmp_str;
+
+    tmp_str = g_strdup_printf ( _("Adding '%s' as an import format"), format -> name );
+    devel_debug ( tmp_str );
+    g_free ( tmp_str );
     import_formats = g_slist_append ( import_formats, format );
 }
 
@@ -278,50 +285,37 @@ G_MODULE_EXPORT void register_import_format ( struct import_format * format )
  */
 void importer_fichier ( void )
 {
-    GSList * tmp = import_formats;
-    gchar * formats = g_strdup("");
-    GtkWidget * assistant;
-	gchar* tmpstr;
+    GtkWidget *assistant;
+	gchar* tmp_str;
+    gchar *format_str;
 
     /* if nothing opened, we need to create a new file to set up all the variables */
     if (!gsb_data_currency_get_currency_list ())
     {
-    init_variables ();
-    gsb_assistant_file_run (FALSE, TRUE);
-    return;
+        init_variables ();
+        gsb_assistant_file_run (FALSE, TRUE);
+        return;
     }
 
     liste_comptes_importes = NULL;
     liste_comptes_importes_error = NULL;
     virements_a_chercher = 0;
 
-    while ( tmp )
-    {
-    struct import_format * format = (struct import_format *) tmp -> data;
-    gchar* old_str = formats;
-    formats = g_strconcat ( formats,
-                        "	• ",
-                        _(format -> complete_name),
-                        " (", format -> name, ")\n",
-                        NULL );
-    g_free ( old_str );
-    tmp = tmp -> next;
-    }
-
-    tmpstr = g_strconcat ( _("This assistant will help you import one or several "
+    format_str = gsb_import_formats_get_list_formats_to_string ( );
+    tmp_str = g_strconcat ( _("This assistant will help you import one or several "
                     "files into Grisbi."
                     "\n\n"
                     "Grisbi will try to do its best to guess which format are imported, "
                     "but you may have to manually set them in the list of next page.  "
                     "So far, the following formats are supported:"
                     "\n\n"),
-                    formats, NULL );
+                    format_str, NULL );
     assistant = gsb_assistant_new ( _("Importing transactions into Grisbi"),
-                        tmpstr,
+                        tmp_str,
                         "impexp.png",
                         NULL );
-    g_free (formats);
-    g_free (tmpstr);
+    g_free ( format_str );
+    g_free ( tmp_str );
 
     gsb_assistant_add_page ( assistant,
                         import_create_file_selection_page ( assistant ),
@@ -344,18 +338,54 @@ void importer_fichier ( void )
 
     if ( gsb_assistant_run ( assistant ) == GTK_RESPONSE_APPLY )
     {
-    gsb_status_wait ( TRUE );
-    traitement_operations_importees ();
-    gtk_widget_destroy ( assistant );
-    gsb_status_stop_wait ( TRUE );
+        gsb_status_wait ( TRUE );
+        traitement_operations_importees ();
+        gtk_widget_destroy ( assistant );
+        gsb_status_stop_wait ( TRUE );
     }
     else
     {
-    gtk_widget_destroy ( assistant );
+        gtk_widget_destroy ( assistant );
     }
 }
 
 
+/**
+ *
+ *
+ *
+ */
+gchar *gsb_import_formats_get_list_formats_to_string ( void )
+{
+    GSList *tmp_list = import_formats;
+    gchar *format_str = NULL;
+
+    while ( tmp_list )
+    {
+        gchar* tmp_str;
+        struct import_format *format;
+
+
+        format = (struct import_format *) tmp_list -> data;
+        tmp_str = g_strdup_printf ("	• %s (%s)\n", _(format -> complete_name), format -> name );
+        
+        if ( format_str == NULL )
+            format_str = tmp_str;
+        else
+        {
+            gchar* old_str = format_str;
+
+            format_str = g_strconcat ( format_str, tmp_str,  NULL );
+            g_free ( tmp_str );
+            g_free ( old_str );
+        }
+
+        tmp_list = tmp_list -> next;
+    }
+
+    return format_str;
+}
+
 
 /**
  *
@@ -418,14 +448,13 @@ GtkWidget *import_create_file_selection_page ( GtkWidget * assistant )
     tmp = import_formats;
     while ( tmp )
     {
-    GtkTreeIter iter;
-    struct import_format * format = (struct import_format *) tmp -> data;
+        GtkTreeIter iter;
+        struct import_format *format = (struct import_format *) tmp -> data;
 
-    gtk_list_store_append (GTK_LIST_STORE (list_acc), &iter);
-    gtk_list_store_set (GTK_LIST_STORE (list_acc), &iter, 0,
-                        format -> name, -1);
+        gtk_list_store_append (GTK_LIST_STORE (list_acc), &iter);
+        gtk_list_store_set (GTK_LIST_STORE (list_acc), &iter, 0, format -> name, -1);
 
-    tmp = tmp -> next;
+        tmp = tmp -> next;
     }
 
     g_object_set ( renderer,
@@ -456,7 +485,6 @@ GtkWidget *import_create_file_selection_page ( GtkWidget * assistant )
 }
 
 
-
 /**
  *
  *
@@ -890,7 +918,8 @@ GtkWidget *import_create_resume_page ( GtkWidget * assistant )
  */
 gboolean import_enter_resume_page ( GtkWidget * assistant )
 {
-    GSList * files = import_selected_files ( assistant ), * list;
+    GSList *files;
+    GSList *list;
     GtkTextBuffer * buffer;
     GtkTextIter iter;
     gchar * error_message = "";
@@ -899,26 +928,30 @@ gboolean import_enter_resume_page ( GtkWidget * assistant )
     liste_comptes_importes_error = NULL;
     liste_comptes_importes = NULL;
 
+    /* fichiers sélectionnés dans legestionnaire de fichiers */
+    files = import_selected_files ( assistant );
     while ( files )
     {
-    struct imported_file * imported = files -> data;
-    GSList * tmp = import_formats;
-
-    while ( tmp )
-    {
-        struct import_format * format = (struct import_format *) tmp -> data;
+        struct imported_file *imported = files -> data;
+        GSList * tmp = import_formats;
 
-        if ( !strcmp ( imported -> type, format -> name ) )
+        while ( tmp )
         {
-        format -> import ( assistant, imported );
-        tmp = tmp -> next;
-        continue;
-        }
+            struct import_format *format = (struct import_format *) tmp -> data;
+            
+            if ( !strcmp ( imported -> type, format -> name ) )
+            {
+                devel_print_str ( imported -> type );
 
-        tmp = tmp -> next;
-    }
+                format -> import ( assistant, imported );
+                tmp = tmp -> next;
+                continue;
+            }
+
+            tmp = tmp -> next;
+        }
 
-    files = files -> next;
+        files = files -> next;
     }
 
     buffer = g_object_get_data ( G_OBJECT ( assistant ), "text-buffer" );
@@ -927,93 +960,94 @@ gboolean import_enter_resume_page ( GtkWidget * assistant )
 
     if ( liste_comptes_importes )
     {
-    gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
-                        _("Congratulations !"), -1,
-                        "x-large", NULL);
-    gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
-
-    gtk_text_buffer_insert (buffer, &iter,
-                        _("You successfully imported files into Grisbi.  The "
-                        "following pages will help you set up imported data for "
-                        "the following files"),
-                        -1 );
-    gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
+        gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
+                            _("Congratulations !"), -1,
+                            "x-large", NULL);
+        gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
 
-    list = liste_comptes_importes;
-    while ( list )
-    {
-        struct struct_compte_importation * compte;
-        compte = list -> data;
+        gtk_text_buffer_insert (buffer, &iter,
+                            _("You successfully imported files into Grisbi.  The "
+                            "following pages will help you set up imported data for "
+                            "the following files"),
+                            -1 );
+        gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
 
-        /* Fix account name if needed. */
-        if ( ! compte -> nom_de_compte )
+        list = liste_comptes_importes;
+        while ( list )
         {
-        compte -> nom_de_compte = _("Unnamed Imported account");
-        }
+            struct struct_compte_importation * compte;
+            compte = list -> data;
 
-        tmpstr = g_strconcat ( "• ", compte -> nom_de_compte,
-                        " (",
-                        compte -> origine,
-                        ")\n\n",
-                        NULL );
-        gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
-                        tmpstr ,
-                        -1, "indented", NULL );
-        g_free ( tmpstr );
+            /* Fix account name if needed. */
+            if ( ! compte -> nom_de_compte )
+            {
+                compte -> nom_de_compte = _("Unnamed Imported account");
+            }
+            devel_print_str ( compte -> nom_de_compte );
+
+            tmpstr = g_strconcat ( "• ", compte -> nom_de_compte,
+                            " (",
+                            compte -> origine,
+                            ")\n\n",
+                            NULL );
+            gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
+                            tmpstr ,
+                            -1, "indented", NULL );
+            g_free ( tmpstr );
 
-        list = list -> next;
-    }
+            list = list -> next;
+        }
 
-    while ( gtk_notebook_get_n_pages ( g_object_get_data ( G_OBJECT (assistant), 
+        while ( gtk_notebook_get_n_pages ( g_object_get_data ( G_OBJECT (assistant),
                         "notebook" ) ) > IMPORT_FIRST_ACCOUNT_PAGE )
-    {
-        gtk_notebook_remove_page ( g_object_get_data ( G_OBJECT (assistant), "notebook" ), -1 );
-    }
-    affichage_recapitulatif_importation ( assistant );
+        {
+            gtk_notebook_remove_page ( g_object_get_data ( G_OBJECT (assistant), "notebook" ), -1 );
+        }
+        affichage_recapitulatif_importation ( assistant );
     }
     else
     {
-    gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
+        gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
                         _("Error !"), -1,
                         "x-large", NULL);
-    gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
+        gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
 
-    gtk_text_buffer_insert (buffer, &iter,
+        gtk_text_buffer_insert (buffer, &iter,
                         _("No file has been imported, please double check that they are "
                           "valid files.  Please make sure that they are not compressed and "
                           "that their format is valid."),
                         -1 );
-    if ( strlen ( error_message ) )
-    {
+        if ( strlen ( error_message ) )
+        {
+            gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
+            gtk_text_buffer_insert (buffer, &iter, error_message, -1 );
+        }
         gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
-        gtk_text_buffer_insert (buffer, &iter, error_message, -1 );
-    }
-    gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
     }
 
     if ( liste_comptes_importes_error )
     {
-    gtk_text_buffer_insert (buffer, &iter, _("The following files are in error: "), -1 );
-    gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
+        gtk_text_buffer_insert (buffer, &iter, _("The following files are in error: "), -1 );
+        gtk_text_buffer_insert (buffer, &iter, "\n\n", -1 );
 
-    list = liste_comptes_importes_error;
-    while ( list )
-    {
-        struct struct_compte_importation * compte;
-        compte = list -> data;
+        list = liste_comptes_importes_error;
+        while ( list )
+        {
+            struct struct_compte_importation * compte;
+            compte = list -> data;
 
-        tmpstr = g_strconcat ( "• ", compte -> nom_de_compte,
+            tmpstr = g_strconcat ( "• ", compte -> nom_de_compte,
                         " (",
                         compte -> origine,
                         ")\n\n",
                         NULL );
-        gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
+            gtk_text_buffer_insert_with_tags_by_name (buffer, &iter,
                         tmpstr,
                         -1, "indented", NULL );
-        g_free ( tmpstr );
+            g_free ( tmpstr );
 
-        list = list -> next;
-    }
+            list = list -> next;
+        }
     }
 
     return FALSE;
@@ -1024,7 +1058,7 @@ gboolean import_enter_resume_page ( GtkWidget * assistant )
  *
  *
  */
-GtkWidget *import_create_final_page ( GtkWidget * assistant )
+GtkWidget *import_create_final_page ( GtkWidget *assistant )
 {
     GtkWidget * view;
     GtkTextBuffer * buffer;
@@ -1063,10 +1097,10 @@ GtkWidget *import_create_final_page ( GtkWidget * assistant )
  *
  *
  */
-GSList *import_selected_files ( GtkWidget * assistant )
+GSList *import_selected_files ( GtkWidget *assistant )
 {
-    GSList * list = NULL;
-    GtkTreeModel * model;
+    GSList *list = NULL;
+    GtkTreeModel *model;
     GtkTreeIter iter;
 
     model = g_object_get_data ( G_OBJECT ( assistant ), "model" );
@@ -1076,21 +1110,21 @@ GSList *import_selected_files ( GtkWidget * assistant )
 
     do
     {
-    struct imported_file * imported;
-    gboolean selected;
+        struct imported_file *imported;
+        gboolean selected;
 
-    imported = g_malloc0 ( sizeof ( struct imported_file ) );
-    gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter,
+        imported = g_malloc0 ( sizeof ( struct imported_file ) );
+        gtk_tree_model_get ( GTK_TREE_MODEL ( model ), &iter,
                         IMPORT_FILESEL_SELECTED, &selected,
                         IMPORT_FILESEL_REALNAME, &(imported -> name),
                         IMPORT_FILESEL_TYPE, &(imported -> type),
                         IMPORT_FILESEL_CODING, &(imported -> coding_system),
                         -1 );
 
-    if ( selected )
-    {
-        list = g_slist_append ( list, imported );
-    }
+        if ( selected )
+        {
+            list = g_slist_append ( list, imported );
+        }
     }
     while ( gtk_tree_model_iter_next ( model, &iter ) );
 
diff --git a/src/import.h b/src/import.h
index 6665ff0..d4c98e9 100644
--- a/src/import.h
+++ b/src/import.h
@@ -96,7 +96,8 @@ struct struct_ope_importation
 #define IMPORT_TRANSACTION_ASK_FOR_TRANSACTION 1
 #define IMPORT_TRANSACTION_LEAVE_TRANSACTION 2
 
-struct imported_file {
+struct imported_file
+{
     gchar * name;
     const gchar * coding_system;
     const gchar * type;
@@ -105,7 +106,8 @@ struct imported_file {
 
 typedef gboolean ( * import_function ) ( GtkWidget * assistant, struct imported_file * );
 
-struct import_format {
+struct import_format
+{
     gchar * name;
     gchar * complete_name;
     gchar * extension;
@@ -115,18 +117,19 @@ struct import_format {
 /* START_DECLARATION */
 gint gsb_import_associations_cmp_assoc (struct struct_payee_asso *assoc_1,
                                         struct struct_payee_asso *assoc_2);
-GtkWidget * gsb_import_associations_gere_tiers ( void );
+GtkWidget *gsb_import_associations_gere_tiers ( void );
 void gsb_import_associations_init_variables ( void );
 gint gsb_import_associations_list_append_assoc ( gint payee_number,
                         const gchar *search_str );
 gboolean gsb_import_by_rule ( gint rule );
+gchar *gsb_import_formats_get_list_formats_to_string ( void );
 G_MODULE_EXPORT void gsb_import_register_account ( struct struct_compte_importation * account );
 G_MODULE_EXPORT void gsb_import_register_account_error ( struct struct_compte_importation * account );
 GSList *import_selected_files ( GtkWidget * assistant );
 void importer_fichier ( void );
-GtkWidget *onglet_importation (void);
-G_MODULE_EXPORT void register_import_format ( struct import_format * format );
-void register_import_formats ();
+GtkWidget *onglet_importation ( void );
+G_MODULE_EXPORT void register_import_format ( struct import_format *format );
+void register_import_formats ( void );
 G_MODULE_EXPORT gchar * unique_imported_name ( gchar * account_name );
 /* END_DECLARATION */
 
diff --git a/src/plugins/ofx/ofx.c b/src/plugins/ofx/ofx.c
index 19acbd4..27d1d47 100644
--- a/src/plugins/ofx/ofx.c
+++ b/src/plugins/ofx/ofx.c
@@ -48,9 +48,10 @@ static GSList * recuperation_donnees_ofx ( GtkWidget * assistant, struct importe
 /*END_STATIC*/
 
 
-static struct import_format ofx_format ={
-    "OFX", 
-    "Open Financial Exchange",	
+static struct import_format ofx_format =
+{
+    "OFX",
+    "Open Financial Exchange",
     "ofx",
     (import_function) recuperation_donnees_ofx,
 };
@@ -108,7 +109,7 @@ int ofx_proc_statement_cb(struct OfxStatementData data, void * statement_data);
  *
  *
  */
-GSList * recuperation_donnees_ofx ( GtkWidget * assistant, struct imported_file * imported )
+GSList *recuperation_donnees_ofx ( GtkWidget * assistant, struct imported_file * imported )
 {
     GSList *liste_tmp;
     gchar *argv[2] = { "", "" };
@@ -121,6 +122,7 @@ GSList * recuperation_donnees_ofx ( GtkWidget * assistant, struct imported_file
 
     /* 	la lib ofx ne tient pas compte du 1er argument */
     argv[1] = imported -> name;
+    devel_print_str ( imported -> name );
 
 #ifdef OFX_0_7
     ofx_context = libofx_get_new_context();
@@ -143,28 +145,31 @@ GSList * recuperation_donnees_ofx ( GtkWidget * assistant, struct imported_file
 
     if ( !compte_ofx_importation_en_cours )
     {
-	struct struct_compte_importation * account;
-	account = g_malloc0 ( sizeof ( struct struct_compte_importation ));
-	account -> nom_de_compte = unique_imported_name ( _("Invalid OFX file") );
-	account -> filename = g_strdup ( ofx_filename );
-	account -> real_filename = g_strdup (ofx_filename);
-	account -> origine = "OFX";
-	gsb_import_register_account_error ( account );
-	return ( FALSE );
+        struct struct_compte_importation * account;
+
+        account = g_malloc0 ( sizeof ( struct struct_compte_importation ));
+        account -> nom_de_compte = unique_imported_name ( _("Invalid OFX file") );
+        account -> filename = g_strdup ( ofx_filename );
+        account -> real_filename = g_strdup (ofx_filename);
+        account -> origine = "OFX";
+        gsb_import_register_account_error ( account );
+        devel_print_str ( account -> nom_de_compte );
+
+        return ( FALSE );
     }
 
     liste_tmp = liste_comptes_importes_ofx;
 
     while ( liste_tmp )
     {
-	if ( !erreur_import_ofx )
-	{
-	    gsb_import_register_account ( liste_tmp -> data );
-	}
-	else
-	{
-	    gsb_import_register_account_error ( liste_tmp -> data );
-	}
+        if ( !erreur_import_ofx )
+        {
+            gsb_import_register_account ( liste_tmp -> data );
+        }
+        else
+        {
+            gsb_import_register_account_error ( liste_tmp -> data );
+        }
 
 	liste_tmp = liste_tmp -> next;
     }
diff --git a/src/structures.h b/src/structures.h
index b8d6f97..26c8685 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -11,7 +11,7 @@
 #define VERSION_FICHIER "0.6.0"
 
 /* Define this when in Git development branch. */
-#define IS_DEVELOPMENT_VERSION 1
+#define IS_DEVELOPMENT_VERSION 0
 
 #define VERSION_FICHIER_ETAT "0.6.0"
 #define VERSION_FICHIER_CATEG "0.6.0"


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list