2007-01-30 Don Allingham <don@gramps-project.org>

* src/Editors/_EditFamily.py: catch family-delete signal



svn: r8030
This commit is contained in:
Don Allingham 2007-02-03 04:51:52 +00:00
parent 30ac50668a
commit d3215c17a4
3 changed files with 18 additions and 7 deletions

View File

@ -10,6 +10,9 @@
2007-02-01 Alex Roitman <shura@gramps-project.org>
* src/plugins/ChangeNames.py: Typo.
2007-01-30 Don Allingham <don@gramps-project.org>
* src/Editors/_EditFamily.py: catch family-delete signal
2007-01-30 Brian Matherly <brian@gramps-project.org>
* src/docgen/ODFDoc.py: add start_superscript and stop_superscript
* src/docgen/KwordDoc.py: add start_superscript and stop_superscript

View File

@ -396,6 +396,8 @@ class EditFamily(EditPrimary):
self._add_db_signal('person-update', self.check_for_change)
self._add_db_signal('person-delete', self.check_for_change)
self._add_db_signal('person-rebuild', self.reload_people)
self._add_db_signal('family-update', self.check_for_family_change)
self._add_db_signal('family-delete', self.check_for_close)
self.added = self.obj.handle == None
if self.added:
@ -403,6 +405,13 @@ class EditFamily(EditPrimary):
self.load_data()
def check_for_close(self, handles):
if self.obj.get_handle() in handles:
self._do_close()
def check_for_change(self, handles):
print self.obj.get_handle() in handles
def check_for_change(self,handles):
chandles = set([ c.ref for c in self.obj.get_child_ref_list() if c ])

View File

@ -45,17 +45,16 @@ def delete_person_from_database(db, person, trans):
else:
family.set_mother_handle(None)
if not family.get_father_handle() and not family.get_mother_handle() and \
not family.get_child_ref_list():
if ( not family.get_father_handle() and not family.get_mother_handle() and
not family.get_child_ref_list()):
db.remove_family(family_handle, trans)
else:
db.commit_family(family, trans)
for family_handle in person.get_parent_family_handle_list():
if family_handle:
family = db.get_family_from_handle(family_handle)
family.remove_child_handle(person.get_handle())
db.commit_family(family, trans)
for family_handle in [fh for fh in person.get_parent_family_handle_list() if fh]:
family = db.get_family_from_handle(family_handle)
family.remove_child_handle(person.get_handle())
db.commit_family(family, trans)
handle = person.get_handle()