gender selection

svn: r6089
This commit is contained in:
Don Allingham 2006-03-06 05:32:36 +00:00
parent e93bff1a40
commit f540d7a4da

View File

@ -409,47 +409,48 @@ class EditPerson(EditPrimary):
error = False error = False
original = self.db.get_person_from_handle(self.obj.handle) original = self.db.get_person_from_handle(self.obj.handle)
(female,male,unknown) = _select_gender[self.obj.get_gender()] if original:
if male and original.get_gender() != RelLib.Person.MALE: (female,male,unknown) = _select_gender[self.obj.get_gender()]
for temp_family_handle in self.obj.get_family_handle_list(): if male and original.get_gender() != RelLib.Person.MALE:
temp_family = self.db.get_family_from_handle(temp_family_handle) for temp_family_handle in self.obj.get_family_handle_list():
if self.obj == temp_family.get_mother_handle(): temp_family = self.db.get_family_from_handle(temp_family_handle)
if temp_family.get_father_handle() != None: if self.obj == temp_family.get_mother_handle():
error = True if temp_family.get_father_handle() != None:
else: error = True
temp_family.set_mother_handle(None) else:
temp_family.set_father_handle(self.obj) temp_family.set_mother_handle(None)
elif female and original != RelLib.Person.FEMALE: temp_family.set_father_handle(self.obj)
for temp_family_handle in self.obj.get_family_handle_list(): elif female and original != RelLib.Person.FEMALE:
temp_family = self.db.get_family_from_handle(temp_family_handle) for temp_family_handle in self.obj.get_family_handle_list():
if self.obj == temp_family.get_father_handle(): temp_family = self.db.get_family_from_handle(temp_family_handle)
if temp_family.get_mother_handle() != None: if self.obj == temp_family.get_father_handle():
error = True if temp_family.get_mother_handle() != None:
else: error = True
temp_family.set_father_handle(None) else:
temp_family.set_mother_handle(self.obj) temp_family.set_father_handle(None)
elif unknown and original.get_gender() != RelLib.Person.UNKNOWN: temp_family.set_mother_handle(self.obj)
for temp_family_handle in self.obj.get_family_handle_list(): elif unknown and original.get_gender() != RelLib.Person.UNKNOWN:
temp_family = self.db.get_family_from_handle(temp_family_handle) for temp_family_handle in self.obj.get_family_handle_list():
if self.obj == temp_family.get_father_handle(): temp_family = self.db.get_family_from_handle(temp_family_handle)
if temp_family.get_mother_handle() != None: if self.obj == temp_family.get_father_handle():
error = True if temp_family.get_mother_handle() != None:
else: error = True
temp_family.set_father_handle(None) else:
temp_family.set_mother_handle(self.obj) temp_family.set_father_handle(None)
if self.obj == temp_family.get_mother_handle(): temp_family.set_mother_handle(self.obj)
if temp_family.get_father_handle() != None: if self.obj == temp_family.get_mother_handle():
error = True if temp_family.get_father_handle() != None:
else: error = True
temp_family.set_mother_handle(None) else:
temp_family.set_father_handle(self.obj) temp_family.set_mother_handle(None)
temp_family.set_father_handle(self.obj)
if error: if error:
msg2 = _("Problem changing the gender") msg2 = _("Problem changing the gender")
msg = _("Changing the gender caused problems " msg = _("Changing the gender caused problems "
"with marriage information.\nPlease check " "with marriage information.\nPlease check "
"the person's marriages.") "the person's marriages.")
ErrorDialog(msg) ErrorDialog(msg)
def save(self,*obj): def save(self,*obj):
""" """