[grisbi-cvs] [SCM] grisbi branch, grisbi-0.8.x, updated. upstream_version_0_8_2-8-gd6d967a
Pierre Biava
nobody at users.sourceforge.net
Sat Feb 26 21:43:50 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, grisbi-0.8.x has been updated
via d6d967a6dc255a00cd414cd6d6f5bc24d75ee73d (commit)
via 3b1ff20967c79b49aaf909e1f6d0d60cb178a5a5 (commit)
via f2771bf4fc92e72b847a9375fd5c787b0d84e08a (commit)
from 6697ec365f3829f945b82888e59851657ca198ca (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 d6d967a6dc255a00cd414cd6d6f5bc24d75ee73d
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Feb 26 20:35:39 2011 +0100
Changing the .gitignore file (cherry picked from commit bcbfe13c072999c7a7267709aad5927e2a17ef42)
commit 3b1ff20967c79b49aaf909e1f6d0d60cb178a5a5
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Feb 26 21:16:47 2011 +0100
fixes bug 1296
(cherry picked from commit 500bfbd5c92f475fe894f1c3ad60ce4ee3d39fd0)
commit f2771bf4fc92e72b847a9375fd5c787b0d84e08a
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Feb 26 19:53:42 2011 +0100
Adding the XDG directories in the printed variables and fix memory leaks from master 7c6e0bbf
-----------------------------------------------------------------------
Changes:
diff --git a/.gitignore b/.gitignore
index 1c80f68..06ebe93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,6 @@ gisbi.anjuta
TODO*
doxygen/
*.o
+*.ho
+*~
+*.md5
diff --git a/src/erreur.c b/src/erreur.c
index 05cf241..e61084c 100644
--- a/src/erreur.c
+++ b/src/erreur.c
@@ -40,6 +40,7 @@
#include "gsb_real.h"
#include "gsb_status.h"
#include "import.h"
+#include "main.h"
#include "structures.h"
#include "traitement_variables.h"
#include "utils.h"
@@ -485,8 +486,8 @@ gboolean gsb_debug_start_log ( void )
if ( debug_file )
{
GtkWidget *widget;
- struct lconv *conv;
-
+ gchar *tmp_str_2;
+
widget = gtk_ui_manager_get_widget ( ui_manager, "/menubar/FileMenu/DebugMode" );
etat.debug_mode = TRUE;
@@ -507,23 +508,7 @@ gboolean gsb_debug_start_log ( void )
g_free ( tmp_str );
/* write locales */
- conv = localeconv();
- tmp_str = g_strdup_printf ( "Variables d'environnement :\n\n"
- "LANG = %s\n\n"
- "Currency\n"
- "\tcurrency_symbol = %s\n"
- "\tmon_thousands_sep = \"%s\"\n"
- "\tmon_decimal_point = %s\n"
- "\tpositive_sign = \"%s\"\n"
- "\tnegative_sign = \"%s\"\n"
- "\tfrac_digits = \"%d\"\n\n",
- g_getenv ( "LANG"),
- conv->currency_symbol,
- g_locale_to_utf8 ( conv->mon_thousands_sep, -1, NULL, NULL, NULL ),
- g_locale_to_utf8 ( conv->mon_decimal_point, -1, NULL, NULL, NULL ),
- g_locale_to_utf8 ( conv->positive_sign, -1, NULL, NULL, NULL ),
- g_locale_to_utf8 ( conv->negative_sign, -1, NULL, NULL, NULL ),
- conv->frac_digits );
+ tmp_str = gsb_main_get_print_locale_var ( );
fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
fflush ( debug_file );
@@ -540,25 +525,7 @@ gboolean gsb_debug_start_log ( void )
g_free ( tmp_str );
- tmp_str = g_strdup_printf ("Paths\n"
- "\tC_GRISBIRC = %s\n"
- "\tC_PATH_CONFIG = %s\n"
- "\tC_PATH_CONFIG_ACCELS = %s\n"
- "\tC_PATH_DATA_FILES = %s\n"
- "\tGRISBI_LOCALEDIR = %s\n"
- "\tGRISBI_PLUGINS_DIR = %s\n"
- "\tGRISBI_PIXMAPS_DIR = %s\n\n",
- C_GRISBIRC,
- C_PATH_CONFIG,
- C_PATH_CONFIG_ACCELS,
- C_PATH_DATA_FILES,
-#ifdef GTKOSXAPPLICATION
- grisbi_osx_get_locale_dir ( ),
-#else
- LOCALEDIR,
-#endif
- GRISBI_PLUGINS_DIR,
- GRISBI_PIXMAPS_DIR );
+ tmp_str = gsb_main_get_print_dir_var ( );
fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
fflush ( debug_file );
@@ -572,11 +539,13 @@ gboolean gsb_debug_start_log ( void )
g_free ( tmp_str );
tmp_str = gsb_import_formats_get_list_formats_to_string ( );
+ tmp_str_2 = g_strconcat ( tmp_str, "\n", NULL );
- fwrite ( tmp_str, sizeof (gchar), strlen ( tmp_str ), debug_file );
+ fwrite ( tmp_str_2, sizeof (gchar), strlen ( tmp_str_2 ), debug_file );
fflush ( debug_file );
g_free ( tmp_str );
+ g_free ( tmp_str_2 );
}
else
dialogue_error (_("Grisbi failed to create the log file...") );
diff --git a/src/gsb_form.c b/src/gsb_form.c
index e66c7c2..5d93c8a 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -1725,33 +1725,40 @@ gboolean gsb_form_entry_lose_focus ( GtkWidget *entry,
case TRANSACTION_FORM_CATEGORY :
if ( strlen ( gtk_entry_get_text ( GTK_ENTRY (entry))))
{
- /* if it's a transfer, set the content of the contra combo */
- if ( gsb_data_form_check_for_value ( TRANSACTION_FORM_CONTRA ))
- {
- /* if it's a transfer, set the contra_method of payment menu */
- gint contra_account_number;
+ /* if it's a transfer, set the content of the contra combo */
+ if ( gsb_data_form_check_for_value ( TRANSACTION_FORM_CONTRA ) )
+ {
+ /* if it's a transfer, set the contra_method of payment menu */
+ gint contra_account_number;
- if ( (contra_account_number = gsb_form_check_for_transfer ( gtk_entry_get_text ( GTK_ENTRY (entry)))) >= 0
- &&
- contra_account_number != account_number )
- {
- if ( gsb_form_widget_check_empty (gsb_form_widget_get_widget (TRANSACTION_FORM_CREDIT)))
- /* there is something in debit */
- gsb_payment_method_create_combo_list ( gsb_form_widget_get_widget (TRANSACTION_FORM_CONTRA),
- GSB_PAYMENT_CREDIT,
- contra_account_number, 0, TRUE );
- else
- /* there is something in credit */
- gsb_payment_method_create_combo_list ( gsb_form_widget_get_widget (TRANSACTION_FORM_CONTRA),
- GSB_PAYMENT_DEBIT,
- contra_account_number, 0, TRUE );
- }
- else
- gtk_widget_hide ( gsb_form_widget_get_widget (TRANSACTION_FORM_CONTRA));
- }
+ contra_account_number = gsb_form_check_for_transfer ( gtk_entry_get_text (
+ GTK_ENTRY ( entry ) ) );
+ if ( contra_account_number >= 0 && contra_account_number != account_number )
+ {
+ if ( gsb_form_widget_check_empty ( gsb_form_widget_get_widget ( TRANSACTION_FORM_CREDIT ) ) )
+ /* there is something in debit */
+ gsb_payment_method_create_combo_list (
+ gsb_form_widget_get_widget ( TRANSACTION_FORM_CONTRA ),
+ GSB_PAYMENT_CREDIT,
+ contra_account_number, 0, TRUE );
+ else
+ /* there is something in credit */
+ gsb_payment_method_create_combo_list (
+ gsb_form_widget_get_widget ( TRANSACTION_FORM_CONTRA ),
+ GSB_PAYMENT_DEBIT,
+ contra_account_number, 0, TRUE );
+ }
+ else
+ gtk_widget_hide ( gsb_form_widget_get_widget (TRANSACTION_FORM_CONTRA));
+ }
+ if ( strcmp ( gtk_entry_get_text ( GTK_ENTRY ( entry ) ), _("Split of transaction") )
+ && gtk_widget_get_visible ( form_button_recover_split ) )
+ {
+ gtk_widget_hide ( form_button_recover_split );
+ }
}
else
- string = gsb_form_widget_get_name (TRANSACTION_FORM_CATEGORY);
+ string = gsb_form_widget_get_name (TRANSACTION_FORM_CATEGORY);
break;
case TRANSACTION_FORM_CHEQUE :
diff --git a/src/main.c b/src/main.c
index 675f49c..a8ae1ad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -91,6 +91,7 @@ static gboolean gsb_grisbi_init_app ( void );
static void gsb_grisbi_load_file_if_necessary ( cmdline_options *opt );
static gboolean gsb_grisbi_print_environment_var ( void );
static void gsb_grisbi_trappe_signal_sigsegv ( void );
+static void gsb_main_free_global_definitions ( void );
static void main_mac_osx ( int argc, char **argv );
static void main_linux ( int argc, char **argv );
static void main_win_32 ( int argc, char **argv );
@@ -395,51 +396,24 @@ void main_win_32 ( int argc, char **argv )
* */
gboolean gsb_grisbi_print_environment_var ( void )
{
- struct lconv *conv;
+ gchar *tmp_str;
- /* test local pour les nombres */
- conv = localeconv();
-
- printf ("Variables d'environnement :\n\n" );
- printf ("LANG = %s\n\n"
- "Currency\n"
- "\tcurrency_symbol = %s\n"
- "\tmon_thousands_sep = \"%s\"\n"
- "\tmon_decimal_point = %s\n"
- "\tpositive_sign = \"%s\"\n"
- "\tnegative_sign = \"%s\"\n"
- "\tfrac_digits = \"%d\"\n\n",
- g_getenv ( "LANG"),
- conv->currency_symbol,
- g_locale_to_utf8 ( conv->mon_thousands_sep, -1, NULL, NULL, NULL ),
- g_locale_to_utf8 ( conv->mon_decimal_point, -1, NULL, NULL, NULL ),
- g_locale_to_utf8 ( conv->positive_sign, -1, NULL, NULL, NULL ),
- g_locale_to_utf8 ( conv->negative_sign, -1, NULL, NULL, NULL ),
- conv->frac_digits );
-
- printf ("gint64\n" );
- printf ("\tG_GINT64_MODIFIER = \"%s\"\n", G_GINT64_MODIFIER );
- printf ("\t%"G_GINT64_MODIFIER"d\n\n", G_MAXINT64 );
-
- printf ("Paths\n"
- "\tC_GRISBIRC = %s\n"
- "\tC_PATH_CONFIG = %s\n"
- "\tC_PATH_CONFIG_ACCELS = %s\n"
- "\tC_PATH_DATA_FILES = %s\n"
- "\tGRISBI_LOCALEDIR = %s\n"
- "\tGRISBI_PLUGINS_DIR = %s\n"
- "\tGRISBI_PIXMAPS_DIR = %s\n\n",
- C_GRISBIRC,
- C_PATH_CONFIG,
- C_PATH_CONFIG_ACCELS,
- C_PATH_DATA_FILES,
-#ifdef GTKOSXAPPLICATION
- grisbi_osx_get_locale_dir ( ),
-#else
- LOCALEDIR,
-#endif
- GRISBI_PLUGINS_DIR,
- GRISBI_PIXMAPS_DIR );
+ g_printf ("Variables d'environnement :\n\n" );
+
+ tmp_str = gsb_main_get_print_locale_var ( );
+ g_printf ("%s", tmp_str);
+
+ g_free ( tmp_str );
+
+ g_printf ( "gint64\n\tG_GINT64_MODIFIER = \"%s\"\n"
+ "\t%"G_GINT64_MODIFIER"d\n\n",
+ G_GINT64_MODIFIER,
+ G_MAXINT64 );
+
+ tmp_str = gsb_main_get_print_dir_var ( );
+ g_printf ("%s", tmp_str);
+
+ g_free ( tmp_str );
return FALSE;
}
@@ -694,6 +668,9 @@ gboolean gsb_grisbi_close ( void )
if (etat.debug_mode && debug_file)
fclose (debug_file);
+ /* clean the initial vars */
+ gsb_main_free_global_definitions ( );
+
return FALSE;
}
@@ -800,6 +777,110 @@ gboolean gsb_main_set_grisbi_title ( gint account_number )
}
+/**
+ *
+ * \return must be freed
+ *
+ */
+gchar *gsb_main_get_print_locale_var ( void )
+{
+ struct lconv *conv;
+ gchar *locale_str = NULL;
+ gchar *mon_thousands_sep;
+ gchar *mon_decimal_point;
+ gchar *positive_sign;
+ gchar *negative_sign;
+
+ /* test local pour les nombres */
+ conv = localeconv();
+
+ mon_thousands_sep = g_locale_to_utf8 ( conv->mon_thousands_sep, -1, NULL, NULL, NULL );
+ mon_decimal_point = g_locale_to_utf8 ( conv->mon_decimal_point, -1, NULL, NULL, NULL );
+ positive_sign = g_locale_to_utf8 ( conv->positive_sign, -1, NULL, NULL, NULL );
+ negative_sign = g_locale_to_utf8 ( conv->negative_sign, -1, NULL, NULL, NULL );
+
+ locale_str = g_strdup_printf ( "LANG = %s\n\n"
+ "Currency\n"
+ "\tcurrency_symbol = %s\n"
+ "\tmon_thousands_sep = \"%s\"\n"
+ "\tmon_decimal_point = %s\n"
+ "\tpositive_sign = \"%s\"\n"
+ "\tnegative_sign = \"%s\"\n"
+ "\tfrac_digits = \"%d\"\n\n",
+ g_getenv ( "LANG"),
+ conv->currency_symbol,
+ mon_thousands_sep,
+ mon_decimal_point,
+ positive_sign,
+ negative_sign,
+ conv->frac_digits );
+
+ g_free ( mon_thousands_sep );
+ g_free ( mon_decimal_point );
+ g_free ( positive_sign );
+ g_free ( negative_sign );
+
+ return locale_str;
+}
+
+
+/**
+ *
+ * \return must be freed
+ *
+ */
+gchar *gsb_main_get_print_dir_var ( void )
+{
+ gchar *path_str = NULL;
+ gchar *tmp_str = NULL;
+
+#ifdef GTKOSXAPPLICATION
+ tmp_str = grisbi_osx_get_locale_dir ( );
+#else
+ tmp_str = g_strdup ( LOCALEDIR );
+#endif
+
+ path_str = g_strdup_printf ( "Paths\n"
+ "\tXDG_DATA_HOME = %s\n"
+ "\tXDG_CONFIG_HOME = %s\n\n"
+ "\tC_GRISBIRC = %s\n"
+ "\tC_PATH_CONFIG = %s\n"
+ "\tC_PATH_CONFIG_ACCELS = %s\n"
+ "\tC_PATH_DATA_FILES = %s\n\n"
+ "\tGRISBI_LOCALEDIR = %s\n"
+ "\tGRISBI_PLUGINS_DIR = %s\n"
+ "\tGRISBI_PIXMAPS_DIR = %s\n\n",
+ g_get_user_data_dir ( ),
+ g_get_user_config_dir ( ),
+ C_GRISBIRC,
+ C_PATH_CONFIG,
+ C_PATH_CONFIG_ACCELS,
+ C_PATH_DATA_FILES,
+ tmp_str,
+ GRISBI_PLUGINS_DIR,
+ GRISBI_PIXMAPS_DIR );
+
+ g_free ( tmp_str );
+
+ return path_str;
+}
+
+
+/**
+ * libère la mémoire des définitions globales
+ *
+ *
+ */
+void gsb_main_free_global_definitions ( void )
+{
+ g_free ( C_GRISBIRC );
+ g_free ( C_OLD_GRISBIRC );
+ g_free ( C_PATH_CONFIG );
+ g_free ( C_PATH_CONFIG_ACCELS );
+ g_free ( C_PATH_DATA_FILES );
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
diff --git a/src/main.h b/src/main.h
index b6bcdd1..267f7d0 100644
--- a/src/main.h
+++ b/src/main.h
@@ -6,6 +6,8 @@
/* START_DECLARATION */
gboolean gsb_grisbi_close ( void );
int main (int argc, char **argv);
+gchar *gsb_main_get_print_locale_var ( void );
+gchar *gsb_main_get_print_dir_var ( void );
gboolean gsb_main_set_grisbi_title ( gint account_number );
/* END_DECLARATION */
#endif
hooks/post-receive
--
grisbi
More information about the cvs
mailing list