[grisbi-cvs] grisbi/src gsb_form.c, 1.137, 1.138 gsb_form_widget.c, 1.39, 1.40

Pierre Biava pbiava at users.sourceforge.net
Sun Dec 13 18:23:47 CET 2009


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

Modified Files:
	gsb_form.c gsb_form_widget.c 
Log Message:
fixed bug 785 Warning : EXPERIMENTAL

Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- gsb_form.c	28 Nov 2009 12:56:18 -0000	1.137
+++ gsb_form.c	13 Dec 2009 17:23:44 -0000	1.138
@@ -2017,7 +2017,8 @@
     gint element_number;
     gint account_number;
     gint element_suivant;
-
+    GtkWidget *widget_prov;
+    
     element_number = GPOINTER_TO_INT (ptr_origin);
     account_number = gsb_form_get_account_number ();
 
@@ -2031,6 +2032,38 @@
 
     switch ( ev -> keyval )
     {
+    case GDK_1:
+    case GDK_2:
+    case GDK_3:
+    case GDK_4:
+    case GDK_5:
+    case GDK_6:
+    case GDK_7:
+    case GDK_8:
+    case GDK_9:
+    case GDK_0:
+        switch ( element_number )
+        {
+        case TRANSACTION_FORM_DEBIT:
+            widget_prov = gsb_form_widget_get_widget ( TRANSACTION_FORM_CREDIT );
+            if ( !gsb_form_widget_check_empty ( widget_prov ) )
+            {
+                gtk_entry_set_text ( GTK_ENTRY ( widget_prov ),
+                         gsb_form_widget_get_name ( TRANSACTION_FORM_CREDIT ) );
+                gsb_form_widget_set_empty ( widget_prov, TRUE );
+            }
+            break;
+        case TRANSACTION_FORM_CREDIT:
+            widget_prov = gsb_form_widget_get_widget ( TRANSACTION_FORM_DEBIT );
+            if ( !gsb_form_widget_check_empty ( widget_prov ) )
+            {
+                gtk_entry_set_text ( GTK_ENTRY (widget_prov),
+                            gsb_form_widget_get_name (TRANSACTION_FORM_DEBIT));
+                gsb_form_widget_set_empty ( widget_prov, TRUE );
+            }
+            break;
+        }
+        break;
 	case GDK_Escape :
 	    gsb_form_escape_form ();
 	    break;
@@ -2058,7 +2091,7 @@
 
         if ( element_number == TRANSACTION_FORM_VALUE_DATE )
         {
-            GtkWidget * widget_prov = gsb_form_widget_get_widget (
+            widget_prov = gsb_form_widget_get_widget (
                         TRANSACTION_FORM_VALUE_DATE);
 
             if (strlen (gtk_entry_get_text (GTK_ENTRY (widget_prov))) == 0 )
@@ -2081,7 +2114,7 @@
         /* si élément = date de valeur fix the bug 578 */
         if ( element_number == TRANSACTION_FORM_VALUE_DATE )
         {
-            GtkWidget * widget_prov = gsb_form_widget_get_widget (
+            widget_prov = gsb_form_widget_get_widget (
                         TRANSACTION_FORM_VALUE_DATE);
 
             if (strlen (gtk_entry_get_text ( GTK_ENTRY ( widget_prov ) ) ) == 0 )
@@ -2155,6 +2188,7 @@
 	    }
 	    break;
     }
+
     return FALSE;
 }
 

Index: gsb_form_widget.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_widget.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- gsb_form_widget.c	22 Nov 2009 18:45:52 -0000	1.39
+++ gsb_form_widget.c	13 Dec 2009 17:23:45 -0000	1.40
@@ -782,11 +782,10 @@
         widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_CREDIT );
         if ( !gsb_form_widget_check_empty ( widget ) )
         {
-            old_credit = g_strdup ( gtk_entry_get_text ( GTK_ENTRY (
-                        gsb_form_widget_get_widget ( TRANSACTION_FORM_CREDIT ) ) ) );
-            gtk_entry_set_text ( GTK_ENTRY ( widget ),
-                     gsb_form_widget_get_name ( TRANSACTION_FORM_CREDIT ) );
-            gsb_form_widget_set_empty ( widget, TRUE );
+            old_credit = g_strdup ( gtk_entry_get_text ( GTK_ENTRY ( widget ) ) );
+            //~ gtk_entry_set_text ( GTK_ENTRY ( widget ),
+                     //~ gsb_form_widget_get_name ( TRANSACTION_FORM_CREDIT ) );
+            //~ gsb_form_widget_set_empty ( widget, TRUE );
         }
 
         widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_TYPE);
@@ -828,11 +827,10 @@
         widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_DEBIT );
         if ( !gsb_form_widget_check_empty ( widget ) )
         {
-            old_debit = g_strdup ( gtk_entry_get_text ( GTK_ENTRY (
-                        gsb_form_widget_get_widget ( TRANSACTION_FORM_DEBIT ) ) ) );
-            gtk_entry_set_text ( GTK_ENTRY (widget),
-                        gsb_form_widget_get_name (TRANSACTION_FORM_DEBIT));
-            gsb_form_widget_set_empty ( widget, TRUE );
+            old_debit = g_strdup ( gtk_entry_get_text ( GTK_ENTRY ( widget ) ) );
+            //~ gtk_entry_set_text ( GTK_ENTRY (widget),
+                        //~ gsb_form_widget_get_name (TRANSACTION_FORM_DEBIT));
+            //~ gsb_form_widget_set_empty ( widget, TRUE );
         }
         widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_TYPE);
 



More information about the cvs mailing list