From e59aa58c63377ceb0c9473b1dbd5c339366958f6 Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Thu, 8 Aug 2019 11:50:47 -0500 Subject: [PATCH] Fix some Gramplets not updating during tree changes after db change. (#865) Fixes #11234 --- gramps/gen/plug/_gramplet.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gramps/gen/plug/_gramplet.py b/gramps/gen/plug/_gramplet.py index 76b097224..b6b7d67c5 100644 --- a/gramps/gen/plug/_gramplet.py +++ b/gramps/gen/plug/_gramplet.py @@ -33,9 +33,11 @@ LOG = logging.getLogger(".Gramplets") # Gramps modules # #------------------------------------------------------------------------ +from ...gui.dbguielement import DbGUIElement from ..const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext + class Gramplet: """ Base class for non-graphical gramplet code. @@ -397,6 +399,13 @@ class Gramplet: if hasattr(self.gui, 'navtypes') and 'Person' in self.gui.navtypes: self.connect_signal('Person', self._active_changed) self.db_changed() + # Some Gramplets use DbGUIElement; and DbGUIElement needs to know if + # db is changed. However, at initialization, DbGUIElement is not yet + # initialized when _db_changed is called, thus the test for callman + if hasattr(self, "callman") and isinstance(self, DbGUIElement): + # get DbGUIElement informed if in use + self._change_db(db) # DbGUIElement method + self.update() def _no_db(self):