[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_5-86-g725cbc1

Pierre Biava nobody at users.sourceforge.net
Wed Apr 25 23:23:56 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  725cbc1282e8b11a83f6e98eafdd26548f0a3738 (commit)
      from  14d7dc384698309f7442d722ea82ac3e77c3f273 (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 725cbc1282e8b11a83f6e98eafdd26548f0a3738
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Apr 25 23:21:05 2012 +0200

    displays a warning message if the transaction date does not exist

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

Changes:
diff --git a/src/gsb_form.c b/src/gsb_form.c
index a3f62f7..b355bef 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -2787,7 +2787,7 @@ gboolean gsb_form_validate_form_transaction ( gint transaction_number,
     if ( !gsb_date_check_entry ( date_widget ) )
     {
         tmpstr = g_strdup_printf ( _("Invalid date %s"),
-					   gtk_entry_get_text ( GTK_ENTRY ( date_widget ) ) );
+                        gtk_entry_get_text ( GTK_ENTRY ( date_widget ) ) );
         dialogue_error ( tmpstr );
         g_free( tmpstr );
         gtk_editable_select_region ( GTK_EDITABLE ( date_widget ), 0, -1 );
@@ -2805,7 +2805,11 @@ gboolean gsb_form_validate_form_transaction ( gint transaction_number,
     /* work with value date */
     widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_VALUE_DATE );
 
-    if ( widget && ! gsb_form_widget_check_empty ( widget ) )
+    if ( widget
+     &&
+     !gsb_form_widget_check_empty ( widget )
+     &&
+     strlen ( gtk_entry_get_text ( GTK_ENTRY ( widget ) ) ) > 0 )
     {
         if ( !gsb_date_check_entry ( widget ) )
         {
diff --git a/src/utils_dates.c b/src/utils_dates.c
index 5dc3d60..ada0e0c 100644
--- a/src/utils_dates.c
+++ b/src/utils_dates.c
@@ -285,29 +285,26 @@ gboolean gsb_date_check_and_complete_entry ( GtkWidget *entry,
 gboolean gsb_date_check_entry ( GtkWidget *entry )
 {
     const gchar *string;
+    GDate *date;
 
-    if (!entry)
-    return FALSE;
+    if ( !entry )
+        return FALSE;
     
-    string = gtk_entry_get_text ( GTK_ENTRY (entry));
-    if (!string)
-    return FALSE;
+    string = gtk_entry_get_text ( GTK_ENTRY ( entry ) );
+    if ( !string || strlen ( string ) == 0 )
+        return FALSE;
 
-    if ( strlen (string))
+    date = gsb_date_get_last_entry_date ( string );
+    if ( !date )
+        return FALSE;
+    else
     {
-        GDate *date;
-
-        date = gsb_date_get_last_entry_date ( string );
-        if (!date)
-            return FALSE;
-        else
-        {
-            if ( buffer_entry_date == NULL )
-                buffer_entry_date = g_malloc0 ( sizeof (struct struct_last_entry_date) );
-            buffer_entry_date -> date_string = g_strdup ( string );
-            buffer_entry_date -> last_entry_date = date;
-        }
+        if ( buffer_entry_date == NULL )
+            buffer_entry_date = g_malloc0 ( sizeof ( struct struct_last_entry_date ) );
+        buffer_entry_date -> date_string = g_strdup ( string );
+        buffer_entry_date -> last_entry_date = date;
     }
+
     return ( TRUE );
 }
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list