* src/gramps_main.py: check for reentrancy into the undo handler
svn: r4359
This commit is contained in:
parent
223c363a47
commit
2059945bc6
@ -1,4 +1,5 @@
|
|||||||
2005-04-13 Don Allingham <don@gramps-project.org>
|
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,
|
* src/plugins/WebPage.py: fixed check on dialog run() return value,
|
||||||
changed deprecated gtk.mainiteration to gtk.main_iteration
|
changed deprecated gtk.mainiteration to gtk.main_iteration
|
||||||
* src/WriteGedcom.py: fixed problem with skipping events
|
* src/WriteGedcom.py: fixed problem with skipping events
|
||||||
|
@ -138,6 +138,8 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
|
|||||||
self.history = []
|
self.history = []
|
||||||
self.mhistory = []
|
self.mhistory = []
|
||||||
self.hindex = -1
|
self.hindex = -1
|
||||||
|
|
||||||
|
self.undo_active = False
|
||||||
|
|
||||||
self.db = GrampsBSDDB.GrampsBSDDB()
|
self.db = GrampsBSDDB.GrampsBSDDB()
|
||||||
|
|
||||||
@ -501,11 +503,20 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
|
|||||||
label.set_use_underline(1)
|
label.set_use_underline(1)
|
||||||
|
|
||||||
def undo(self,*args):
|
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()
|
self.db.undo()
|
||||||
if self.active_person:
|
if self.active_person:
|
||||||
p = self.db.get_person_from_handle(self.active_person.get_handle())
|
p = self.db.get_person_from_handle(self.active_person.get_handle())
|
||||||
self.change_active_person(p)
|
self.change_active_person(p)
|
||||||
self.emit('database-changed',(self.db,))
|
self.emit('database-changed',(self.db,))
|
||||||
|
self.undo_active = False
|
||||||
|
|
||||||
def exit_and_undo(self,*args):
|
def exit_and_undo(self,*args):
|
||||||
self.db.disable_signals()
|
self.db.disable_signals()
|
||||||
|
Loading…
Reference in New Issue
Block a user