From efb2a63492bd0f35132e96bf3dd25dabafd983b5 Mon Sep 17 00:00:00 2001 From: prculley Date: Thu, 21 Jun 2018 09:29:27 -0500 Subject: [PATCH] Fix BaseSelector to avoid long delay before display on large trees Fixes #10634 --- gramps/gui/glade/baseselector.glade | 17 +++++++++++++++++ gramps/gui/selectors/baseselector.py | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gramps/gui/glade/baseselector.glade b/gramps/gui/glade/baseselector.glade index b98b38b7d..c6291e996 100644 --- a/gramps/gui/glade/baseselector.glade +++ b/gramps/gui/glade/baseselector.glade @@ -121,6 +121,7 @@ False True False + True center True 0.5 @@ -132,6 +133,22 @@ 2 + + + True + False + Loading items... + 10 + + + + + + False + True + 3 + + True diff --git a/gramps/gui/selectors/baseselector.py b/gramps/gui/selectors/baseselector.py index 984dd0e7b..bdbf801a9 100644 --- a/gramps/gui/selectors/baseselector.py +++ b/gramps/gui/selectors/baseselector.py @@ -107,7 +107,6 @@ class BaseSelector(ManagedWindow): self.sortorder = Gtk.SortType.ASCENDING self.skip_list=skip - self.build_tree() self.selection = self.tree.get_selection() self.track_ref_for_deletion("selection") @@ -123,6 +122,12 @@ class BaseSelector(ManagedWindow): self.showall.show() else: self.showall.hide() + while Gtk.events_pending(): + Gtk.main_iteration() + self.build_tree() + loading = self.glade.get_object('loading') + loading.hide() + if default: self.goto_handle(default)