[grisbi-cvs] grisbi/src affichage.c, 1.158, 1.159 gsb_file_load.c, 1.178, 1.179 gsb_file_save.c, 1.126, 1.127 metatree.c, 1.135, 1.136

Pierre Biava pbiava at users.sourceforge.net
Thu Jun 4 22:11:33 CEST 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15425/src

Modified Files:
	affichage.c gsb_file_load.c gsb_file_save.c metatree.c 
Log Message:
fixes bug management of the title of the window of grisbi

Index: metatree.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/metatree.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- metatree.c	8 May 2009 17:21:15 -0000	1.135
+++ metatree.c	4 Jun 2009 20:11:31 -0000	1.136
@@ -274,8 +274,6 @@
     enum meta_tree_row_type type;
     gint number_transactions;
 
-    devel_debug_int ( division );
-
     if ( ! metatree_model_is_displayed ( model ) )
 	return;
 

Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- gsb_file_save.c	23 May 2009 19:25:10 -0000	1.126
+++ gsb_file_save.c	4 Jun 2009 20:11:31 -0000	1.127
@@ -139,6 +139,7 @@
 extern gint display_one_line;
 extern gint display_three_lines;
 extern gint display_two_lines;
+extern gchar *initial_file_title;
 extern gint no_devise_totaux_categ;
 extern gint no_devise_totaux_ib;
 extern gint no_devise_totaux_tiers;
@@ -517,6 +518,7 @@
     gchar *scheduler_column_width_write;
     gchar *transaction_column_width_write;
     gchar *new_string;
+    gchar *tmpstr;
     gchar *skipped_lines_string;
     gboolean is_archive = FALSE;
 
@@ -590,6 +592,27 @@
 	etat.is_archive )
 	is_archive = TRUE;
 
+    /* save the file_title or the initial_file_title */
+    if ( etat.display_grisbi_title == GSB_ACCOUNTS_FILE )
+    {
+        if ( titre_fichier && strlen (titre_fichier) )
+        {
+            if ( initial_file_title && strlen ( initial_file_title ) )
+                g_free ( initial_file_title );
+            initial_file_title = g_strdup ( titre_fichier );
+            tmpstr = titre_fichier;
+        }
+        else
+            tmpstr = "";
+    }
+    else
+    {
+        if ( initial_file_title && strlen (initial_file_title) )
+            tmpstr = initial_file_title;
+        else
+            tmpstr = "";
+    }
+
     /* save the general informations */
     new_string = g_markup_printf_escaped ( "\t<General\n"
 					   "\t\tFile_version=\"%s\"\n"
@@ -632,7 +655,7 @@
 	VERSION,
 	etat.crypt_file,
 	is_archive,
-	( titre_fichier ? titre_fichier : "" ),
+    tmpstr,
 	adresse_commune,
 	adresse_secondaire,
 	no_devise_totaux_tiers,

Index: affichage.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/affichage.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- affichage.c	10 May 2009 13:06:56 -0000	1.158
+++ affichage.c	4 Jun 2009 20:11:31 -0000	1.159
@@ -1,8 +1,8 @@
 /* ************************************************************************** */
 /*                                                                            */
-/*     Copyright (C)	2000-2008 Cédric Auger	(cedric at grisbi.org)	          */
-/*			2006-2008 Benjamin Drieu (bdrieu at april.org)	                      */
-/* 			http://www.grisbi.org				      						  */
+/*     Copyright (C)    2000-2008 Cédric Auger	(cedric at grisbi.org)           */
+/*          2006-2008 Benjamin Drieu (bdrieu at april.org)                       */
+/*          http://www.grisbi.org                                             */
 /*                                                                            */
 /*  This program is free software; you can redistribute it and/or modify      */
 /*  it under the terms of the GNU General Public License as published by      */
@@ -88,6 +88,7 @@
 extern GdkColor default_text_color[2];
 extern GtkWidget *fenetre_preferences;
 extern GtkWidget *hbox_title;
+extern gchar *initial_file_title;
 extern GtkWidget *label_titre_fichier;
 extern GtkWidget *logo_accueil;
 extern gchar *nom_fichier_comptes;
@@ -262,7 +263,7 @@
 
 /* ********************************************************************** */
 gboolean change_choix_utilise_logo ( GtkWidget *check_button,
-				     GtkWidget *hbox )
+                        GtkWidget *hbox )
 {
 
     etat.utilise_logo = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON 
@@ -298,7 +299,7 @@
 
 /* ********************************************************************** */
 gboolean change_choix_utilise_fonte_liste ( GtkWidget *check_button,
-					    GtkWidget *vbox )
+                        GtkWidget *vbox )
 {
     etat.utilise_fonte_listes = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( check_button ));
     gtk_widget_set_sensitive ( vbox,
@@ -319,7 +320,7 @@
  * \return
  * */
 void update_fonte_listes ( gchar *fontname,
-			   gpointer null)
+                        gpointer null)
 {
     GValue value = {0,};
     gchar *font;
@@ -587,7 +588,7 @@
  * \return FALSE
  * */
 static gboolean preferences_view_update_preview_logo ( GtkFileChooser *file_chooser,
-						       GtkWidget *preview )
+                        GtkWidget *preview )
 {
   char *filename;
   GdkPixbuf *pixbuf;
@@ -621,7 +622,7 @@
  * \param position Not used handler parameter.
  */
 gboolean update_homepage_title (GtkEntry *entry, gchar *value,
-				gint length, gint * position)
+                        gint length, gint * position)
 {
     /* at the first use of grisbi,label_titre_fichier doesn't still exist */
     if (label_titre_fichier)
@@ -805,7 +806,7 @@
  * \return FALSE
  * */
 static gboolean preferences_view_color_combobox_changed ( GtkWidget *combobox,
-							  GtkWidget *color_button )
+                        GtkWidget *color_button )
 {
     GtkTreeIter iter;
 
@@ -837,7 +838,7 @@
  * \return FALSE
  * */
 static gboolean preferences_view_color_changed ( GtkWidget *color_button,
-						 GtkWidget *combobox )
+                        GtkWidget *combobox )
 {
     GtkTreeIter iter;
 
@@ -878,7 +879,7 @@
  * \return FALSE
  * */
 static gboolean preferences_view_color_default ( GtkWidget *button,
-						 GtkWidget *combobox )
+                        GtkWidget *combobox )
 {
     GtkTreeIter iter;
 
@@ -939,26 +940,31 @@
     {
         case GSB_ACCOUNTS_FILE:
         gtk_widget_set_sensitive ( entry, TRUE);
-        if (titre_fichier && strlen (titre_fichier) )
+        if (initial_file_title && strlen (initial_file_title) )
+        {
+            gtk_entry_set_text ( GTK_ENTRY (entry), initial_file_title );
+            if (titre_fichier && strlen (titre_fichier) )
                 g_free (titre_fichier);
-        tmpstr = my_strdup ( gtk_entry_get_text (GTK_ENTRY (entry) ) );
-        if (tmpstr && strlen (tmpstr) )
+
+            titre_fichier = my_strdup ( initial_file_title );
+        }
+        else
         {
-            titre_fichier = my_strdup ( tmpstr );
+            gtk_entry_set_text ( GTK_ENTRY (entry), "" );
+            titre_fichier = g_strdup ( _("My accounts") );
+        }
+        gsb_file_update_window_title ( );
+        if (label_titre_fichier)
+        {
+            tmpstr = g_strconcat ("<span size=\"x-large\">",
+                        titre_fichier, "</span>", NULL );
+            gtk_label_set_markup ( GTK_LABEL ( label_titre_fichier ), tmpstr );
             g_free ( tmpstr );
-            gsb_file_update_window_title ( );
-            if (label_titre_fichier)
-            {
-                tmpstr = g_strconcat ("<span size=\"x-large\">",
-                            titre_fichier, "</span>", NULL );
-                gtk_label_set_markup ( GTK_LABEL ( label_titre_fichier ), tmpstr );
-                g_free ( tmpstr );
-            }
         }
         break;
         case GSB_ACCOUNT_OWNER:
         gtk_widget_set_sensitive ( entry, FALSE);
-	    account_number = gsb_gui_navigation_get_current_account ( );
+        account_number = gsb_gui_navigation_get_current_account ( );
         if ( account_number == -1 )
         {
             account_number = gsb_gui_navigation_get_last_account ( );

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- gsb_file_load.c	23 May 2009 21:29:00 -0000	1.178
+++ gsb_file_load.c	4 Jun 2009 20:11:31 -0000	1.179
@@ -200,6 +200,9 @@
 /* to import older file than 0.6, makes the link between report and comparison structures */
 static gint last_report_number;
 
+/* initial_file_title sert à garder le bon nom du fichier de compte */
+gchar *initial_file_title;
+
 /** filled only when loading a version before 0.6, contains the order of the accounts
  * in the 0.6, the accounts are saved directly in the good order
  * this is a list of the accounts number, in the good order */
@@ -698,6 +701,7 @@
         if ( titre_fichier )
             g_free ( titre_fichier );
         titre_fichier = my_strdup (attribute_values[i]);
+        initial_file_title = my_strdup (attribute_values[i]);
     }
 
     else if ( !strcmp ( attribute_names[i],



More information about the cvs mailing list