From dd653e7abb5c21f80deff061b88c825dbc2e00bc Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sat, 31 Dec 2011 22:04:06 +0000 Subject: [PATCH] 5232: Connect database signals using the callback manager svn: r18672 --- src/plugins/view/pedigreeview.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/plugins/view/pedigreeview.py b/src/plugins/view/pedigreeview.py index 8cc7f3dc6..492837e03 100644 --- a/src/plugins/view/pedigreeview.py +++ b/src/plugins/view/pedigreeview.py @@ -860,6 +860,19 @@ class PedigreeView(NavigationView): except AttributeError, msg: RunDatabaseRepair(str(msg)) + def _connect_db_signals(self): + """ + Connect database signals. + """ + self._add_db_signal('person-add', self.person_rebuild) + self._add_db_signal('person-update', self.person_rebuild) + self._add_db_signal('person-delete', self.person_rebuild) + self._add_db_signal('person-rebuild', self.person_rebuild_bm) + self._add_db_signal('family-update', self.person_rebuild) + self._add_db_signal('family-add', self.person_rebuild) + self._add_db_signal('family-delete', self.person_rebuild) + self._add_db_signal('family-rebuild', self.person_rebuild) + def change_db(self, db): """ Callback associated with DbState. Whenever the database @@ -868,14 +881,7 @@ class PedigreeView(NavigationView): is no need to store the database, since we will get the value from self.state.db """ - db.connect('person-add', self.person_rebuild) - db.connect('person-update', self.person_rebuild) - db.connect('person-delete', self.person_rebuild) - db.connect('person-rebuild', self.person_rebuild_bm) - db.connect('family-update', self.person_rebuild) - db.connect('family-add', self.person_rebuild) - db.connect('family-delete', self.person_rebuild) - db.connect('family-rebuild', self.person_rebuild) + self._change_db(db) self.bookmarks.update_bookmarks(self.dbstate.db.get_bookmarks()) if self.active: self.bookmarks.redraw()