]> git.pld-linux.org Git - packages/geda-gaf.git/blame - geda-gaf-git.patch
- raw
[packages/geda-gaf.git] / geda-gaf-git.patch
CommitLineData
d2d8286e
AM
1From: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@gmail.com>
2Date: Wed, 19 Jan 2011 22:12:49 +0000 (+0100)
3Subject: gschem: fix refresh in component seleciton dialog
4X-Git-Url: http://git.gpleda.org/?p=gaf.git;a=commitdiff_plain;h=334307f0c4f68f704eec422af077b9e32d37b177;hp=a30f00bbee18ad5140616ad6459365cb48b03ee7
5
6gschem: fix refresh in component seleciton dialog
7
8Block signal handler for GtkTreeSelection "updated" signal while the
9refreshed GtkTreeModel is installed in the GtkTreeView widget.
10
11This is necessary as x_compselect_callback_response cannot reliably
12determine whether it has been triggered by update of "library" or "in
13use" tree views.
14
15Closes-bug: lp-704829
16
17(cherry picked from commit 2e5decb6ff1601935cc1f005a312ca04b6d13dfb)
18---
19
20diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
21index 13e93f4..0917b79 100644
22--- a/gschem/src/x_compselect.c
23+++ b/gschem/src/x_compselect.c
24@@ -810,6 +810,7 @@ compselect_callback_refresh_library (GtkButton *button, gpointer user_data)
25 {
26 Compselect *compselect = COMPSELECT (user_data);
27 GtkTreeModel *model;
28+ GtkTreeSelection *selection;
29
30 /* Rescan the libraries for symbols */
31 s_clib_refresh ();
32@@ -826,11 +827,26 @@ compselect_callback_refresh_library (GtkButton *button, gpointer user_data)
33 compselect,
34 NULL);
35
36+ /* Block handling selection updated for duration of model changes */
37+ selection = gtk_tree_view_get_selection (compselect->libtreeview);
38+ g_signal_handlers_block_by_func (selection,
39+ compselect_callback_tree_selection_changed,
40+ compselect);
41+
42+ /* Update the view model with signals blocked */
43 gtk_tree_view_set_model (compselect->libtreeview, model);
44
45 /* Refresh the "In Use" view */
46 model = create_inuse_tree_model (compselect);
47+
48+ /* Here we can update the model without blocking signals
49+ * as this is the second (final) tree view we are updating */
50 gtk_tree_view_set_model (compselect->inusetreeview, model);
51+
52+ /* Unblock & fire handler for libtreeview selection */
53+ g_signal_handlers_unblock_by_func (selection,
54+ compselect_callback_tree_selection_changed,
55+ compselect);
56 }
57
58 /*! \brief Creates the treeview for the "In Use" view. */
This page took 0.121142 seconds and 4 git commands to generate.