Handle single parent families on add parent switch
svn: r6207
This commit is contained in:
parent
f2899fb596
commit
e9e42bcf75
@ -1,4 +1,6 @@
|
|||||||
2006-03-24 Don Allingham <don@gramps-project.org>
|
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/Makefile.am: added _EditRepoRef.py
|
||||||
* src/Editors/_EditRepoRef.py: Added
|
* src/Editors/_EditRepoRef.py: Added
|
||||||
|
|
||||||
|
@ -577,6 +577,7 @@ class EditFamily(EditPrimary):
|
|||||||
|
|
||||||
def check_for_existing_family(self, father_handle, mother_handle,
|
def check_for_existing_family(self, father_handle, mother_handle,
|
||||||
family_handle):
|
family_handle):
|
||||||
|
|
||||||
if father_handle:
|
if father_handle:
|
||||||
father = self.dbstate.db.get_person_from_handle(father_handle)
|
father = self.dbstate.db.get_person_from_handle(father_handle)
|
||||||
ffam = set(father.get_family_handle_list())
|
ffam = set(father.get_family_handle_list())
|
||||||
@ -602,12 +603,28 @@ class EditFamily(EditPrimary):
|
|||||||
'in the database. If you save, you will create '
|
'in the database. If you save, you will create '
|
||||||
'a duplicate family.'))
|
'a duplicate family.'))
|
||||||
else:
|
else:
|
||||||
pass
|
for fh in father.get_family_handle_list():
|
||||||
else:
|
fam = self.dbstate.db.get_family_from_handle(fh)
|
||||||
if mother_handle:
|
if fam.get_mother_handle() == None:
|
||||||
pass
|
self.close_window()
|
||||||
else:
|
try:
|
||||||
pass
|
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):
|
# def father_clicked(self,obj):
|
||||||
|
Loading…
Reference in New Issue
Block a user