From 517f794af621cfb1176036b3bc3f5a8d99135ee3 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Fri, 16 Sep 2016 20:53:37 +0200 Subject: [PATCH] 9700: Select Place search & Source/Citation hierarchy should NOT be expanded --- gramps/gui/editors/displaytabs/citationembedlist.py | 2 +- gramps/gui/selectors/baseselector.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gramps/gui/editors/displaytabs/citationembedlist.py b/gramps/gui/editors/displaytabs/citationembedlist.py index 804e5ec41..f2befe564 100644 --- a/gramps/gui/editors/displaytabs/citationembedlist.py +++ b/gramps/gui/editors/displaytabs/citationembedlist.py @@ -155,7 +155,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): def share_button_clicked(self, obj): SelectCitation = SelectorFactory('Citation') - sel = SelectCitation(self.dbstate, self.uistate, self.track) + sel = SelectCitation(self.dbstate, self.uistate, self.track, expand=False) object = sel.run() LOG.debug("selected object: %s" % object) # the object returned should either be a Source or a Citation diff --git a/gramps/gui/selectors/baseselector.py b/gramps/gui/selectors/baseselector.py index 870a36ed8..7012a439b 100644 --- a/gramps/gui/selectors/baseselector.py +++ b/gramps/gui/selectors/baseselector.py @@ -53,13 +53,14 @@ class BaseSelector(ManagedWindow): IMAGE = 2 def __init__(self, dbstate, uistate, track=[], filter=None, skip=set(), - show_search_bar = True, default=None): + show_search_bar = True, default=None, expand=True): """Set up the dialog with the dbstate and uistate, track of parent windows for ManagedWindow, initial filter for the model, skip with set of handles to skip in the view, and search_bar to show the SearchBar at the top or not. """ self.filter = (2, filter, False) + self.expand = expand # Set window title, some selectors may set self.title in their __init__ if not hasattr(self, 'title'): @@ -293,8 +294,9 @@ class BaseSelector(ManagedWindow): self.setupcols = False - if not (self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY): - self.tree.expand_all() + if self.expand: + if not (self.model.get_flags() & Gtk.TreeModelFlags.LIST_ONLY): + self.tree.expand_all() def column_clicked(self, obj, data): if self.sort_col != data: