[grisbi-cvs] grisbi/src gsb_file_load.c, 1.148, 1.149 gsb_form.c, 1.107, 1.108 gsb_reconcile.c, 1.31, 1.32 gtk_combofix.c, 1.56, 1.57 traitement_variables.c, 1.164, 1.165

Pierre Biava pbiava at users.sourceforge.net
Thu Feb 12 22:46:09 CET 2009


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

Modified Files:
	gsb_file_load.c gsb_form.c gsb_reconcile.c gtk_combofix.c 
	traitement_variables.c 
Log Message:
correction for old glib version and various small changes

Index: traitement_variables.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/traitement_variables.c,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- traitement_variables.c	8 Feb 2009 20:38:24 -0000	1.164
+++ traitement_variables.c	12 Feb 2009 21:46:07 -0000	1.165
@@ -196,8 +196,10 @@
 	etat.modification_fichier = 0;
 	gsb_gui_sensitive_menu_item ( "FileMenu", "Save", NULL, FALSE );
     }
-    /* give the focus to the navigation_tree_view */
-    gtk_widget_grab_focus (navigation_tree_view);
+    /* give the focus to the navigation_tree_view pbiava 02/08/2009
+     * for account property window */
+    if ( navigation_tree_view )
+        gtk_widget_grab_focus ( navigation_tree_view );
 }
 
 

Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- gsb_form.c	8 Feb 2009 20:38:24 -0000	1.107
+++ gsb_form.c	12 Feb 2009 21:46:06 -0000	1.108
@@ -2367,7 +2367,7 @@
     /* as we modify or create a transaction, we invalidate the current report */
     gsb_report_set_current (0);
 
-    /* give the focus to the navigation_tree_view */
+    /* give the focus to the navigation_tree_view pbiava 02/08/2009 */
     gtk_widget_grab_focus (navigation_tree_view);
 
     modification_fichier ( TRUE );

Index: gtk_combofix.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gtk_combofix.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- gtk_combofix.c	8 Feb 2009 14:49:34 -0000	1.56
+++ gtk_combofix.c	12 Feb 2009 21:46:06 -0000	1.57
@@ -148,7 +148,7 @@
  *
  * \return the new widget
  * */
-/* comment by pbiava the 08/02/2009 : unused function 
+/* comment by pbiava the 02/08/2009 : unused function 
 GtkWidget *gtk_combofix_new ( GSList *list )
 {
     GtkComboFix *combofix = GTK_COMBOFIX ( gtk_type_new ( gtk_combofix_get_type () ) );
@@ -327,7 +327,7 @@
  *
  * \return
  * */
-/* comment by pbiava the 08/02/2009 : unused function 
+/* comment by pbiava the 02/08/2009 : unused function 
 void gtk_combofix_set_sort ( GtkComboFix *combofix,
 			     gboolean auto_sort )
 {
@@ -404,7 +404,7 @@
  *
  * \return
  * */
-/* comment by pbiava the 08/02/2009 : unused function 
+/* comment by pbiava the 02/08/2009 : unused function 
 void gtk_combofix_view_list ( GtkComboFix *combofix,
 			      gboolean show )
 {

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- gsb_file_load.c	7 Feb 2009 20:19:15 -0000	1.148
+++ gsb_file_load.c	12 Feb 2009 21:46:06 -0000	1.149
@@ -85,6 +85,7 @@
 static void gsb_file_load_color_part ( const gchar **attribute_names,
 				const gchar **attribute_values );
 static gboolean gsb_file_load_copy_old_file ( gchar *filename );
+static gboolean gsb_file_load_copy_old_file_and_glib ( gchar *filename, gchar *file_content);
 static void gsb_file_load_currency ( const gchar **attribute_names,
 			      const gchar **attribute_values );
 static void gsb_file_load_currency_link ( const gchar **attribute_names,
@@ -321,9 +322,13 @@
 	else
 	{
         /* backup of an old file grisbi */
+#if GLIB_CHECK_VERSION(2,18,0)
         if ( ! gsb_file_load_copy_old_file ( filename ) )
             return FALSE;
-
+# else
+        if ( ! gsb_file_load_copy_old_file_and_glib ( filename, file_content ) )
+            return FALSE;
+#endif
 	    /* fill the GMarkupParser for the last xml structure */
 	    markup_parser -> start_element = (void *) gsb_file_load_start_element_before_0_6;
 	    markup_parser -> end_element = (void *) gsb_file_load_end_element_before_0_6;
@@ -7688,6 +7693,30 @@
     }
     return FALSE;
 }
+
+gboolean gsb_file_load_copy_old_file_and_glib ( gchar *filename, gchar *file_content)
+{
+    if ( g_str_has_suffix (filename, ".gsb" ) )
+    {
+        gchar *new_filename;
+        GError * error = NULL;
+
+        new_filename = gsb_string_remplace_string ( filename, ".gsb",
+                        "-old-version.gsb" );
+        if (g_file_set_contents ( new_filename, file_content,-1, &error ))
+        {
+            gchar *tmpstr = g_strdup_printf ( 
+                        _("Your old file grisbi was saved as: \n\n%s"),
+                        basename ( new_filename ) );
+            dialogue ( tmpstr );
+            g_free ( tmpstr );
+            return TRUE;
+        }
+        else
+            dialogue_error (error -> message );
+    }
+    return FALSE;
+}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: gsb_reconcile.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_reconcile.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- gsb_reconcile.c	12 Feb 2009 05:26:20 -0000	1.31
+++ gsb_reconcile.c	12 Feb 2009 21:46:06 -0000	1.32
@@ -602,7 +602,7 @@
 
     /* update the P and T to R in the list if R are shown,
      * else just re-filter */
-    /* comment by pbiava 02/11/2009 not update the tag P or T in R  bug */
+    /* comment by pbiava 02/11/2009 no update tag P or T in R  fix bug 477 */
     //~ if (gsb_data_account_get_r (account_number))
         transaction_list_update_element (ELEMENT_MARK);
     //~ else



More information about the cvs mailing list