[grisbi-cvs] grisbi/src dialog.c, 1.74, 1.75 dialog.h, 1.33, 1.34 help.c, 1.90, 1.91 main.c, 1.151, 1.152 parametres.c, 1.207, 1.208 structures.h, 1.235, 1.236 utils.c, 1.56, 1.57 utils.h, 1.24, 1.25

Pierre Biava pbiava at users.sourceforge.net
Sun Oct 11 18:24:36 CEST 2009


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

Modified Files:
	dialog.c dialog.h help.c main.c parametres.c structures.h 
	utils.c utils.h 
Log Message:
Added a test version of GTK

Index: structures.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/structures.h,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -d -r1.235 -r1.236
--- structures.h	2 Oct 2009 21:35:04 -0000	1.235
+++ structures.h	11 Oct 2009 16:24:34 -0000	1.236
@@ -18,8 +18,9 @@
 #define VERSION_FICHIER_ETAT "0.6.0"
 #define VERSION_FICHIER_CATEG "0.6.0"
 #define VERSION_FICHIER_IB "0.6.0"
-
-
+#define VERSION_GTK_MAJOR 2
+#define VERSION_GTK_MINOR 16
+#define VERSION_GTK_MICRO 0
 
 #define COLON(s) (g_strconcat ( s, " : ", NULL ))
 #define SPACIFY(s) (g_strconcat ( " ", s, " ", NULL ))

Index: help.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/help.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- help.c	10 Oct 2009 23:05:26 -0000	1.90
+++ help.c	11 Oct 2009 16:24:34 -0000	1.91
@@ -24,9 +24,9 @@
 
 /*START_INCLUDE*/
 #include "help.h"
+#include "./utils.h"
 #include "./gsb_plugins.h"
 #include "./gsb_select_icon.h"
-#include "./utils.h"
 #include "./utils_str.h"
 #include "./include.h"
 /*END_INCLUDE*/
@@ -136,6 +136,9 @@
     /* Plugins list */
     gchar* comments = g_strconcat ( _("Personal finance manager for everyone\n"),
 				    gsb_plugin_get_list(),
+                    "\n Version de GTK : (",
+                    get_gtk_run_version ( ),
+                    ") \n",
 				    warn_print,
 				    NULL );
 
@@ -156,7 +159,7 @@
     gtk_about_dialog_set_website ( GTK_ABOUT_DIALOG (about), "http://www.grisbi.org/");
     gtk_about_dialog_set_license ( GTK_ABOUT_DIALOG (about), license );
     gtk_about_dialog_set_wrap_license ( GTK_ABOUT_DIALOG (about), TRUE );
-	gtk_about_dialog_set_version ( GTK_ABOUT_DIALOG (about), g_strconcat(VERSION, " (",get_gtk_run_version(), ")") );
+	gtk_about_dialog_set_version ( GTK_ABOUT_DIALOG (about), VERSION );
     gtk_about_dialog_set_artists ( GTK_ABOUT_DIALOG (about), artists );
     gtk_about_dialog_set_documenters ( GTK_ABOUT_DIALOG (about), documenters );
     gtk_about_dialog_set_authors ( GTK_ABOUT_DIALOG (about), auteurs );

Index: utils.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- utils.h	10 Oct 2009 23:05:26 -0000	1.24
+++ utils.h	11 Oct 2009 16:24:34 -0000	1.25
@@ -7,24 +7,24 @@
 /* START_DECLARATION */
 gboolean assert_account_loaded ();
 gboolean desensitive_widget ( gpointer object,
-			      GtkWidget *widget );
+                        GtkWidget *widget );
+gchar *get_gtk_run_version ( void );
 gboolean lance_navigateur_web ( const gchar *url );
 gboolean met_en_normal ( GtkWidget *event_box,
-			 GdkEventMotion *event,
-			 gpointer pointeur );
+                        GdkEventMotion *event,
+                        gpointer pointeur );
 gboolean met_en_prelight ( GtkWidget *event_box,
-			   GdkEventMotion *event,
-			   gpointer pointeur );
+                        GdkEventMotion *event,
+                        gpointer pointeur );
 GtkWidget *new_paddingbox_with_title (GtkWidget * parent, gboolean fill, gchar * title);
 GtkWidget *new_vbox_with_title_and_icon ( gchar * title,
-					  gchar * image_filename);
+                        gchar * image_filename);
 gboolean radio_set_active_linked_widgets ( GtkWidget * widget );
 void register_button_as_linked ( GtkWidget * widget, GtkWidget * linked );
 gboolean sens_desensitive_pointeur ( GtkWidget *bouton,
-				     GtkWidget *widget );
+                        GtkWidget *widget );
 gboolean sensitive_widget ( gpointer object,
-			    GtkWidget *widget );
+                        GtkWidget *widget );
 void update_ecran ( void );
-gchar * get_gtk_run_version(void);
 /* END_DECLARATION */
 #endif

Index: parametres.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/parametres.c,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -d -r1.207 -r1.208
--- parametres.c	3 Oct 2009 22:14:56 -0000	1.207
+++ parametres.c	11 Oct 2009 16:24:34 -0000	1.208
@@ -617,6 +617,8 @@
             tmpstr = g_strdup_printf ( _(messages[i] . hint), titre_fichier );
         else if ( g_utf8_collate ( messages[i].name, "development-version" ) == 0 )
             tmpstr = g_strdup_printf ( _(messages[i] . hint), VERSION );
+        else if ( g_utf8_collate ( messages[i].name, "gtk_obsolete" ) == 0 )
+            tmpstr = g_strdup_printf ( _(messages[i] . hint), get_gtk_run_version ( ) );
         else
             tmpstr = g_strdup ( _(messages[i] . hint) );
 

Index: utils.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- utils.c	10 Oct 2009 23:05:26 -0000	1.56
+++ utils.c	11 Oct 2009 16:24:34 -0000	1.57
@@ -1,9 +1,9 @@
 /* ************************************************************************** */
-/*     Copyright (C)	2000-2003 Cédric Auger (cedric at grisbi.org)	      */
-/*			2003-2008 Benjamin Drieu (bdrieu at april.org)	      */
-/*			2003-2004 Alain Portal (aportal at univ-montp2.fr)	      */
-/*			2003-2004 Francois Terrot (francois.terrot at grisbi.org)*/
-/* 			http://www.grisbi.org				      */
+/*     Copyright (C)    2000-2003 Cédric Auger (cedric at grisbi.org)            */
+/*          2003-2008 Benjamin Drieu (bdrieu at april.org)                       */
+/*          2003-2004 Alain Portal (aportal at univ-montp2.fr)                   */
+/*          2003-2004 Francois Terrot (francois.terrot at grisbi.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      */
@@ -26,9 +26,9 @@
 
 /*START_INCLUDE*/
 #include "utils.h"
-#include "./utils_str.h"
 #include "./dialog.h"
 #include "./gsb_data_account.h"
+#include "./utils_str.h"
 #include "./gsb_file_config.h"
 #include "./include.h"
 #include "./erreur.h"
@@ -48,8 +48,8 @@
 
 /* ************************************************************************* */
 gboolean met_en_prelight ( GtkWidget *event_box,
-			   GdkEventMotion *event,
-			   gpointer pointeur )
+                        GdkEventMotion *event,
+                        gpointer pointeur )
 {
     gtk_widget_set_state ( GTK_WIDGET ( GTK_BIN (event_box)->child ), GTK_STATE_PRELIGHT );
     return FALSE;
@@ -58,8 +58,8 @@
 
 /* ************************************************************************* */
 gboolean met_en_normal ( GtkWidget *event_box,
-			 GdkEventMotion *event,
-			 gpointer pointeur )
+                        GdkEventMotion *event,
+                        gpointer pointeur )
 {
     gtk_widget_set_state ( GTK_WIDGET ( GTK_BIN (event_box)->child ), GTK_STATE_NORMAL );
     return FALSE;
@@ -80,10 +80,10 @@
  * \return FALSE
  * */
 gboolean sens_desensitive_pointeur ( GtkWidget *bouton,
-				     GtkWidget *widget )
+                        GtkWidget *widget )
 {
     gtk_widget_set_sensitive ( widget,
-			       gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( bouton )));
+                        gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( bouton )));
 
     return FALSE;
 }
@@ -99,10 +99,9 @@
  * \return FALSE
  * */
 gboolean sensitive_widget ( gpointer object,
-			    GtkWidget *widget )
+                        GtkWidget *widget )
 {
-    gtk_widget_set_sensitive ( widget,
-			       TRUE );
+    gtk_widget_set_sensitive ( widget, TRUE );
     return FALSE;
 }
 
@@ -115,11 +114,9 @@
  *
  * \return FALSE
  * */
-gboolean desensitive_widget ( gpointer object,
-			      GtkWidget *widget )
+gboolean desensitive_widget ( gpointer object, GtkWidget *widget )
 {
-    gtk_widget_set_sensitive ( widget,
-			       FALSE );
+    gtk_widget_set_sensitive ( widget, FALSE );
     return FALSE;
 }
 
@@ -144,13 +141,15 @@
     
 #else // !_WIN32
     if ( !(etat.browser_command
-	   &&
-	   strlen ( etat.browser_command )))
+     &&
+     strlen ( etat.browser_command )))
     {
     
-	gchar* tmpstr = g_strdup_printf ( _("Grisbi was unable to execute a web browser to browse url <tt>%s</tt>.  Please adjust your settings to a valid executable."), url );
-	dialogue_error_hint ( tmpstr, _("Cannot execute web browser") );
-	g_free (tmpstr);
+    gchar* tmpstr = g_strdup_printf ( _("Grisbi was unable to execute a web browser to "
+                        "browse url <tt>%s</tt>.  Please adjust your settings to a valid "
+                        "executable."), url );
+    dialogue_error_hint ( tmpstr, _("Cannot execute web browser") );
+    g_free (tmpstr);
     }
 #endif // _WIN32
 
@@ -162,9 +161,7 @@
 
     /* search if the sequence `%s' is in the string
      * and split the string before and after this delimiter */
-    split = g_strsplit ( etat.browser_command,
-			 "%s",
-			 0 );
+    split = g_strsplit ( etat.browser_command, "%s", 0 );
 
     if ( split[1] )
     {
@@ -280,7 +277,7 @@
  * widgets and user defined widgets
  */
 GtkWidget *new_vbox_with_title_and_icon ( gchar * title,
-					  gchar * image_filename)
+                        gchar * image_filename)
 {
     GtkWidget *vbox_pref, *hbox, *label, *image, *eb;
     GtkStyle * style;
@@ -398,14 +395,14 @@
 /**
  *  Cette fonction renvoie une string de la version de GTK
  */
-gchar * get_gtk_run_version(void)
+gchar *get_gtk_run_version ( void )
 {
-	gchar * version = NULL; 
+	gchar *version = NULL;
 
-	version = g_strconcat( "GTK ",
-		utils_str_itoa ( (guint) gtk_major_version ), ".",
-		utils_str_itoa ( (guint) gtk_minor_version ), ".", 
-		utils_str_itoa ( (guint) gtk_micro_version ));
+   	version = g_strconcat( utils_str_itoa ( (guint) gtk_major_version ), ".",
+                        utils_str_itoa ( (guint) gtk_minor_version ), ".", 
+                        utils_str_itoa ( (guint) gtk_micro_version ),
+                        NULL);
 	return version;
 }
 

Index: dialog.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/dialog.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- dialog.c	7 Oct 2009 21:46:21 -0000	1.74
+++ dialog.c	11 Oct 2009 16:24:34 -0000	1.75
@@ -31,7 +31,6 @@
 
 /*START_STATIC*/
 static void dialogue_conditional ( gchar *text, gchar *var );
-static void dialogue_conditional_hint ( gchar *hint, gchar *text, gchar *var );
 static GtkDialog *dialogue_conditional_new ( gchar *text,
                         gchar *var,
                         GtkMessageType type,
@@ -97,6 +96,12 @@
      "(File format may change and render files incompatible with previous versions)."),
       FALSE, FALSE },
 
+    { "gtk_obsolete", N_("You are running Grisbi with GTK version %s"), 
+      N_("Warning, please be aware that the version you run is a DEVELOPMENT version. "
+     "In any case do not work with this version on your original accounting files. "
+     "(File format may change and render files incompatible with previous versions)."),
+      FALSE, FALSE },
+
 /*
     { "", N_(),
       N_(), 
@@ -281,9 +286,9 @@
                         GtkMessageType type,
                         GtkButtonsType buttons )
 {
-    GtkWidget * vbox, * checkbox, *dialog;
+    GtkWidget * vbox, * checkbox, *dialog = NULL;
     int i;
-
+printf ( "dialogue_conditional_new : %s\n", var);
     if ( !var || !strlen ( var ) )
         return NULL;
 
@@ -334,6 +339,7 @@
  */
 void dialogue_conditional_hint ( gchar *hint, gchar *text, gchar *var )
 {
+    printf ( "dialogue_conditional_hint : %s\n", var);
     dialogue_conditional ( make_hint(hint, text), var );
 }
 
@@ -350,6 +356,7 @@
  */
 void dialogue_conditional ( gchar *text, gchar *var )
 {
+    printf ( "dialogue_conditional : %s\n", var);
     dialogue_conditional_special ( text, var, GTK_MESSAGE_WARNING );
 }
 

Index: dialog.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/dialog.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- dialog.h	7 Oct 2009 21:46:21 -0000	1.33
+++ dialog.h	11 Oct 2009 16:24:34 -0000	1.34
@@ -17,6 +17,7 @@
 /* START_DECLARATION */
 void dialog_message ( gchar *label, ... );
 void dialogue ( gchar *texte_dialogue );
+void dialogue_conditional_hint ( gchar *hint, gchar *text, gchar *var );
 void dialogue_error ( gchar *text );
 void dialogue_error_brain_damage ();
 void dialogue_error_hint ( gchar *text, gchar *hint );

Index: main.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/main.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- main.c	10 Oct 2009 22:46:16 -0000	1.151
+++ main.c	11 Oct 2009 16:24:34 -0000	1.152
@@ -36,6 +36,7 @@
 #include "./menu.h"
 #include "./dialog.h"
 #include "./tip.h"
+#include "./utils.h"
 #include "./gsb_assistant_first.h"
 #include "./main_cunit.h"
 #include "./gsb_file.h"
@@ -160,6 +161,19 @@
         }
     }
 
+    /* test version of GTK */
+    if ( gtk_check_version ( VERSION_GTK_MAJOR, VERSION_GTK_MINOR, VERSION_GTK_MICRO ) )
+    {
+        string = g_strdup_printf (  _("You are running Grisbi with GTK version %s"),
+                        get_gtk_run_version ( ) );
+        dialogue_conditional_hint ( string,
+                        _("The version of GTK you are using do not benefit from its "
+                        "latest features.\n"
+                        "\n"
+                        "You should upgrade GTK."),
+                        "gtk_obsolete" );
+        g_free ( string );
+    }
 
 #ifdef HAVE_PLUGINS
     gsb_plugins_scan_dir ( PLUGINS_DIR );



More information about the cvs mailing list