diff --git a/gramps/gui/editors/displaytabs/citationembedlist.py b/gramps/gui/editors/displaytabs/citationembedlist.py index 10a8c31a2..8380a878f 100644 --- a/gramps/gui/editors/displaytabs/citationembedlist.py +++ b/gramps/gui/editors/displaytabs/citationembedlist.py @@ -154,7 +154,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 59014af40..a622a8fc9 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'): @@ -288,8 +289,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: