Handle single parent families on add parent switch

svn: r6207
This commit is contained in:
Don Allingham 2006-03-25 03:47:47 +00:00
parent 8c47f5d582
commit d426390f39
2 changed files with 25 additions and 6 deletions

View File

@ -1,4 +1,6 @@
2006-03-24 Don Allingham <don@gramps-project.org>
* src/Editors/_EditFamily.py: handle single parent families on
family switch with adding parents
* src/Editors/Makefile.am: added _EditRepoRef.py
* src/Editors/_EditRepoRef.py: Added

View File

@ -577,6 +577,7 @@ class EditFamily(EditPrimary):
def check_for_existing_family(self, father_handle, mother_handle,
family_handle):
if father_handle:
father = self.dbstate.db.get_person_from_handle(father_handle)
ffam = set(father.get_family_handle_list())
@ -602,12 +603,28 @@ class EditFamily(EditPrimary):
'in the database. If you save, you will create '
'a duplicate family.'))
else:
pass
else:
if mother_handle:
pass
else:
pass
for fh in father.get_family_handle_list():
fam = self.dbstate.db.get_family_from_handle(fh)
if fam.get_mother_handle() == None:
self.close_window()
try:
clist = self.obj.get_child_handle_list()
fam.add_child_handle(clist[-1])
EditFamily(self.dbstate,self.uistate,[],fam)
except Errors.WindowActiveError:
pass
elif mother_handle:
mother = self.dbstate.db.get_person_from_handle(mother_handle)
for fh in mother.get_family_handle_list():
fam = self.dbstate.db.get_family_from_handle(fh)
if fam.get_father_handle() == None:
self.close_window()
try:
clist = self.obj.get_child_handle_list()
fam.add_child_handle(clist[-1])
EditFamily(self.dbstate,self.uistate,[],fam)
except Errors.WindowActiveError:
pass
# def father_clicked(self,obj):