[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_5-143-g51ad2d7

Pierre Biava nobody at users.sourceforge.net
Sun Sep 30 11:07:37 CEST 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, master has been updated
       via  51ad2d73628b349f2145c3beadbd478067f9a372 (commit)
       via  b987c59a21a7a566cd88adc2740d6c495f861ac4 (commit)
      from  599aa554e26981a2d443cb2b0fcd456e3d63b02b (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 51ad2d73628b349f2145c3beadbd478067f9a372
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Sep 30 11:02:03 2012 +0200

    fixing a minor bug: add name of new account file in the list of files

commit b987c59a21a7a566cd88adc2740d6c495f861ac4
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Sep 30 10:46:53 2012 +0200

    Adding date format: dd.mm.yyyy

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

Changes:
diff --git a/src/gsb_file.c b/src/gsb_file.c
index a7ff1da..12a8068 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -145,6 +145,9 @@ gboolean gsb_file_new_finish ( void )
         return FALSE;
     }
 
+    /* the the name in the last opened files */
+    gsb_file_append_name_to_opened_list ( nom_fichier_comptes );
+
     /* init the gui */
     gsb_file_new_gui ();
 
diff --git a/src/parametres.c b/src/parametres.c
index 77734fb..254e24c 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -1312,10 +1312,10 @@ GtkWidget *onglet_localisation ( void )
 GtkWidget *gsb_config_date_format_chosen ( GtkWidget *parent, gint sens )
 {
     GtkWidget *hbox, *paddingbox;
-    GtkWidget *button_1, *button_2;
+    GtkWidget *button_1, *button_2, *button_3;
     gchar *format_date;
 
-    button_1 =gtk_radio_button_new_with_label ( NULL, "dd/mm/yyyy" );
+    button_1 = gtk_radio_button_new_with_label ( NULL, "dd/mm/yyyy" );
     format_date = g_strdup ( "%d/%m/%Y" );
     g_object_set_data_full ( G_OBJECT ( button_1 ),
                         "pointer",
@@ -1331,11 +1331,21 @@ GtkWidget *gsb_config_date_format_chosen ( GtkWidget *parent, gint sens )
                         format_date,
                         g_free );
 
+    button_3 = gtk_radio_button_new_with_label ( gtk_radio_button_get_group (
+                        GTK_RADIO_BUTTON ( button_1 ) ),
+                        "dd.mm.yyyy" );
+    format_date = g_strdup ( "%d.%m.%Y" );
+    g_object_set_data_full ( G_OBJECT ( button_3 ),
+                        "pointer",
+                        format_date,
+                        g_free );
+
     if ( sens == GTK_ORIENTATION_VERTICAL )
     {
         paddingbox = new_paddingbox_with_title ( parent, FALSE, _("Choose the date format") );
         gtk_box_pack_start ( GTK_BOX ( paddingbox ), button_1, FALSE, FALSE, 0 );
         gtk_box_pack_start ( GTK_BOX ( paddingbox ), button_2, FALSE, FALSE, 0 );
+        gtk_box_pack_start ( GTK_BOX ( paddingbox ), button_3, FALSE, FALSE, 0 );
     }
     else
     {
@@ -1344,12 +1354,19 @@ GtkWidget *gsb_config_date_format_chosen ( GtkWidget *parent, gint sens )
         gtk_box_pack_start ( GTK_BOX ( paddingbox ), hbox, FALSE, FALSE, 0 );
         gtk_box_pack_start ( GTK_BOX ( hbox ), button_1, FALSE, FALSE, 0 );
         gtk_box_pack_start ( GTK_BOX ( hbox ), button_2, FALSE, FALSE, 0 );
+        gtk_box_pack_start ( GTK_BOX ( hbox ), button_3, FALSE, FALSE, 0 );
     }
 
     format_date = gsb_date_get_format_date ( );
-    if ( format_date && strcmp ( format_date, "%m/%d/%Y" ) == 0 )
-        gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button_2 ), TRUE );
-    g_free ( format_date );
+    if ( format_date )
+    {
+        if ( strcmp ( format_date, "%m/%d/%Y" ) == 0 )
+            gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button_2 ), TRUE );
+        else if ( strcmp ( format_date, "%d.%m.%Y" ) == 0 )
+            gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button_3 ), TRUE );
+
+        g_free ( format_date );
+    }
 
     g_signal_connect ( G_OBJECT ( button_1 ),
                         "button-release-event",
@@ -1360,6 +1377,10 @@ GtkWidget *gsb_config_date_format_chosen ( GtkWidget *parent, gint sens )
                         G_CALLBACK ( gsb_localisation_format_date_toggle ),
                         GINT_TO_POINTER ( sens ) );
 
+    g_signal_connect ( G_OBJECT ( button_3 ),
+                        "button-release-event",
+                        G_CALLBACK ( gsb_localisation_format_date_toggle ),
+                        GINT_TO_POINTER ( sens ) );
     return paddingbox;
 }
 
diff --git a/src/utils_dates.c b/src/utils_dates.c
index ada0e0c..746092a 100644
--- a/src/utils_dates.c
+++ b/src/utils_dates.c
@@ -331,7 +331,10 @@ GDate *gsb_parse_date_string ( const gchar *date_string )
         return NULL;
 
     /* récupère le format des champs date */
-    date_tokens = g_strsplit ( format + 1, "/%", 3 );
+    if (  g_strrstr_len ( format, 4, "/%" ) )
+        date_tokens = g_strsplit ( format + 1, "/%", 3 );
+    if (  g_strrstr_len ( format, 4, ".%" ) )
+        date_tokens = g_strsplit ( format + 1, ".%", 3 );
 
     /* get the regex from the store */
     date_regex = gsb_regex_lookup ( DATE_STRING_KEY );
@@ -496,12 +499,13 @@ gchar *gsb_format_date ( gint day, gint month, gint year )
 gchar *gsb_format_gdate ( const GDate *date )
 {
     gchar retour_str[SIZEOF_FORMATTED_STRING_DATE];
-    guint longueur;
+    guint longueur = 0;
 
     if ( !date || !g_date_valid ( date ) )
         return my_strdup ( "" );
 
-    longueur = g_date_strftime ( retour_str, SIZEOF_FORMATTED_STRING_DATE, format, date );
+    if ( format )
+        longueur = g_date_strftime ( retour_str, SIZEOF_FORMATTED_STRING_DATE, format, date );
 
     if ( longueur == 0 )
         return my_strdup ( "" );
@@ -627,10 +631,14 @@ void gsb_date_set_format_date ( const gchar *format_date )
     g_free ( format );
     format = NULL;
 
-    if ( format_date && 
-            ( strcmp ( format_date, "%d/%m/%Y" ) == 0
-           || strcmp ( format_date, "%m/%d/%Y" ) == 0 ) )
+    if ( format_date
+     &&
+        ( strcmp ( format_date, "%d/%m/%Y" ) == 0
+         || strcmp ( format_date, "%m/%d/%Y" ) == 0
+         || strcmp ( format_date, "%d.%m.%Y" ) == 0 ) )
+    {
         format = g_strdup ( format_date );
+    }
 
     g_free ( last_date );
     last_date = NULL;


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list