From b470072cfb0a1e6d4547931ec29c2681e22bc9cd Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sat, 7 Jun 2003 16:48:10 +0000 Subject: [PATCH] * 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 --- src/AddSpouse.py | 14 ++++++++------ src/EditPerson.py | 3 +-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/AddSpouse.py b/src/AddSpouse.py index 7e588ea1c..09c8f9adf 100644 --- a/src/AddSpouse.py +++ b/src/AddSpouse.py @@ -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): """ diff --git a/src/EditPerson.py b/src/EditPerson.py index 243e34d51..b3607eb04 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -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())