2007-01-30 Don Allingham <don@gramps-project.org>
* src/Editors/_EditFamily.py: catch family-delete signal svn: r8030
This commit is contained in:
parent
3bef6c0609
commit
60812d4e09
@ -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
|
||||
|
@ -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 ])
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user