diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 154d9bafb..1e5e0e25a 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,11 @@ +2005-04-04 Don Allingham + * src/GrampsDbBase.py: add "request_rebuild" to encapsulate rebuild + requests in the database instance + * src/ReadXML.py: use request_rebuild instead of directly emitting s + ignals + * src/ReadGedCom.py: use request_rebuild instead of directly emitting + signals + 2005-04-01 Richard Taylor * src/GrampsDBCallback.py: Added code to disable/enable signals on a per instance or all instance bassis. Improved test code and diff --git a/gramps2/src/GrampsDbBase.py b/gramps2/src/GrampsDbBase.py index debe12d2f..b7a63f955 100644 --- a/gramps2/src/GrampsDbBase.py +++ b/gramps2/src/GrampsDbBase.py @@ -248,6 +248,17 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback): Returns 1 if the database has been opened. """ return self.person_map != None + + def request_rebuild(self): + """ + Notifies clients that the data has change significantly, and that all + internal data dependent on the database should be rebuilt. + """ + self.emit('person-rebuild') + self.emit('family-rebuild') + self.emit('place-rebuild') + self.emit('source-rebuild') + self.emit('media-rebuild') def commit_person(self,person,transaction,change_time=None): """ @@ -957,11 +968,7 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback): self.undo_callback(_("_Undo %s") % transaction.get_description()) if transaction and transaction.batch: - self.emit('person-rebuild') - self.emit('family-rebuild') - self.emit('place-rebuild') - self.emit('source-rebuild') - self.emit('media-rebuild') + self.request_rebuild() def undo(self): """ diff --git a/gramps2/src/ReadGedcom.py b/gramps2/src/ReadGedcom.py index 6fbbcdcb0..bf505067e 100644 --- a/gramps2/src/ReadGedcom.py +++ b/gramps2/src/ReadGedcom.py @@ -498,10 +498,7 @@ class GedcomParser: if use_trans: self.db.transaction_commit(self.trans,_("GEDCOM import")) else: - self.db.emit('person-rebuild') - self.db.emit('family-rebuild') - self.db.emit('place-rebuild') - self.db.emit('source-rebuild') + self.db.request_rebuild() if self.window: self.infomsg("\n%s" % msg) diff --git a/gramps2/src/ReadXML.py b/gramps2/src/ReadXML.py index 08203d77f..1076cc9f0 100644 --- a/gramps2/src/ReadXML.py +++ b/gramps2/src/ReadXML.py @@ -562,10 +562,7 @@ class GrampsParser: if use_trans: self.db.transaction_commit(self.trans,_("GRAMPS XML import")) else: - self.db.emit('person-rebuild') - self.db.emit('family-rebuild') - self.db.emit('place-rebuild') - self.db.emit('source-rebuild') + self.db.request_rebuild() def start_lds_ord(self,attrs): atype = attrs['type']