* src/EditPerson.py: Allow a default gender to be specified if a new

person is being added
* src/AddSpouse.py: All EditPerson dialog instead of QuickAdd


svn: r1669
This commit is contained in:
Don Allingham 2003-06-07 16:48:10 +00:00
parent 782ee8b993
commit b470072cfb
2 changed files with 9 additions and 8 deletions

View File

@ -128,20 +128,22 @@ class AddSpouse:
Called when the spouse to be added does not exist, and needs
to be created and added to the database
"""
import QuickAdd
import EditPerson
relation = const.save_frel(self.relation_type.get_text())
if relation == "Partners":
if self.person.getGender() == RelLib.Person.male:
gen = "male"
gen = RelLib.Person.male
else:
gen = "female"
gen = RelLib.Person.female
elif self.person.getGender() == RelLib.Person.male:
gen = "female"
gen = RelLib.Person.female
else:
gen = "male"
gen = RelLib.Person.male
QuickAdd.QuickAdd(self.db,gen,self.update_list)
person = RelLib.Person()
person.setGender(gen)
EditPerson.EditPerson(person,self.db,self.update_list)
def update_list(self,person):
"""

View File

@ -72,7 +72,7 @@ pycode_tgts = [('url', 0, 0),
#-------------------------------------------------------------------------
class EditPerson:
def __init__(self,person,db,callback=None):
def __init__(self,person,db,callback=None,gender=RelLib.Person.female):
"""Creates an edit window. Associates a person with the window."""
self.person = person
self.original_id = person.getId()
@ -985,7 +985,6 @@ class EditPerson:
self.redraw_event_list()
def update_birth_death(self):
print "update"
self.bdate.set_text(self.birth.getDate())
self.bplace.set_text(self.birth.getPlaceName())
self.bdate_check.set_calendar(self.birth.getDateObj().get_calendar())