[grisbi-cvs] grisbi/src balance_estimate_hist.c, 1.15, 1.16 gsb_file_config.c, 1.92, 1.93 main.c, 1.167, 1.168 structures.h, 1.243, 1.244

Pierre Biava pbiava at users.sourceforge.net
Sat Mar 13 22:54:30 CET 2010


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32328/src

Modified Files:
	balance_estimate_hist.c gsb_file_config.c main.c structures.h 
Log Message:
Adding save the position of the window of grisbi

Index: structures.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/structures.h,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -d -r1.243 -r1.244
--- structures.h	13 Mar 2010 21:06:58 -0000	1.243
+++ structures.h	13 Mar 2010 21:54:28 -0000	1.244
@@ -125,6 +125,8 @@
 struct {
 
     /* geometry */
+    gint root_x;                                    /* main_window x position */
+    gint root_y;                                    /* main_window y position */
     gint main_width;                                /* main_window width */
     gint main_height;                               /* main_window height */
     gint full_screen;                               /* 1 to full screen, 0 else */

Index: main.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/main.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- main.c	13 Mar 2010 21:06:58 -0000	1.167
+++ main.c	13 Mar 2010 21:54:28 -0000	1.168
@@ -68,10 +68,7 @@
 /*END_STATIC*/
 
 
-
-
 /* vbox ajoutée dans la fenetre de base, contient le menu et la fenetre d'utilisation */
-
 G_MODULE_EXPORT GtkWidget *window = NULL;
 GtkWidget *window_vbox_principale = NULL;
 
@@ -285,8 +282,8 @@
     else
 	gtk_window_set_default_size ( GTK_WINDOW ( window ), 900, 600 );
 
-    /* display window centered */
-    //~ gtk_window_set_position ( GTK_WINDOW (window), GTK_WIN_POS_CENTER );
+    /* display window at position */
+    gtk_window_move ( GTK_WINDOW (window), conf.root_x, conf.root_y );
 
     gtk_widget_show ( window );
 
@@ -328,7 +325,6 @@
 
     gtk_main ();
 
-
     gsb_plugins_release ( );
 
     /* sauvegarde les raccourcis claviers */
@@ -381,6 +377,10 @@
 gboolean gsb_grisbi_close ( void )
 {
     devel_debug (NULL);
+    /* sauvegarde la position de la fenetre principale */
+    gtk_window_get_position ( GTK_WINDOW ( window ), &conf.root_x, &conf.root_y  );
+    printf ("root_x = %d root_y = %d\n", conf.root_x, conf.root_y);
+
     if (! main_window_delete_event (window, NULL))
     	gtk_widget_destroy ( window );
 

Index: balance_estimate_hist.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_hist.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- balance_estimate_hist.c	13 Mar 2010 21:06:58 -0000	1.15
+++ balance_estimate_hist.c	13 Mar 2010 21:54:28 -0000	1.16
@@ -888,7 +888,7 @@
         gtk_tree_store_append ( GTK_TREE_STORE ( model ), &fils, &parent );
         gtk_tree_store_set ( GTK_TREE_STORE ( model ),
                         &fils,
-                        SPP_HISTORICAL_DESC_COLUMN, div_name,
+                        SPP_HISTORICAL_DESC_COLUMN, g_strdup ( div_name ),
                         SPP_HISTORICAL_BALANCE_COLUMN, str_balance,
                         SPP_HISTORICAL_AVERAGE_COLUMN, str_average,
                         SPP_HISTORICAL_AVERAGE_AMOUNT, str_amount,
@@ -932,7 +932,7 @@
             sub_div_visible = TRUE;
             gtk_tree_view_expand_to_path ( tree_view, gtk_tree_model_get_path ( model, &fils ) );
         }
-        //~ g_free ( div_name );
+        g_free ( div_name );
         g_free ( str_balance );
         g_free ( str_average );
         g_free ( str_amount );

Index: gsb_file_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_config.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- gsb_file_config.c	13 Mar 2010 21:06:58 -0000	1.92
+++ gsb_file_config.c	13 Mar 2010 21:54:28 -0000	1.93
@@ -145,6 +145,16 @@
     }
 
     /* get the geometry */
+    conf.root_x = g_key_file_get_integer ( config,
+                        "Geometry",
+                        "Root_x",
+                        NULL );
+
+    conf.root_y = g_key_file_get_integer ( config,
+                        "Geometry",
+                        "Root_y",
+                        NULL );
+
     conf.main_width = g_key_file_get_integer ( config,
                         "Geometry",
                         "Width",
@@ -514,6 +524,16 @@
 
     g_key_file_set_integer ( config,
                         "Geometry",
+                        "Root_x",
+                        conf.root_x );
+
+    g_key_file_set_integer ( config,
+                        "Geometry",
+                        "Root_y",
+                        conf.root_y );
+
+    g_key_file_set_integer ( config,
+                        "Geometry",
                         "Width",
                         conf.main_width );
 



More information about the cvs mailing list