Fix some Gramplets not updating during tree changes after db change. (#865)
Fixes #11234
This commit is contained in:
parent
3e2e8a837f
commit
e59aa58c63
@ -33,9 +33,11 @@ LOG = logging.getLogger(".Gramplets")
|
|||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
from ...gui.dbguielement import DbGUIElement
|
||||||
from ..const import GRAMPS_LOCALE as glocale
|
from ..const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
|
|
||||||
class Gramplet:
|
class Gramplet:
|
||||||
"""
|
"""
|
||||||
Base class for non-graphical gramplet code.
|
Base class for non-graphical gramplet code.
|
||||||
@ -397,6 +399,13 @@ class Gramplet:
|
|||||||
if hasattr(self.gui, 'navtypes') and 'Person' in self.gui.navtypes:
|
if hasattr(self.gui, 'navtypes') and 'Person' in self.gui.navtypes:
|
||||||
self.connect_signal('Person', self._active_changed)
|
self.connect_signal('Person', self._active_changed)
|
||||||
self.db_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()
|
self.update()
|
||||||
|
|
||||||
def _no_db(self):
|
def _no_db(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user