[grisbi-cvs] [SCM] grisbi branch, grisbi-gtk3, updated. grisbi_gtk3_1_3_0-148-g29544a2

Pierre Biava nobody at users.sourceforge.net
Wed Feb 15 20:03:34 CET 2012


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-gtk3 has been updated
       via  29544a2eab316462b3c030f19ef1d7391ec85a1b (commit)
       via  f627f7cc7bae47bfeb9dcbfbc86697f20f8be883 (commit)
       via  151187902b8e93e650966d3aa50533bbf4b01e9e (commit)
       via  b7517bbcfb5a442edac758e9ff545657d9da96f1 (commit)
       via  dba8007136e97f71373e794c9c6866710f2b3421 (commit)
      from  cf36ba632f7f7acce6f11f8812ab55f04061b313 (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 29544a2eab316462b3c030f19ef1d7391ec85a1b
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Feb 15 19:59:17 2012 +0100

    revert bd1cd42280a12e6afe8a02032ee753676091b3c2

commit f627f7cc7bae47bfeb9dcbfbc86697f20f8be883
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Feb 15 19:55:38 2012 +0100

    fixes a crash when grisbi.ui is out

commit 151187902b8e93e650966d3aa50533bbf4b01e9e
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Feb 15 19:55:01 2012 +0100

    accueil.c: minor change

commit b7517bbcfb5a442edac758e9ff545657d9da96f1
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Feb 15 19:54:31 2012 +0100

    gsbfile.c: add load file from command line

commit dba8007136e97f71373e794c9c6866710f2b3421
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Feb 14 06:22:27 2012 +0100

    cosmetic changes

-----------------------------------------------------------------------

Changes:
diff --git a/src/accueil.c b/src/accueil.c
index f7add3a..2512811 100644
--- a/src/accueil.c
+++ b/src/accueil.c
@@ -144,9 +144,9 @@ GtkWidget *creation_onglet_accueil ( void )
 
     base_scroll = gtk_scrolled_window_new ( NULL, NULL);
     gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW ( base_scroll ),
-				     GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+                        GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
     gtk_scrolled_window_set_shadow_type ( GTK_SCROLLED_WINDOW ( base_scroll ),
-					  GTK_SHADOW_NONE );
+                        GTK_SHADOW_NONE );
 
     base = gtk_vbox_new ( FALSE, 15 );
     gtk_container_set_border_width ( GTK_CONTAINER ( base ), 12 );
@@ -205,23 +205,23 @@ GtkWidget *creation_onglet_accueil ( void )
     /* mise en place de la partie des échéances manuelles ( non affiché ) */
     /*     sera mis à jour automatiquement si nécessaire */
     paddingbox = new_paddingbox_with_title ( base, FALSE,
-					     _("Run out manual scheduled transactions") );
+                        _("Run out manual scheduled transactions") );
     frame_etat_echeances_manuelles_accueil = gtk_notebook_new ();
     gtk_notebook_set_show_tabs ( GTK_NOTEBOOK(frame_etat_echeances_manuelles_accueil),
-				 FALSE );
+                        FALSE );
     gtk_notebook_set_show_border ( GTK_NOTEBOOK(frame_etat_echeances_manuelles_accueil),
-				   FALSE );
+                        FALSE );
     gtk_container_set_border_width ( GTK_CONTAINER(frame_etat_echeances_manuelles_accueil),
-				     0 );
+                        0 );
     gtk_box_set_spacing ( GTK_BOX(paddingbox), 6 );
     gtk_box_pack_start ( GTK_BOX(paddingbox), frame_etat_echeances_manuelles_accueil,
-			 FALSE, FALSE, 6 );
+                        FALSE, FALSE, 6 );
 
 
     /* mise en place de la partie des échéances auto  ( non affiché )*/
     /*     sera mis à jour automatiquement si nécessaire */
     paddingbox = new_paddingbox_with_title ( base, FALSE,
-					     _("Automatic scheduled transactions entered") );
+                        _("Automatic scheduled transactions entered") );
     frame_etat_echeances_auto_accueil = gtk_notebook_new ();
     gtk_notebook_set_show_tabs ( GTK_NOTEBOOK(frame_etat_echeances_auto_accueil), FALSE );
     gtk_notebook_set_show_border ( GTK_NOTEBOOK(frame_etat_echeances_auto_accueil), FALSE );
@@ -232,7 +232,7 @@ GtkWidget *creation_onglet_accueil ( void )
 
     /* partie des fin d'échéances */
     paddingbox = new_paddingbox_with_title ( base, FALSE,
-					     _("Closed scheduled transactions") );
+                        _("Closed scheduled transactions") );
     main_page_finished_scheduled_transactions_part = gtk_notebook_new ();
     gtk_notebook_set_show_tabs ( GTK_NOTEBOOK(main_page_finished_scheduled_transactions_part), FALSE );
     gtk_notebook_set_show_border ( GTK_NOTEBOOK(main_page_finished_scheduled_transactions_part), FALSE );
@@ -243,7 +243,7 @@ GtkWidget *creation_onglet_accueil ( void )
 
     /* partie des soldes minimaux autorisés */
     paddingbox = new_paddingbox_with_title ( base, FALSE,
-					     _("Accounts under authorized balance") );
+                        _("Accounts under authorized balance") );
     frame_etat_soldes_minimaux_autorises = gtk_notebook_new ();
     gtk_notebook_set_show_tabs ( GTK_NOTEBOOK(frame_etat_soldes_minimaux_autorises), FALSE );
     gtk_notebook_set_show_border ( GTK_NOTEBOOK(frame_etat_soldes_minimaux_autorises), FALSE );
@@ -254,7 +254,7 @@ GtkWidget *creation_onglet_accueil ( void )
 
     /* partie des soldes minimaux voulus */
     paddingbox = new_paddingbox_with_title ( base, FALSE,
-					     _("Accounts under desired balance") );
+                        _("Accounts under desired balance") );
     frame_etat_soldes_minimaux_voulus = gtk_notebook_new ();
     gtk_notebook_set_show_tabs ( GTK_NOTEBOOK(frame_etat_soldes_minimaux_voulus), FALSE );
     gtk_notebook_set_show_border ( GTK_NOTEBOOK(frame_etat_soldes_minimaux_voulus), FALSE );
diff --git a/src/grisbi_app.c b/src/grisbi_app.c
index a47c71e..e26601e 100644
--- a/src/grisbi_app.c
+++ b/src/grisbi_app.c
@@ -156,6 +156,12 @@ static void grisbi_app_init ( GrisbiApp *app )
     /* importation des formats de fichiers */
     grisbi_app_load_import_formats ( app );
 
+    /* initialisation des couleurs par défaut */
+    gsb_color_initialise_couleurs_par_defaut ( );
+
+    /* à reprendre autrement */
+    init_variables ();
+
     /* return */
 }
 
@@ -212,7 +218,9 @@ GrisbiWindow *grisbi_app_get_active_window ( GrisbiApp *app )
     if ( !GRISBI_IS_APP ( tmp_app ) )
         return NULL;
 
-    if ( !GTK_WIDGET_REALIZED ( GTK_WIDGET ( tmp_app->priv->active_window ) ) )
+    if ( tmp_app->priv->active_window != 0
+     &&
+     !GTK_WIDGET_REALIZED ( GTK_WIDGET ( tmp_app->priv->active_window ) ) )
         gtk_widget_realize ( GTK_WIDGET ( tmp_app->priv->active_window ) );
 
     return tmp_app->priv->active_window;
@@ -439,15 +447,8 @@ static void grisbi_app_load_config_var ( GrisbiApp *app )
     /* initialisation de la variable conf */
     app->priv->conf = g_malloc0 ( sizeof ( GrisbiAppConf ) );
 
-    /* initialisation des couleurs par défaut */
-    gsb_color_initialise_couleurs_par_defaut ( );
-
     /* chargement des paramètres communs */
     app->priv->first_use = !gsb_file_config_load_config ( app->priv->conf );
-
-    /* à reprendre autrement */
-    init_variables ();
-
 }
 
  
diff --git a/src/grisbi_window.c b/src/grisbi_window.c
index 25ad706..6cf25a4 100644
--- a/src/grisbi_window.c
+++ b/src/grisbi_window.c
@@ -28,6 +28,7 @@
 
 #include <string.h>
 #include <unistd.h>
+#include <stdlib.h>
 
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
@@ -189,9 +190,9 @@ static void grisbi_window_init ( GrisbiWindow *window )
     window->priv = GRISBI_WINDOW_GET_PRIVATE ( window );
 
     if ( !grisbi_window_initialise_builder ( ) )
-        return;
+        exit ( 1 );
 
-    /* Création de la fenêtre de dialogue pour le graph */
+    /* Création de la fenêtre principale de Grisbi */
     main_box = GTK_WIDGET ( gtk_builder_get_object ( grisbi_window_builder, "main_vbox" ) );
 
     window->priv->main_box = main_box;
diff --git a/src/gsb_file.c b/src/gsb_file.c
index ee2b457..4f00c3b 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -1264,6 +1264,58 @@ gboolean gsb_file_get_modified ( void )
 }
 
 
+/**
+ * essaie de trouver le fichier dans le répertoire home de l'utilisateur
+ * si le nom passé en option n'est pas un nom de fichier correct.
+ *
+ * \param liste de noms WARNING : seul le premier nom est utilisé
+ *
+ * \return TRUE if OK else FALSE
+ **/
+gboolean gsb_file_open_from_commandline ( GSList *file_list )
+{
+    gchar *filename;
+    gchar *tmp_str_1;
+    gchar *tmp_str_2;
+
+    filename = (gchar *) file_list->data;
+
+    if ( g_file_test ( filename, G_FILE_TEST_EXISTS ) )
+    {
+        gsb_file_open_file ( filename );
+
+        return TRUE;
+    }
+    else
+    {
+        gchar *tmp_name = NULL;
+
+        tmp_name = g_build_filename ( gsb_dirs_get_home_dir (), filename, NULL );
+        printf ("tmp_name = %s\n", tmp_name );
+
+        if ( g_file_test ( tmp_name, G_FILE_TEST_EXISTS ) )
+        {
+            gsb_file_open_file ( tmp_name );
+            g_free ( tmp_name );
+
+            return TRUE;
+        }
+    }
+
+    tmp_str_1 = g_strdup_printf ( _("Cannot open file '%s': %s"),
+                    filename,
+                    _("File does not exist") );
+
+    tmp_str_2 = g_strdup_printf ( _("Error loading file '%s'"), filename );
+
+    dialogue_error_hint ( tmp_str_1, tmp_str_2 );
+
+    g_free ( tmp_str_1 );
+    g_free ( tmp_str_2 );
+
+    return FALSE;
+}
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/gsb_file.h b/src/gsb_file.h
index 21d6153..9a99fa3 100644
--- a/src/gsb_file.h
+++ b/src/gsb_file.h
@@ -21,6 +21,7 @@ void gsb_file_new_gui ( void );
 gboolean gsb_file_open_direct_menu ( GtkMenuItem *item,
                         gint *file_number_ptr );
 gboolean gsb_file_open_file ( gchar *filename );
+gboolean gsb_file_open_from_commandline ( GSList *file_list );
 gboolean gsb_file_open_menu ( void );
 void gsb_file_remove_name_from_opened_list ( gchar *filename );
 gboolean gsb_file_save ( void );
diff --git a/src/main.c b/src/main.c
index 2a1bc38..773ba82 100644
--- a/src/main.c
+++ b/src/main.c
@@ -66,7 +66,7 @@ static gboolean gsb_main_change_state_window ( GtkWidget *window,
                         gpointer null );
 static void gsb_main_grisbi_shutdown ( GrisbiCommandLine *command_line );
 static gboolean gsb_main_init_app ( void );
-static void gsb_main_load_file_if_necessary ( gchar *filename );
+static void gsb_main_load_file_if_necessary ( GrisbiCommandLine *command_line );
 static gboolean gsb_main_print_environment_var ( void );
 static gint gsb_main_set_debug_level ( GrisbiCommandLine *command_line );
 static void gsb_main_trappe_signal_sigsegv ( void );
@@ -159,7 +159,7 @@ gint main ( int argc, char **argv )
         dialog_message ( "development-version", VERSION );
 
     /* check the command line, if there is something to open */
-/*     gsb_main_load_file_if_necessary ( file );  */
+    gsb_main_load_file_if_necessary ( command_line );
 
     if ( grisbi_app_get_first_use ( app ) )
         gsb_assistant_first_run ();
@@ -242,16 +242,19 @@ void gsb_main_trappe_signal_sigsegv ( void )
  *
  *
  * */
-void gsb_main_load_file_if_necessary ( gchar *filename )
+void gsb_main_load_file_if_necessary ( GrisbiCommandLine *command_line )
 {
     GrisbiAppConf *conf;
+    GSList *file_liste;
 
     conf = grisbi_app_get_conf ( );
 
     /* check the command line, if there is something to open */
-    if ( filename )
+    file_liste = grisbi_command_line_get_file_list ( command_line );
+
+    if ( file_liste )
     {
-        gsb_file_open_file ( filename );
+        gsb_file_open_from_commandline ( file_liste );
     }
     else
     {
diff --git a/src/parse_cmdline.c b/src/parse_cmdline.c
index 38f35b5..51e9e63 100644
--- a/src/parse_cmdline.c
+++ b/src/parse_cmdline.c
@@ -138,6 +138,7 @@ static gchar *grisbi_command_line_make_conf_filename ( gchar *config_file )
             }
         }
     }
+
     return NULL;
 }
 
@@ -153,11 +154,11 @@ static void grisbi_command_line_init_file_list ( GrisbiCommandLine *command_line
 
     for (i = 0; command_line->priv->files_args[i]; i++)
     {
-        GFile *file;
+        gchar *filename;
 
-        file = g_file_new_for_commandline_arg ( command_line->priv->files_args[i] );
+        filename = g_strdup ( command_line->priv->files_args[i] );
 
-        command_line->priv->file_list = g_slist_prepend ( command_line->priv->file_list, file );
+        command_line->priv->file_list = g_slist_prepend ( command_line->priv->file_list, filename );
     }
 
     command_line->priv->file_list = g_slist_reverse ( command_line->priv->file_list );
diff --git a/src/ui/wdg_paddingbox_with_title.ui b/src/ui/wdg_paddingbox_with_title.ui
index 5cc657b..e7a83ed 100644
--- a/src/ui/wdg_paddingbox_with_title.ui
+++ b/src/ui/wdg_paddingbox_with_title.ui
@@ -1,10 +1,41 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="2.24"/>
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkHBox" id="hbox">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkLabel" id="label1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label">    </property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="paddingbox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="spacing">6</property>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
   <object class="GtkVBox" id="vbox">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="border_width">12</property>
     <property name="spacing">6</property>
     <child>
       <object class="GtkLabel" id="label">
@@ -12,7 +43,6 @@
         <property name="can_focus">False</property>
         <property name="xalign">0</property>
         <property name="yalign">1</property>
-        <property name="label"></property>
         <attributes>
           <attribute name="weight" value="bold"/>
         </attributes>
@@ -27,36 +57,4 @@
       <placeholder/>
     </child>
   </object>
-  <object class="GtkHBox" id="hbox">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <child>
-	  <!-- Some padding.  ugly but the HiG advises it this way ;-) -->
-          <object class="GtkLabel" id="label1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="no">    </property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVBox" id="paddingbox">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">6</property>
-            <child>
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-      </object>
 </interface>
diff --git a/src/utils.c b/src/utils.c
index 1a24032..942a3cc 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -39,7 +39,6 @@
 #include "gsb_dirs.h"
 #include "gsb_file_config.h"
 #include "structures.h"
-#include "utils_gtkbuilder.h"
 #include "erreur.h"
 /*END_INCLUDE*/
 
@@ -299,58 +298,49 @@ gboolean lance_navigateur_web ( const gchar *uri )
  */
 GtkWidget *new_paddingbox_with_title (GtkWidget *parent, gboolean fill, const gchar *title)
 {
-    GtkWidget *vbox = NULL, *hbox = NULL, *paddingbox = NULL, *label = NULL;
-    static GtkBuilder *widget_builder = NULL;
+    GtkWidget *vbox, *hbox, *paddingbox, *label;
+	gchar* tmp_str;
 
-
-    /* New GtkBuilder Creation*/
-    widget_builder = gtk_builder_new ( );
-
-    if ( widget_builder == NULL )
-        return NULL;
-
-    /* widget paddingbox XML loading */
-    if ( !utils_gtkbuilder_merge_ui_data_in_builder ( widget_builder, "wdg_paddingbox_with_title.ui" ) )
-        return NULL;
-
-    /* Get the needed widgets*/
-    vbox = GTK_WIDGET ( gtk_builder_get_object ( widget_builder, "vbox" ) );
-    paddingbox = GTK_WIDGET ( gtk_builder_get_object ( widget_builder, "paddingbox" ));
-    label = GTK_WIDGET ( gtk_builder_get_object ( widget_builder, "label" ) );
-    hbox = GTK_WIDGET ( gtk_builder_get_object (widget_builder, "hbox"));
-
-    /*Check Validity of Parent for robustness case*/
-    if (parent != NULL && GTK_IS_BOX(parent) )
+    vbox = gtk_vbox_new ( FALSE, 6 );
+    if ( GTK_IS_BOX(parent) )
     {
-        if (vbox != NULL)
-        {
-            gtk_box_pack_start ( GTK_BOX ( parent ), vbox,
-                    fill, fill, 0);
-        }
-        else
-        {
-            /*Nothing to do
-             * Cosmetic error : Minor
-             */
-
-        }
+	gtk_box_pack_start ( GTK_BOX ( parent ), vbox,
+			     fill, fill, 0);
     }
 
-    if (label != NULL)
-    {
-        gtk_label_set_label ( GTK_LABEL ( label ),title );
-    }
-    else
-    {
-        return NULL; /* TODO Manage error */
-    }
+    /* Creating label */
+    label = gtk_label_new ( NULL );
+    gtk_misc_set_alignment ( GTK_MISC ( label ), 0, 1 );
+    tmp_str = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>", title );
+    gtk_label_set_markup ( GTK_LABEL ( label ), tmp_str );
+    g_free(tmp_str);
+    gtk_box_pack_start ( GTK_BOX ( vbox ), label,
+			 FALSE, FALSE, 0);
+    gtk_widget_show ( label );
 
+    /* Creating horizontal box */
+    hbox = gtk_hbox_new ( FALSE, 0 );
     gtk_box_pack_start ( GTK_BOX ( vbox ), hbox,
-            fill, fill, 0);
+			 fill, fill, 0);
+
+    /* Some padding.  ugly but the HiG advises it this way ;-) */
+    label = gtk_label_new ( "    " );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), label,
+			 FALSE, FALSE, 0 );
+
+    /* Then make the vbox itself */
+    paddingbox = gtk_vbox_new ( FALSE, 6 );
+    gtk_box_pack_start ( GTK_BOX ( hbox ), paddingbox,
+			 TRUE, TRUE, 0);
+
+    /* Put a label at the end to feed a new line */
+    /*   label = gtk_label_new ( "    " ); */
+    /*   gtk_box_pack_end ( GTK_BOX ( paddingbox ), label, */
+    /* 		     FALSE, FALSE, 0 ); */
 
-    if ( parent != NULL && GTK_IS_BOX(parent) )
+    if ( GTK_IS_BOX(parent) )
     {
-        gtk_box_set_spacing ( GTK_BOX(parent), 18 );
+	gtk_box_set_spacing ( GTK_BOX(parent), 18 );
     }
 
     return paddingbox;


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list