diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 15d6c40fd..92e4f1037 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2005-04-13 Don Allingham + * 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 diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 3b6133a16..9080a4ca5 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -138,6 +138,8 @@ class Gramps(GrampsDBCallback.GrampsDBCallback): self.history = [] self.mhistory = [] self.hindex = -1 + + self.undo_active = False self.db = GrampsBSDDB.GrampsBSDDB() @@ -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()