[grisbi-cvs] [SCM] grisbi branch, grisbi-0.8.x, updated. upstream_version_0_8_9-14-g5143e84

Pierre Biava nobody at users.sourceforge.net
Sat Jan 21 19:54:31 CET 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, grisbi-0.8.x has been updated
       via  5143e84a5e98f7fe728203bcab6dfb8b3980ac57 (commit)
      from  09b81fb1783f695653e5e322bb17f4e8656f3882 (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 5143e84a5e98f7fe728203bcab6dfb8b3980ac57
Author: pbiava <pierre.biava at nerim.net>
Date:   Sat Jan 21 19:54:00 2012 +0100

    fixes a crash when selecting the option"Add transactions archived in the totals"

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

Changes:
diff --git a/src/gsb_currency_config.c b/src/gsb_currency_config.c
index 61aee65..16d9c77 100644
--- a/src/gsb_currency_config.c
+++ b/src/gsb_currency_config.c
@@ -852,7 +852,7 @@ GtkWidget *gsb_currency_config_create_totals_page ( void )
     check_button = gsb_automem_checkbutton_new (
                         _("Add transactions archived in the totals"),
                         &(etat.add_archive_in_total_balance),
-                        G_CALLBACK ( gsb_config_metatree_sort_transactions_changed ),
+                        G_CALLBACK ( gsb_config_metatree_re_sort_divisions ),
                         NULL);
     gtk_table_attach ( GTK_TABLE ( table ), check_button,
                         0, 1, 3, 4, GTK_SHRINK | GTK_FILL, 0, 0, 0 );
diff --git a/src/parametres.c b/src/parametres.c
index 0581869..e872463 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -75,6 +75,9 @@
 
 /*START_STATIC*/
 static GtkWidget *create_preferences_tree ( );
+static gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
+                        GdkEventButton *event,
+                        gint *pointeur );
 static gboolean gsb_config_onglet_metatree_action_changed ( GtkWidget *checkbutton,
                         GdkEventButton *event,
                         gint *pointeur );
@@ -1197,21 +1200,19 @@ GtkWidget *onglet_metatree ( void )
 
 
 /**
+ * Cette fonction est appellée suite au changement de l'ordre de tri des opérations
+ * dans les divisions.
  *
+ * \param
+ * \param
+ * \param
  *
- *
- *
+ * \return FALSE
  * */
 gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
                         GdkEventButton *event,
                         gint *pointeur )
 {
-    GtkTreeSelection *selection;
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    GtkTreePath *path = NULL;
-    gint page_number;
-
     if ( pointeur )
     {
         gint value = 0;
@@ -1220,43 +1221,76 @@ gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
         *pointeur = value;
     }
 
+    gsb_config_metatree_re_sort_divisions ( checkbutton, event, pointeur );
+
+    /* return */
+    return FALSE;
+}
+
+
+/**
+ * Cette fonction retrie la division affichée après un changement
+ *
+ * \param
+ * \param
+ * \param
+ *
+ * \return TRUE if OK else FALSE
+ * */
+gboolean gsb_config_metatree_re_sort_divisions ( GtkWidget *checkbutton,
+                        GdkEventButton *event,
+                        gpointer data )
+{
+    GtkWidget *division_tree;
+    GtkTreeSelection *selection;
+    GtkTreeModel *model;
+    GtkTreeIter iter;
+    GtkTreePath *path = NULL;
+    gint page_number;
+
     page_number = gsb_gui_navigation_get_current_page ( );
 
     switch ( page_number )
     {
-	case GSB_PAYEES_PAGE:
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( payee_tree ) );
-        if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
-            path = gtk_tree_model_get_path ( model, &iter );
-		payee_fill_tree ();
-        gtk_tree_path_up ( path );
-        gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( payee_tree ), path );
-        gtk_tree_path_free ( path );
-	    break;
+        case GSB_PAYEES_PAGE:
+            division_tree = payee_tree;
 
-	case GSB_CATEGORIES_PAGE:
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( arbre_categ ) );
-        if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
-            path = gtk_tree_model_get_path ( model, &iter );
-        remplit_arbre_categ ();
-        gtk_tree_path_up ( path );
-        gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( payee_tree ), path );
-        gtk_tree_path_free ( path );
-	    break;
+            selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( division_tree ) );
+            if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
+                path = gtk_tree_model_get_path ( model, &iter );
+            payee_fill_tree ();
+            break;
+
+        case GSB_CATEGORIES_PAGE:
+            division_tree = arbre_categ;
+
+            selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( division_tree ) );
+            if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
+                path = gtk_tree_model_get_path ( model, &iter );
+            remplit_arbre_categ ();
+            break;
+
+        case GSB_BUDGETARY_LINES_PAGE:
+            division_tree = budgetary_line_tree;
+
+            selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( division_tree ) );
+            if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
+                path = gtk_tree_model_get_path ( model, &iter );
+            remplit_arbre_imputation ();
+            break;
 
-	case GSB_BUDGETARY_LINES_PAGE:
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( budgetary_line_tree ) );
-        if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
-            path = gtk_tree_model_get_path ( model, &iter );
-		remplit_arbre_imputation ();
+        default:
+            notice_debug ("Not page selected");
+
+            return FALSE;
+            break;
+    }
+
+    if ( path )
+    {
         gtk_tree_path_up ( path );
-        gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( payee_tree ), path );
+        gtk_tree_view_expand_to_path ( GTK_TREE_VIEW ( division_tree ), path );
         gtk_tree_path_free ( path );
-	    break;
-
-	default:
-	    notice_debug ("B0rk page selected");
-	    break;
     }
 
     if ( etat.modification_fichier == 0 )
diff --git a/src/parametres.h b/src/parametres.h
index 8e21016..a1878f3 100644
--- a/src/parametres.h
+++ b/src/parametres.h
@@ -42,9 +42,9 @@ enum preference_page  {
 gboolean gsb_config_backup_dir_chosen ( GtkWidget *button,
                         GtkWidget *dialog );
 GtkWidget *gsb_config_date_format_chosen ( GtkWidget *parent, gint sens );
-gboolean gsb_config_metatree_sort_transactions_changed ( GtkWidget *checkbutton,
+gboolean gsb_config_metatree_re_sort_divisions ( GtkWidget *checkbutton,
                         GdkEventButton *event,
-                        gint *pointeur );
+                        gpointer data );
 GtkWidget *gsb_config_number_format_chosen ( GtkWidget *parent, gint sens );
 gboolean gsb_gui_encryption_toggled ( GtkWidget * checkbox, gpointer data );
 gboolean gsb_preferences_menu_open ( GtkWidget *menu_item,


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list