* 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


svn: r4292
This commit is contained in:
Don Allingham 2005-04-04 16:41:01 +00:00
parent 76c89d5f08
commit a73730ba1c
4 changed files with 22 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2005-04-04 Don Allingham <don@gramps-project.org>
* 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 <rjt-gramps@thegrindstone.me.uk>
* src/GrampsDBCallback.py: Added code to disable/enable signals on
a per instance or all instance bassis. Improved test code and

View File

@ -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):
"""

View File

@ -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)

View File

@ -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']