[grisbi-cvs] grisbi/src categories_onglet.c, 1.201, 1.202 gsb_currency.c, 1.49, 1.50 gsb_data_budget.c, 1.53, 1.54 gsb_form.c, 1.135, 1.136 gsb_form_widget.c, 1.38, 1.39 gtk_combofix.c, 1.64, 1.65 gtk_combofix.h, 1.6, 1.7 imputation_budgetaire.c, 1.162, 1.163 tiers_onglet.c, 1.169, 1.170 traitement_variables.c, 1.182, 1.183

Pierre Biava pbiava at users.sourceforge.net
Sun Nov 22 19:45:55 CET 2009


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

Modified Files:
	categories_onglet.c gsb_currency.c gsb_data_budget.c 
	gsb_form.c gsb_form_widget.c gtk_combofix.c gtk_combofix.h 
	imputation_budgetaire.c tiers_onglet.c traitement_variables.c 
Log Message:
bug fix 675 and minor changes

Index: gsb_data_budget.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_budget.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- gsb_data_budget.c	23 Sep 2009 20:28:20 -0000	1.53
+++ gsb_data_budget.c	22 Nov 2009 18:45:52 -0000	1.54
@@ -930,7 +930,6 @@
     return_list = NULL;
 
     /* fill debit_list and/or credit_list and them sub-budgets */
-
     tmp_list = budget_list;
 
     while ( tmp_list )

Index: gtk_combofix.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gtk_combofix.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- gtk_combofix.c	22 Nov 2009 08:32:00 -0000	1.64
+++ gtk_combofix.c	22 Nov 2009 18:45:52 -0000	1.65
@@ -84,7 +84,8 @@
 static gboolean gtk_combofix_popup_key_press_event ( GtkWidget *popup,
 						     GdkEventKey *ev,
 						     GtkComboFix *combofix );
-static void gtk_combofix_print_visibles_rows ( GtkComboFix *combofix );
+
+
 
 /* globals variables */
 static gint block_expose_event;
@@ -221,7 +222,11 @@
     if ( text && strlen ( text ) > 0 )
         gtk_entry_set_text ( GTK_ENTRY ( combofix -> entry ), text );
     else
-        gtk_entry_set_text ( GTK_ENTRY ( combofix -> entry ), "" );
+    {
+        gsb_form_widget_set_empty ( GTK_WIDGET ( combofix -> entry ), TRUE );
+        gtk_entry_set_text ( GTK_ENTRY ( combofix -> entry ),
+					    _("Categories : Sub-categories") );
+    }
     g_signal_handlers_unblock_by_func ( G_OBJECT (combofix -> entry),
 					G_CALLBACK (gtk_combofix_entry_insert),
 					combofix );
@@ -554,26 +559,31 @@
 				  GTK_TREE_VIEW_COLUMN_FIXED );
 
 /* set the sorting model in the tree view */
-combofix -> tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (combofix -> model_sort));
-gtk_tree_selection_set_mode ( GTK_TREE_SELECTION ( gtk_tree_view_get_selection ( GTK_TREE_VIEW(combofix -> tree_view))),
-			      GTK_SELECTION_SINGLE );
+combofix -> tree_view = gtk_tree_view_new_with_model (
+                        GTK_TREE_MODEL (combofix -> model_sort ) );
+
+gtk_tree_selection_set_mode ( GTK_TREE_SELECTION (
+                        gtk_tree_view_get_selection (
+                        GTK_TREE_VIEW(combofix -> tree_view))),
+			            GTK_SELECTION_SINGLE );
 gtk_tree_view_set_hover_selection ( GTK_TREE_VIEW (combofix -> tree_view),
-				    TRUE );
+				        TRUE );
 gtk_tree_view_set_headers_visible ( GTK_TREE_VIEW (combofix -> tree_view),
-				    FALSE );
+				        FALSE );
 gtk_tree_view_append_column ( GTK_TREE_VIEW (combofix -> tree_view),
-			      tree_view_column );
+			            tree_view_column );
 gtk_tree_view_set_fixed_height_mode ( GTK_TREE_VIEW(combofix -> tree_view),
-				      TRUE );
+				        TRUE );
 gtk_tree_view_set_row_separator_func ( GTK_TREE_VIEW(combofix -> tree_view),
 				       (GtkTreeViewRowSeparatorFunc) gtk_combofix_separator_func,
 				       combofix, NULL );
+
 g_signal_connect ( G_OBJECT (combofix -> tree_view),
-		   "button-press-event",
-		   G_CALLBACK (gtk_combofix_button_press_event),
-		   combofix );
-gtk_container_add ( GTK_CONTAINER (scrolled_window),
-		    combofix -> tree_view);
+		                "button-press-event",
+		                G_CALLBACK (gtk_combofix_button_press_event),
+		                combofix );
+gtk_container_add ( GTK_CONTAINER (scrolled_window), combofix -> tree_view);
+
 gtk_widget_show (combofix -> tree_view);
 }
 
@@ -714,7 +724,7 @@
     const gchar *entry_string;
 
     entry_string = gtk_entry_get_text ( GTK_ENTRY ( combofix -> entry ) );
-    //~ printf ("etape 0 entry_string = %s\n", entry_string );
+
     if ( combofix -> force && !strlen ( entry_string ) )
         gtk_combofix_show_popup ( combofix);
 
@@ -735,7 +745,7 @@
 	    gchar *new_string = NULL;
 
         new_string = my_strdup ( entry_string );
-        //~ printf ("etape 1 entry_string = %s\n", entry_string );
+
         if ( strlen ( entry_string) )
             dialogue_warning_hint ( _("You cannot create new payee or category "
                             "and subcategory without changing the options "
@@ -765,8 +775,8 @@
              * be set, so show all the list and erase the entry */
             gtk_combofix_set_text ( combofix, "" );
             gtk_combofix_set_all_visible_rows (combofix);
+	    return FALSE;
         }
-        return FALSE;
     }
 
     if ( insert_text
@@ -786,19 +796,15 @@
     }
 
     /* show the popup */
-    if (combofix -> visible_items
-	&&
-	(!combofix -> max_items
-	 ||
-	 combofix -> visible_items < combofix -> max_items))
+    if ( combofix -> visible_items )
+    /* bug : n'affiche plus les éléments visibles de la liste */
+	//~ &&
+	//~ (!combofix -> max_items
+	 //~ ||
+	 //~ combofix -> visible_items < combofix -> max_items))
     {
-        //~ printf ("show the popup completed_string = %s\n", completed_string );
-        gtk_combofix_print_visibles_rows ( combofix );
-
-        //~ gtk_combofix_set_all_visible_rows ( combofix );
         gtk_combofix_set_popup_position ( combofix );
         gtk_widget_show ( combofix -> popup );
-        gtk_widget_grab_focus ( GTK_WIDGET ( combofix -> entry ));
         gtk_window_set_modal (GTK_WINDOW (combofix -> popup), TRUE);
     }
     else
@@ -851,7 +857,7 @@
     gint path_ok;
     gint length;
     gboolean text_written = FALSE;
-    gint separator;
+    gboolean separator = FALSE;
 
     devel_debug ( string);
     if (!combofix
@@ -871,7 +877,7 @@
     while (path_ok)
     {
         gchar *model_string;
-        gint show_row;
+        gint show_row = 0;
         gint model_string_length;
 
         gtk_tree_model_get ( model,
@@ -879,19 +885,9 @@
                      COMBOFIX_COL_REAL_STRING, &model_string,
                      COMBOFIX_COL_SEPARATOR, &separator,
                      -1 );
-        //~ printf ("model_string = %s\n", model_string );
-        /* this avoid to have 2 separators following,
-         * or a separator at the begining */
+        /* The separators are never showed */
         if (separator)
-        {
-            if (text_written)
-            {
-                show_row = 1;
-                text_written = FALSE;
-            }
-            else
-                show_row = 0;
-        }
+            show_row = 0;
         else
         {
             model_string_length = strlen (model_string);
@@ -909,7 +905,6 @@
 
             if (show_row)
             {
-                //~ printf ("show_row model_string = %s complete_string = %s\n", model_string, complete_string );
                 /* if the current checked string is exactly the same as the wanted string,
                  * we keep it for completion, else we keep only the first approximation */
                 if ( model_string_length == length )
@@ -926,7 +921,6 @@
                 text_written = TRUE;
             }
         }
-        //~ printf ("show_row = %d complete_string = %s\n", show_row, complete_string );
         gtk_tree_store_set ( GTK_TREE_STORE (model),
                      &iter,
                      COMBOFIX_COL_VISIBLE, show_row,
@@ -1054,7 +1048,7 @@
     gint height;
     GdkRectangle rectangle;
     gint horizontal_separator;
-devel_debug (NULL);
+
     if (!combofix)
 	return FALSE;
 
@@ -1203,10 +1197,9 @@
  * */
 static gboolean gtk_combofix_show_popup ( GtkComboFix *combofix )
 {
-    devel_debug (NULL);
     if ( GTK_WIDGET_VISIBLE (combofix -> popup))
 	return FALSE;
-devel_debug (NULL);
+
     gtk_combofix_set_all_visible_rows (combofix);
     gtk_combofix_set_popup_position (combofix);
     gtk_widget_show ( combofix -> popup );
@@ -1735,8 +1728,8 @@
 			 COMBOFIX_COL_SEPARATOR, &separator_2,
 			 -1 );
 
-    if (!combofix -> mixed_sort)
-	return_value = list_number_1 - list_number_2;
+    if ( combofix -> mixed_sort == FALSE )
+	    return_value = list_number_1 - list_number_2;
 
     if (!return_value)
     {
@@ -1744,23 +1737,24 @@
 	    return_value = 1;
 	else
 	    if (separator_2)
-		return_value = -1;
+		    return_value = -1;
 	    else
 	    {
-		gchar *cmp_string_1;
-		gchar *cmp_string_2;
+            gchar *cmp_string_1;
+            gchar *cmp_string_2;
 
-		cmp_string_1 = g_utf8_collate_key (string_1, -1);
-		cmp_string_2 = g_utf8_collate_key (string_2, -1);
-		return_value = g_ascii_strcasecmp ( cmp_string_1,
-						    cmp_string_2 );
-		g_free (cmp_string_1);
-		g_free (cmp_string_2);
+            cmp_string_1 = g_utf8_collate_key (string_1, -1);
+            cmp_string_2 = g_utf8_collate_key (string_2, -1);
+            return_value = g_ascii_strcasecmp ( cmp_string_1,
+                                cmp_string_2 );
+            g_free (cmp_string_1);
+            g_free (cmp_string_2);
 	    }
     }
 
     g_free (string_1);
     g_free (string_2);
+
     return return_value;
 }
 
@@ -1779,7 +1773,7 @@
 					      GtkTreeIter *iter,
 					      GtkComboFix *combofix )
 {
-    gint value;
+    gboolean value;
 
     gtk_tree_model_get ( GTK_TREE_MODEL (model),
 			 iter,
@@ -1787,63 +1781,11 @@
 			 -1 );
 
     if (value)
-	return TRUE;
+	    return TRUE;
     return FALSE;
 }
 
-void gtk_combofix_print_visibles_rows ( GtkComboFix *combofix )
-{
-    GtkTreeModel *model;
-    GtkTreePath *path;
-    GtkTreeIter iter;
-    gint path_ok;
-    gint separator;
-
-    devel_debug ( NULL );
-
-    model = GTK_TREE_MODEL (combofix -> store);
-    path = gtk_tree_path_new_first ();
-    path_ok = gtk_tree_model_get_iter ( model, &iter, path );
-
-    while (path_ok)
-    {
-        gchar *model_string;
-        gint show_row;
 
-        gtk_tree_model_get ( model,
-                     &iter,
-                     COMBOFIX_COL_REAL_STRING, &model_string,
-                     COMBOFIX_COL_VISIBLE, &show_row,
-                     COMBOFIX_COL_SEPARATOR, &separator,
-                     -1 );
-        if ( show_row && !separator )
-            printf ("string = %s\n", model_string);
-        /* increment the path :
-         * 	go to see the children only if the mother is showed */
-        if ( gtk_tree_model_iter_has_child ( model, &iter )
-             &&
-             show_row )
-            gtk_tree_path_down (path);
-        else
-            gtk_tree_path_next (path);
-
-        path_ok = gtk_tree_model_get_iter ( model, &iter, path );
-
-        /* if path_ok is FALSE, perhaps we are on the end of the children list... */
-        if (!path_ok
-            &&
-            gtk_tree_path_get_depth (path) > 1)
-        {
-            gtk_tree_path_up (path);
-            gtk_tree_path_next (path);
-            path_ok = gtk_tree_model_get_iter ( model, &iter, path );
-        }
-    }
-
-    gtk_tree_path_free (path);
-
-
-}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: gsb_form_widget.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form_widget.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- gsb_form_widget.c	23 Oct 2009 19:30:17 -0000	1.38
+++ gsb_form_widget.c	22 Nov 2009 18:45:52 -0000	1.39
@@ -183,7 +183,8 @@
 	    break;
 
 	case TRANSACTION_FORM_PARTY:
-	    widget = gtk_combofix_new_complex ( gsb_data_payee_get_name_and_report_list());
+	    widget = gtk_combofix_new_complex (
+                        gsb_data_payee_get_name_and_report_list ( ) );
 	    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget),
 					  etat.combofix_force_payee );
 	    gtk_combofix_set_max_items ( GTK_COMBOFIX (widget),
@@ -199,7 +200,8 @@
 	    break;
 
 	case TRANSACTION_FORM_CATEGORY:
-	    widget = gtk_combofix_new_complex ( gsb_data_category_get_name_list (TRUE, TRUE, TRUE, TRUE));
+	    widget = gtk_combofix_new_complex (
+                         gsb_data_category_get_name_list ( TRUE, TRUE, TRUE, TRUE ) );
 	    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget),
 					  etat.combofix_force_category );
 	    gtk_combofix_set_max_items ( GTK_COMBOFIX (widget),
@@ -217,7 +219,8 @@
 	    break;
 
 	case TRANSACTION_FORM_BUDGET:
-	    widget = gtk_combofix_new_complex ( gsb_data_budget_get_name_list (TRUE, TRUE));
+	    widget = gtk_combofix_new_complex (
+                        gsb_data_budget_get_name_list (TRUE, TRUE));
 	    gtk_combofix_set_force_text ( GTK_COMBOFIX (widget),
 					  etat.combofix_force_category );
 	    gtk_combofix_set_max_items ( GTK_COMBOFIX (widget),
@@ -421,7 +424,7 @@
 	    break;
 
 	case TRANSACTION_FORM_CATEGORY:
-	    return (N_("Category line"));
+	    return (N_("Categories : Sub-categories"));
 	    break;
 
 	case TRANSACTION_FORM_FREE:

Index: imputation_budgetaire.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/imputation_budgetaire.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- imputation_budgetaire.c	22 Nov 2009 08:32:00 -0000	1.162
+++ imputation_budgetaire.c	22 Nov 2009 18:45:52 -0000	1.163
@@ -178,6 +178,7 @@
 						       "weight", META_TREE_FONT_COLUMN,
 						       "xalign", META_TREE_XALIGN_COLUMN,
 						       NULL);
+    gtk_tree_view_column_set_alignment ( column, 1.0 );
     gtk_tree_view_append_column ( GTK_TREE_VIEW ( budgetary_line_tree ),
 				  GTK_TREE_VIEW_COLUMN ( column ) );
 

Index: traitement_variables.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/traitement_variables.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- traitement_variables.c	2 Nov 2009 19:56:37 -0000	1.182
+++ traitement_variables.c	22 Nov 2009 18:45:52 -0000	1.183
@@ -328,7 +328,7 @@
 
     /* init default combofix values */
     etat.combofix_mixed_sort = FALSE;
-    etat.combofix_max_item = FALSE;
+    etat.combofix_max_item = 0;
     etat.combofix_case_sensitive = FALSE;
     etat.combofix_enter_select_completion = FALSE;
     etat.combofix_force_payee = FALSE;

Index: gsb_form.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_form.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- gsb_form.c	2 Nov 2009 19:56:37 -0000	1.135
+++ gsb_form.c	22 Nov 2009 18:45:52 -0000	1.136
@@ -1760,7 +1760,7 @@
 		/* need to work with the combofix to avoid some signals if we work
 		 * directly on the entry */
 		gtk_combofix_set_text ( GTK_COMBOFIX ( gsb_form_widget_get_widget (element_number) ),
-					string );
+					_(string) );
 		break;
 
 	    default:

Index: categories_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- categories_onglet.c	22 Nov 2009 08:32:00 -0000	1.201
+++ categories_onglet.c	22 Nov 2009 18:45:52 -0000	1.202
@@ -165,6 +165,7 @@
 						       "weight", META_TREE_FONT_COLUMN,
 						       "xalign", META_TREE_XALIGN_COLUMN,
 						       NULL);
+    gtk_tree_view_column_set_alignment ( column, 1.0 );
     gtk_tree_view_append_column ( GTK_TREE_VIEW ( arbre_categ ),
 				  GTK_TREE_VIEW_COLUMN ( column ) );
 

Index: gtk_combofix.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gtk_combofix.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gtk_combofix.h	10 Jan 2009 18:53:54 -0000	1.6
+++ gtk_combofix.h	22 Nov 2009 18:45:52 -0000	1.7
@@ -68,11 +68,12 @@
 
     /* *** private entries *** */
 
-    /* the tree_store is 3 columns :
+    /* the tree_store is 5 columns :
      * COMBOFIX_COL_VISIBLE_STRING (a string) : what we see in the combofix
      * COMBOFIX_COL_REAL_STRING (a string) : what we set in the entry when selecting something
      * COMBOFIX_COL_VISIBLE (a boolean) : if that line has to be showed
-     * COMBOFIX_COL_LIST_NUMBER (a int) : the number of the list for a complex combofix (0 else), -1 for separator */
+     * COMBOFIX_COL_LIST_NUMBER (a int) : the number of the list 1, 2 ou 3 (CREDIT DEBIT SPECIAL
+     * COMBOFIX_COL_SEPARATOR TRUE if this is a separator */
     GtkTreeStore *store;
     GtkTreeModel *model_filter;
     GtkTreeModel *model_sort;

Index: tiers_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -d -r1.169 -r1.170
--- tiers_onglet.c	22 Nov 2009 08:32:00 -0000	1.169
+++ tiers_onglet.c	22 Nov 2009 18:45:52 -0000	1.170
@@ -247,7 +247,7 @@
 						       NULL);
     gtk_tree_view_append_column ( GTK_TREE_VIEW ( payee_tree ),
 				  GTK_TREE_VIEW_COLUMN ( column ) );
-
+    gtk_tree_view_column_set_alignment ( column, 1.0 );
     gtk_container_add ( GTK_CONTAINER ( scroll_window ), payee_tree );
     gtk_widget_show ( payee_tree );
 

Index: gsb_currency.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_currency.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- gsb_currency.c	19 Nov 2009 20:13:45 -0000	1.49
+++ gsb_currency.c	22 Nov 2009 18:45:52 -0000	1.50
@@ -423,6 +423,9 @@
         if ( current_exchange_fees.mantissa )
             gsb_data_transaction_set_exchange_fees ( transaction_number,
                         current_exchange_fees );
+        else
+            gsb_data_transaction_set_exchange_fees ( transaction_number,
+                        null_real );
 
         if ( current_exchange.mantissa == 0 )
             gsb_data_transaction_set_exchange_rate ( transaction_number,
@@ -455,6 +458,10 @@
     if ( current_exchange_fees.mantissa )
         gsb_data_transaction_set_exchange_fees ( transaction_number,
                         current_exchange_fees );
+    else
+        gsb_data_transaction_set_exchange_fees ( transaction_number,
+                        null_real );
+
     gsb_data_transaction_set_change_between (transaction_number, 0 );
 }
 
@@ -661,8 +668,17 @@
         else
             current_exchange = gsb_real_get_from_string (
                         gtk_entry_get_text ( GTK_ENTRY ( entry ) ) );
-        current_exchange_fees = gsb_real_get_from_string (
+
+        if ( strlen ( gtk_entry_get_text ( GTK_ENTRY ( fees_entry ) ) ) > 0
+         ||
+         strcmp ( gtk_entry_get_text ( GTK_ENTRY ( fees_entry ) ), "0" ) != 0 )
+        {
+            current_exchange_fees = gsb_real_get_from_string (
                         gtk_entry_get_text ( GTK_ENTRY ( fees_entry ) ) );
+        }
+        else
+            current_exchange_fees = null_real ;
+
         if ( current_exchange.mantissa == 0 )
         {
             tmpstr = g_strdup_printf ( _("The exchange rate or the transaction amount in "



More information about the cvs mailing list