[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_5-177-g0b73655
Pierre Biava
nobody at users.sourceforge.net
Thu Nov 1 17:13:50 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 0b73655cc91f06a06156ed9e3545f92893da03ee (commit)
from 1ac805f73206238e16f57b3a6f9c641b46ab1197 (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 0b73655cc91f06a06156ed9e3545f92893da03ee
Author: pbiava <pierre.biava at nerim.net>
Date: Thu Nov 1 12:32:31 2012 +0100
Fixed a bug in selecting operations.
-----------------------------------------------------------------------
Changes:
diff --git a/src/gsb_form.c b/src/gsb_form.c
index 970138e..e50a963 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -2687,9 +2687,15 @@ gboolean gsb_form_finish_edition ( void )
if ( is_transaction
&&
transaction_list_get_variance ( gsb_data_account_get_current_transaction_number ( account_number ) ) )
- transaction_list_select ( mother_number );
+ {
+ gtk_tree_view_collapse_all ( GTK_TREE_VIEW ( gsb_transactions_list_get_tree_view () ) );
+ transaction_list_select ( -1 );
+ }
else if ( !is_transaction && !execute_scheduled && gsb_data_scheduled_get_variance ( mother_number ) )
+ {
+ gtk_tree_view_collapse_all ( GTK_TREE_VIEW ( gsb_scheduler_list_get_tree_view () ) );
gsb_scheduler_list_select ( mother_number );
+ }
}
/* if it was a modification of transaction, we need to update the sort and colors
diff --git a/src/gsb_scheduler_list.c b/src/gsb_scheduler_list.c
index 2db0661..42eeeb8 100644
--- a/src/gsb_scheduler_list.c
+++ b/src/gsb_scheduler_list.c
@@ -1438,48 +1438,60 @@ gboolean gsb_scheduler_list_select ( gint scheduled_number )
{
GtkTreeIter *iter;
GtkTreeIter iter_sort;
+ GtkTreePath *path = NULL;
gint mother_number;
- devel_debug_int (scheduled_number);
+ devel_debug_int ( scheduled_number );
/* if it's a split child, we must open the mother to select it */
- mother_number = gsb_data_scheduled_get_mother_scheduled_number (scheduled_number);
- if (mother_number)
+ mother_number = gsb_data_scheduled_get_mother_scheduled_number ( scheduled_number );
+ if ( mother_number )
{
- GtkTreeIter *iter_mother;
- GtkTreeIter iter_mother_sort;
+ GtkTreeIter *iter_mother;
+ GtkTreeIter iter_mother_sort;
- iter_mother = gsb_scheduler_list_get_iter_from_scheduled_number (mother_number);
- if (iter_mother)
- {
- GtkTreePath *path;
+ iter_mother = gsb_scheduler_list_get_iter_from_scheduled_number ( mother_number );
+ if ( iter_mother )
+ {
- gtk_tree_model_sort_convert_child_iter_to_iter ( GTK_TREE_MODEL_SORT (tree_model_sort_scheduler_list),
- &iter_mother_sort,
- iter_mother );
- path = gtk_tree_model_get_path ( GTK_TREE_MODEL (tree_model_sort_scheduler_list),
- &iter_mother_sort );
- gtk_tree_view_expand_row ( GTK_TREE_VIEW (tree_view_scheduler_list),
- path,
- TRUE );
- gtk_tree_iter_free (iter_mother);
- gtk_tree_path_free (path);
- }
+ gtk_tree_model_sort_convert_child_iter_to_iter ( GTK_TREE_MODEL_SORT (
+ tree_model_sort_scheduler_list ),
+ &iter_mother_sort,
+ iter_mother );
+ path = gtk_tree_model_get_path ( GTK_TREE_MODEL ( tree_model_sort_scheduler_list ),
+ &iter_mother_sort );
+ gtk_tree_view_expand_row ( GTK_TREE_VIEW ( tree_view_scheduler_list ),
+ path,
+ TRUE );
+ gtk_tree_iter_free ( iter_mother );
+ }
}
/* now can work with the transaction we want to select */
- iter = gsb_scheduler_list_get_iter_from_scheduled_number (scheduled_number);
+ iter = gsb_scheduler_list_get_iter_from_scheduled_number ( scheduled_number );
if (!iter)
return FALSE;
- gtk_tree_model_sort_convert_child_iter_to_iter ( GTK_TREE_MODEL_SORT (tree_model_sort_scheduler_list),
- &iter_sort,
- iter );
- gtk_tree_selection_select_iter ( GTK_TREE_SELECTION ( gtk_tree_view_get_selection ( GTK_TREE_VIEW (tree_view_scheduler_list))),
- &iter_sort );
+ gtk_tree_model_sort_convert_child_iter_to_iter ( GTK_TREE_MODEL_SORT ( tree_model_sort_scheduler_list ),
+ &iter_sort,
+ iter );
- gtk_tree_iter_free (iter);
+ gtk_tree_selection_select_iter ( GTK_TREE_SELECTION (
+ gtk_tree_view_get_selection ( GTK_TREE_VIEW ( tree_view_scheduler_list ) ) ),
+ &iter_sort );
+
+ /* move the tree view to the selection */
+ if ( path == NULL )
+ path = gtk_tree_model_get_path ( GTK_TREE_MODEL ( tree_model_sort_scheduler_list ),
+ &iter_sort );
+
+ gtk_tree_view_scroll_to_cell ( GTK_TREE_VIEW ( tree_view_scheduler_list ),
+ path, NULL,
+ FALSE, 0.0, 0.0 );
+
+ gtk_tree_iter_free ( iter );
+ gtk_tree_path_free ( path );
return FALSE;
}
hooks/post-receive
--
grisbi
More information about the cvs
mailing list