* src/gramps_main.py: check for reentrancy into the undo handler

svn: r4359
This commit is contained in:
Don Allingham 2005-04-13 22:04:52 +00:00
parent 223c363a47
commit 2059945bc6
2 changed files with 12 additions and 0 deletions

View File

@ -1,4 +1,5 @@
2005-04-13 Don Allingham <don@gramps-project.org>
* src/gramps_main.py: check for reentrancy into the undo handler
* src/plugins/WebPage.py: fixed check on dialog run() return value,
changed deprecated gtk.mainiteration to gtk.main_iteration
* src/WriteGedcom.py: fixed problem with skipping events

View File

@ -139,6 +139,8 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
self.mhistory = []
self.hindex = -1
self.undo_active = False
self.db = GrampsBSDDB.GrampsBSDDB()
try:
@ -501,11 +503,20 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
label.set_use_underline(1)
def undo(self,*args):
"""
Undo signal handler - it is possible to reenter this routine too quickly if
the user presses the C-z signal too quickly. So, we need to check to make sure
we aren't already active.
"""
if self.undo_active:
return
self.undo_active = True
self.db.undo()
if self.active_person:
p = self.db.get_person_from_handle(self.active_person.get_handle())
self.change_active_person(p)
self.emit('database-changed',(self.db,))
self.undo_active = False
def exit_and_undo(self,*args):
self.db.disable_signals()