* src/Editors/_EditFamily.py (EditFamily.__do_save): Disconnect
all signal handlers before committing data. svn: r8621
This commit is contained in:
parent
e63bc9936d
commit
a226819f70
@ -1,4 +1,6 @@
|
|||||||
2007-06-21 Alex Roitman <shura@gramps-project.org>
|
2007-06-21 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/Editors/_EditFamily.py (EditFamily.__do_save): Disconnect
|
||||||
|
all signal handlers before committing data.
|
||||||
* src/GrampsCfg.py (cb_format_changed): Catch new exception;
|
* src/GrampsCfg.py (cb_format_changed): Catch new exception;
|
||||||
escape special chars from displayed span.
|
escape special chars from displayed span.
|
||||||
* src/NameDisplay.py (_gen_cooked_func): Only replace known
|
* src/NameDisplay.py (_gen_cooked_func): Only replace known
|
||||||
|
@ -825,6 +825,20 @@ class EditFamily(EditPrimary):
|
|||||||
self.ok_button.set_sensitive(True)
|
self.ok_button.set_sensitive(True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not original and self.object_is_empty():
|
||||||
|
QuestionDialog.ErrorDialog(
|
||||||
|
_("Cannot save family"),
|
||||||
|
_("No data exists for this family. "
|
||||||
|
"Please enter data or cancel the edit."))
|
||||||
|
return
|
||||||
|
|
||||||
|
# We disconnect the callbacks to all signals we connected earlier.
|
||||||
|
# This prevents the signals originating in any of the following
|
||||||
|
# commits from being caught by us again.
|
||||||
|
for key in self.signal_keys:
|
||||||
|
self.db.disconnect(key)
|
||||||
|
self.signal_keys = []
|
||||||
|
|
||||||
if not original and not self.object_is_empty():
|
if not original and not self.object_is_empty():
|
||||||
trans = self.db.transaction_begin()
|
trans = self.db.transaction_begin()
|
||||||
|
|
||||||
@ -851,11 +865,6 @@ class EditFamily(EditPrimary):
|
|||||||
|
|
||||||
self.db.add_family(self.obj, trans)
|
self.db.add_family(self.obj, trans)
|
||||||
self.db.transaction_commit(trans,_("Add Family"))
|
self.db.transaction_commit(trans,_("Add Family"))
|
||||||
elif not original and self.object_is_empty():
|
|
||||||
QuestionDialog.ErrorDialog(_("Cannot save family"),
|
|
||||||
_("No data exists for this family. Please "
|
|
||||||
"enter data or cancel the edit."))
|
|
||||||
return
|
|
||||||
elif original and self.object_is_empty():
|
elif original and self.object_is_empty():
|
||||||
trans = self.db.transaction_begin()
|
trans = self.db.transaction_begin()
|
||||||
self.db.remove_family(self.obj.handle, trans)
|
self.db.remove_family(self.obj.handle, trans)
|
||||||
|
Loading…
Reference in New Issue
Block a user