[grisbi-cvs] [SCM] grisbi branch, master, updated. fdd1eed85bb3ecbce7178a4a9c00d9c0f0f2ba6f

Pierre Biava nobody at users.sourceforge.net
Tue Jul 6 22:19:06 CEST 2010


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  fdd1eed85bb3ecbce7178a4a9c00d9c0f0f2ba6f (commit)
       via  c534d576ceb75e1ad95c3d2e8885c16027fab685 (commit)
      from  e068c628b9f826cd60a1bc79d906bc457096bdb2 (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 fdd1eed85bb3ecbce7178a4a9c00d9c0f0f2ba6f
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Jul 6 22:09:47 2010 +0200

    Integration of module budgetary in grisbi

commit c534d576ceb75e1ad95c3d2e8885c16027fab685
Author: pbiava <pierre.biava at nerim.net>
Date:   Tue Jul 6 21:35:51 2010 +0200

    change management combofix to return the first occurrence of gtkcombofix

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

Changes:
diff --git a/configure.in b/configure.in
index 32d7a84..70ee8f0 100644
--- a/configure.in
+++ b/configure.in
@@ -33,17 +33,6 @@ AC_SUBST(GRISBI_LIBS)
 # </hack>
 
 dnl
-dnl balance estimate
-dnl
-AC_ARG_WITH(balance_estimate,
-	AC_HELP_STRING([--with-balance-estimate],
-	[add the support of balance estimate.]),
-[
-  AC_DEFINE(ENABLE_BALANCE_ESTIMATE, 1, [Define if balance estimate is enabled])
-])
-
-
-dnl
 dnl Plugin support using glib's GModule
 dnl
 AC_ARG_WITH(plugins,
diff --git a/src/balance_estimate_config.c b/src/balance_estimate_config.c
index 2bff44a..c17a4db 100644
--- a/src/balance_estimate_config.c
+++ b/src/balance_estimate_config.c
@@ -26,8 +26,6 @@
 #include "include.h"
 #include <config.h>
 
-#ifdef ENABLE_BALANCE_ESTIMATE
-
 /*START_INCLUDE*/
 #include "balance_estimate_config.h"
 #include "balance_estimate_data.h"
@@ -1106,4 +1104,3 @@ void bet_config_use_budget_toggle ( GtkToggleButton *button, GtkWidget *combo )
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
-#endif /* ENABLE_BALANCE_ESTIMATE */
diff --git a/src/balance_estimate_data.c b/src/balance_estimate_data.c
index a342fa3..9f3bd46 100644
--- a/src/balance_estimate_data.c
+++ b/src/balance_estimate_data.c
@@ -26,8 +26,6 @@
 #include "include.h"
 #include <config.h>
 
-#ifdef ENABLE_BALANCE_ESTIMATE
-
 /*START_INCLUDE*/
 #include "balance_estimate_data.h"
 #include "balance_estimate_hist.h"
@@ -1809,4 +1807,3 @@ gboolean bet_data_remove_all_bet_data ( gint account_number )
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
-#endif /* ENABLE_BALANCE_ESTIMATE */
diff --git a/src/balance_estimate_future.c b/src/balance_estimate_future.c
index 367bd7e..09ad371 100644
--- a/src/balance_estimate_future.c
+++ b/src/balance_estimate_future.c
@@ -26,8 +26,6 @@
 #include "include.h"
 #include <config.h>
 
-#ifdef ENABLE_BALANCE_ESTIMATE
-
 /*START_INCLUDE*/
 #include "balance_estimate_future.h"
 #include "balance_estimate_data.h"
@@ -2577,4 +2575,3 @@ void bet_transfert_replace_data_toggle ( GtkToggleButton *button, GtkWidget *dia
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
-#endif /* ENABLE_BALANCE_ESTIMATE */
diff --git a/src/balance_estimate_hist.c b/src/balance_estimate_hist.c
index 9ea8f61..3ac8053 100644
--- a/src/balance_estimate_hist.c
+++ b/src/balance_estimate_hist.c
@@ -26,8 +26,6 @@
 #include "include.h"
 #include <config.h>
 
-#ifdef ENABLE_BALANCE_ESTIMATE
-
 /*START_INCLUDE*/
 #include "balance_estimate_hist.h"
 #include "balance_estimate_tab.h"
@@ -1672,4 +1670,3 @@ void bet_historical_set_page_title ( gint account_number )
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
-#endif /* ENABLE_BALANCE_ESTIMATE */
diff --git a/src/balance_estimate_tab.c b/src/balance_estimate_tab.c
index 1147632..3dc2473 100644
--- a/src/balance_estimate_tab.c
+++ b/src/balance_estimate_tab.c
@@ -36,8 +36,6 @@
 #include "include.h"
 #include <config.h>
 
-#ifdef ENABLE_BALANCE_ESTIMATE
-
 /*START_INCLUDE*/
 #include "balance_estimate_tab.h"
 #include "balance_estimate_config.h"
@@ -2646,4 +2644,3 @@ gboolean bet_array_list_replace_planned_line_by_transfert ( GtkTreeModel *tab_mo
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
-#endif /* ENABLE_BALANCE_ESTIMATE */
diff --git a/src/fenetre_principale.c b/src/fenetre_principale.c
index 5ead084..6429079 100644
--- a/src/fenetre_principale.c
+++ b/src/fenetre_principale.c
@@ -236,7 +236,6 @@ gboolean gsb_gui_fill_main_notebook ( GtkWidget *notebook )
                         creation_fenetre_operations (),
                         gtk_label_new (SPACIFY(_("Transactions"))) );
 
-#ifdef ENABLE_BALANCE_ESTIMATE
      /* append the balance estimate pages */
     gtk_notebook_append_page ( GTK_NOTEBOOK ( account_page ),
                         bet_array_create_page ( ),
@@ -246,8 +245,6 @@ gboolean gsb_gui_fill_main_notebook ( GtkWidget *notebook )
                         bet_historical_create_page ( ),
                         gtk_label_new (SPACIFY(_("Historical data"))) );
 
-#endif /* ENABLE_BALANCE_ESTIMATE */
-
     gtk_notebook_append_page ( GTK_NOTEBOOK ( account_page ),
                         gsb_account_property_create_page (),
                         gtk_label_new (SPACIFY(_("Properties"))) );
@@ -302,9 +299,7 @@ gboolean gsb_gui_on_account_switch_page ( GtkNotebook *notebook,
                         guint page_number,
                         gpointer null )
 {
-#ifdef ENABLE_BALANCE_ESTIMATE
     gint account_number;
-#endif /* ENABLE_BALANCE_ESTIMATE */
 
     //~ devel_debug_int (page_number);
     switch ( page_number )
@@ -312,7 +307,6 @@ gboolean gsb_gui_on_account_switch_page ( GtkNotebook *notebook,
     case GSB_TRANSACTIONS_PAGE:
         gsb_form_set_expander_visible ( TRUE, TRUE );
         break;
-#ifdef ENABLE_BALANCE_ESTIMATE
     case GSB_ESTIMATE_PAGE:
         gsb_form_set_expander_visible (FALSE, FALSE );
         account_number = gsb_gui_navigation_get_current_account ( );
@@ -326,7 +320,6 @@ gboolean gsb_gui_on_account_switch_page ( GtkNotebook *notebook,
             bet_data_update_bet_module ( account_number, GSB_HISTORICAL_PAGE );
         bet_historical_set_page_title ( account_number );
         break;
-#endif /* ENABLE_BALANCE_ESTIMATE */
     case GSB_PROPERTIES_PAGE:
         gsb_form_set_expander_visible (FALSE, FALSE );
         break;
diff --git a/src/fenetre_principale.h b/src/fenetre_principale.h
index 807d646..b1ce5fc 100644
--- a/src/fenetre_principale.h
+++ b/src/fenetre_principale.h
@@ -15,11 +15,9 @@ typedef enum GSB_GENERAL_NOTEBOOK_PAGES {
 
 typedef enum GSB_ACCOUNT_NOTEBOOK_PAGES {
     GSB_TRANSACTIONS_PAGE,
-#ifdef ENABLE_BALANCE_ESTIMATE
     GSB_ESTIMATE_PAGE,
     GSB_HISTORICAL_PAGE,
     //~ GSB_FINANCIAL_PAGE,
-#endif /* ENABLE_BALANCE_ESTIMATE */
     GSB_PROPERTIES_PAGE,
 } GsbaccountNotebookPages;
 
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c
index 7e9c4f8..6b1b121 100644
--- a/src/gsb_file_load.c
+++ b/src/gsb_file_load.c
@@ -632,7 +632,6 @@ void gsb_file_load_start_element ( GMarkupParseContext *context,
     return;
     }
 
-#ifdef ENABLE_BALANCE_ESTIMATE
     if ( !strcmp ( element_name, "Bet" ) )
     {
         gsb_file_load_bet_part ( attribute_names, attribute_values );
@@ -657,8 +656,6 @@ void gsb_file_load_start_element ( GMarkupParseContext *context,
         return;
     }
 
-#endif /* ENABLE_BALANCE_ESTIMATE */
-
     if ( !strcmp ( element_name,
                         "Report" ))
     {
diff --git a/src/gsb_file_save.c b/src/gsb_file_save.c
index 402c41d..4573088 100644
--- a/src/gsb_file_save.c
+++ b/src/gsb_file_save.c
@@ -269,11 +269,8 @@ gboolean gsb_file_save_save_file ( const gchar *filename,
 	+ report_part * g_slist_length ( gsb_data_report_get_report_list ())
 	+ import_rule_part * g_slist_length ( gsb_data_import_rule_get_list ())
     + partial_balance_part * g_slist_length ( gsb_data_partial_balance_get_list ())
-    + logo_part;
-
-#ifdef ENABLE_BALANCE_ESTIMATE
-    length_calculated += bet_part;
-#endif /* ENABLE_BALANCE_ESTIMATE */
+    + logo_part
+    + bet_part;
 
     iterator = 0;
     file_content = g_malloc0 ( length_calculated );
@@ -364,11 +361,9 @@ gboolean gsb_file_save_save_file ( const gchar *filename,
 						&length_calculated,
 						&file_content );
 
-#ifdef ENABLE_BALANCE_ESTIMATE
     iterator = gsb_file_save_bet_part ( iterator,
                         &length_calculated,
                         &file_content );
-#endif /* ENABLE_BALANCE_ESTIMATE */
 
     iterator = gsb_file_save_report_part ( iterator,
 					   &length_calculated,
diff --git a/src/gtk_combofix.c b/src/gtk_combofix.c
index 743ed78..33536aa 100644
--- a/src/gtk_combofix.c
+++ b/src/gtk_combofix.c
@@ -54,6 +54,7 @@ struct _GtkComboFixPrivate
     gboolean mixed_sort;
     /* 0 to show all the items */
     gint max_items;
+    /* number of items */
     gint visible_items;
 
     /* old entry */
@@ -131,6 +132,8 @@ static gboolean gtk_combofix_fill_iter_parent ( GtkTreeStore *store,
                         GtkTreeIter *iter_parent,
                         const gchar *string,
                         gint list_number );
+static gchar *gtk_combofix_get_first_string_from_sort_model ( GtkTreeModel *sort_model,
+                        const gchar *string );
 static gboolean gtk_combofix_search_for_text (GtkTreeModel *model,
                         GtkTreePath *path,
                         GtkTreeIter *iter,
@@ -138,7 +141,6 @@ static gboolean gtk_combofix_search_for_text (GtkTreeModel *model,
 static gboolean gtk_combofix_select_item ( GtkComboFix *combofix,
                         const gchar *item );
 
-
 /* globals variables */
 static gint block_expose_event;
 
@@ -705,7 +707,7 @@ static void gtk_combofix_init ( GtkComboFix *combofix )
                         G_TYPE_BOOLEAN );
 
     /* we set the store in a filter to show only what is selected */
-    priv -> model_filter = gtk_tree_model_filter_new ( GTK_TREE_MODEL ( priv -> store), NULL );
+    priv -> model_filter = gtk_tree_model_filter_new ( GTK_TREE_MODEL ( priv -> store ), NULL );
     gtk_tree_model_filter_set_visible_column ( GTK_TREE_MODEL_FILTER ( priv -> model_filter ),
                         COMBOFIX_COL_VISIBLE );
 
@@ -776,6 +778,11 @@ static void gtk_combofix_dispose ( GObject *combofix )
 * */
 static void gtk_combofix_finalize ( GObject *combofix )
 {
+    GtkComboFixPrivate *priv = GTK_COMBOFIX_GET_PRIVATE ( combofix );
+
+    if ( priv -> old_entry && strlen ( priv -> old_entry ) )
+        g_free ( priv -> old_entry );
+
     G_OBJECT_CLASS ( gtk_combofix_parent_class ) -> finalize ( combofix );
 }
 
@@ -1116,10 +1123,11 @@ static gchar *gtk_combofix_update_visible_rows ( GtkComboFix *combofix,
         gint model_string_length;
 
         gtk_tree_model_get ( model,
-                     &iter,
-                     COMBOFIX_COL_REAL_STRING, &model_string,
-                     COMBOFIX_COL_SEPARATOR, &separator,
-                     -1 );
+                        &iter,
+                        COMBOFIX_COL_REAL_STRING, &model_string,
+                        COMBOFIX_COL_SEPARATOR, &separator,
+                        -1 );
+
         /* The separators are never showed */
         if (separator)
             show_row = 0;
@@ -1130,15 +1138,15 @@ static gchar *gtk_combofix_update_visible_rows ( GtkComboFix *combofix,
             if ( priv -> case_sensitive )
             {
                 show_row = !strncmp ( model_string,
-                          string,
-                          MIN (length, model_string_length));
+                            string,
+                            MIN ( length, model_string_length ) );
             }
             else
                 show_row = !g_strncasecmp ( model_string,
                             string,
-                            MIN (length, model_string_length));
+                            MIN ( length, model_string_length ) );
 
-            if (show_row)
+            if ( show_row )
             {
                 /* 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 */
@@ -1158,10 +1166,11 @@ static gchar *gtk_combofix_update_visible_rows ( GtkComboFix *combofix,
 
         /* 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);
+            gtk_tree_path_down ( path );
         else
             gtk_tree_path_next (path);
 
@@ -1178,11 +1187,13 @@ static gchar *gtk_combofix_update_visible_rows ( GtkComboFix *combofix,
         }
     }
 
-    gtk_tree_path_free (path);
+    gtk_tree_path_free ( path );
 
     gtk_tree_view_expand_all ( GTK_TREE_VIEW ( priv -> tree_view ) );
     gtk_tree_selection_unselect_all ( priv -> selection );
 
+    complete_string = gtk_combofix_get_first_string_from_sort_model ( priv -> model_sort, string );
+
     return complete_string;
 }
 
@@ -2112,6 +2123,57 @@ gboolean gtk_combofix_search_for_text (GtkTreeModel *model,
     return return_value;
 }
 
+
+/**
+ * returns the first occurrence of gtkcombofix
+ *
+ * \param sort_model
+ * \param iter
+ *
+ * \return 
+ */
+gchar *gtk_combofix_get_first_string_from_sort_model ( GtkTreeModel *sort_model,
+                        const gchar *string )
+{
+    gchar *complete_string = NULL;
+    GtkTreePath *path;
+    GtkTreeIter iter;
+    GtkTreeIter child_iter;
+    gint path_ok;
+    gint length;
+    gboolean text_written = FALSE;
+    gboolean separator = FALSE;
+    gchar *model_string;
+    gint model_string_length;
+
+    length = strlen ( string );
+
+    if ( gtk_tree_model_get_iter_first ( sort_model, &iter ) )
+    {
+        gtk_tree_model_get ( sort_model,
+                        &iter,
+                        COMBOFIX_COL_REAL_STRING, &model_string,
+                        -1 );
+
+        model_string_length = strlen ( model_string );
+
+        if ( model_string_length >= length )
+            return model_string;
+        else if ( gtk_tree_model_iter_children ( sort_model, &child_iter, &iter ) )
+        {
+            gtk_tree_model_get ( sort_model,
+                        &child_iter,
+                        COMBOFIX_COL_REAL_STRING, &model_string,
+                        COMBOFIX_COL_SEPARATOR, &separator,
+                        -1 );
+            return model_string;
+        }
+    }
+
+    return g_strdup ( string );
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */
diff --git a/src/import.c b/src/import.c
index 21f03f0..ecb1a8f 100644
--- a/src/import.c
+++ b/src/import.c
@@ -4361,10 +4361,8 @@ gboolean gsb_import_by_rule ( gint rule )
     mise_a_jour_soldes_minimaux = 1;
     mise_a_jour_accueil (FALSE);
 
-#ifdef ENABLE_BALANCE_ESTIMATE
     /* force the update module budget */
     gsb_data_account_set_bet_maj ( account_number, BET_MAJ_ALL );
-#endif /* ENABLE_BALANCE_ESTIMATE */
 
     if ( etat.modification_fichier == 0 )
         modification_fichier ( TRUE );
diff --git a/src/navigation.c b/src/navigation.c
index 5e56916..af39a28 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -995,9 +995,7 @@ gboolean navigation_change_account ( gint *no_account )
         gsb_file_update_window_title ( );
     }
 
-#ifdef ENABLE_BALANCE_ESTIMATE
     bet_data_select_bet_pages ( new_account );
-#endif /* ENABLE_BALANCE_ESTIMATE */
 
     /* unset the last date written */
     gsb_date_free_last_date ();
diff --git a/src/parametres.c b/src/parametres.c
index 685ae23..fa3fee9 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -530,7 +530,6 @@ gboolean preferences ( gint page )
     gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG(fenetre_preferences) -> vbox ),
                         hpaned, TRUE, TRUE, 0);
 
-#ifdef ENABLE_BALANCE_ESTIMATE 
     /* balance estimate subtree */
     gtk_tree_store_append (GTK_TREE_STORE (preference_tree_model), &iter, NULL);
     gtk_tree_store_set (GTK_TREE_STORE (preference_tree_model),
@@ -558,8 +557,6 @@ gboolean preferences ( gint page )
                         -1);
     gtk_notebook_append_page (preference_frame, bet_config_account_create_account_page (), NULL);
 
-#endif
-
     /* select the page */
     if ( page >= 0 && page < NUM_PREFERENCES_PAGES )
         gtk_notebook_set_current_page ( GTK_NOTEBOOK (preference_frame), page );
diff --git a/src/parametres.h b/src/parametres.h
index df8558a..5f06ed0 100644
--- a/src/parametres.h
+++ b/src/parametres.h
@@ -28,10 +28,8 @@ enum preference_page  {
     BANKS_PAGE,
     FINANCIAL_YEARS_PAGE,
     METHODS_OF_PAYMENT_PAGE,
-#ifdef ENABLE_BALANCE_ESTIMATE
     BET_GENERAL_PAGE,
     BET_ACCOUNT_PAGE,
-#endif
     NUM_PREFERENCES_PAGES
 };
 
diff --git a/src/traitement_variables.c b/src/traitement_variables.c
index 951d7ad..05959f2 100644
--- a/src/traitement_variables.c
+++ b/src/traitement_variables.c
@@ -386,12 +386,10 @@ void init_variables ( void )
     categ_tree_model = NULL;
 
     /* initializes the variables for the estimate balance module */
-#ifdef ENABLE_BALANCE_ESTIMATE
     /* création de la liste des données à utiliser dans le tableau de résultats */
     bet_data_init_variables ( );
     /* initialisation des boites de dialogue */
     bet_future_initialise_dialog ( );
-#endif /* ENABLE_BALANCE_ESTIMATE */
     etat.bet_deb_period = 1;
 }
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list