[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_5-56-ga4d09e0

Pierre Biava nobody at users.sourceforge.net
Sat Jan 21 19:37:32 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, master has been updated
       via  a4d09e0ac67765b4aa55dd7988e6cc9dab0a7495 (commit)
      from  052b2483a05c8a6bf4996b8ed532200ca79c07ad (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 a4d09e0ac67765b4aa55dd7988e6cc9dab0a7495
Author: pbiava <pierre.biava at nerim.net>
Date:   Thu Jan 19 21:33:51 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 de8fe8e..9944e5c 100644
--- a/src/gsb_currency_config.c
+++ b/src/gsb_currency_config.c
@@ -852,8 +852,8 @@ 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 ),
+                        &etat.add_archive_in_total_balance,
+                        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 1c98b29..a5e30cd 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -78,6 +78,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 );
@@ -1177,24 +1180,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 )
 {
-    GtkWidget *payee_tree;
-    GtkWidget *category_tree;
-    GtkWidget *budgetary_tree;
-    GtkTreeSelection *selection;
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    GtkTreePath *path = NULL;
-    gint page_number;
-
     if ( pointeur )
     {
         gint value = 0;
@@ -1203,51 +1201,82 @@ 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 ( );
-    payee_tree = payees_get_tree_view ( );
-    category_tree = categories_get_tree_view ( );
-    budgetary_tree = budgetary_lines_get_tree_view ( );
 
     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 );
-	    payees_fill_list ();
-        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 = payees_get_tree_view ( );
 
-	case GSB_CATEGORIES_PAGE:
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( category_tree ) );
-        if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
-            path = gtk_tree_model_get_path ( model, &iter );
-        categories_fill_list ();
-        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 );
+            payees_fill_list ();
+            break;
 
-	case GSB_BUDGETARY_LINES_PAGE:
-        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( budgetary_tree ) );
-        if ( gtk_tree_selection_get_selected ( selection, &model, &iter ) )
-            path = gtk_tree_model_get_path ( model, &iter );
-		budgetary_lines_fill_list ();
+        case GSB_CATEGORIES_PAGE:
+            division_tree = categories_get_tree_view ( );
+
+            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 );
+            categories_fill_list ();
+            break;
+
+        case GSB_BUDGETARY_LINES_PAGE:
+            division_tree = budgetary_lines_get_tree_view ( );
+
+            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 );
+            budgetary_lines_fill_list ();
+            break;
+
+        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;
     }
 
     gsb_file_set_modified ( TRUE );
 
-    return FALSE;
+    /* return */
+    return TRUE;
 }
 
 
diff --git a/src/parametres.h b/src/parametres.h
index 296cccf..94084b5 100644
--- a/src/parametres.h
+++ b/src/parametres.h
@@ -45,9 +45,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