Added default family relationship of marriage; enlarged default gramplet height

svn: r11516
This commit is contained in:
Doug Blank 2008-12-24 19:15:16 +00:00
parent ccbf7717c3
commit 2bf693729f

View File

@ -1202,8 +1202,6 @@ class QuickViewGramplet(Gramplet):
#(title, category, name, status) #(title, category, name, status)
list_option.add_item(item[2], item[0]) list_option.add_item(item[2], item[0])
# 1. add marriage as default relation type
class DataEntryGramplet(Gramplet): class DataEntryGramplet(Gramplet):
NO_REL = 0 NO_REL = 0
AS_PARENT = 1 AS_PARENT = 1
@ -1616,12 +1614,14 @@ class DataEntryGramplet(Gramplet):
if fam_wife_handle == None and person.get_gender() == gen.lib.Person.FEMALE: if fam_wife_handle == None and person.get_gender() == gen.lib.Person.FEMALE:
# add the person # add the person
family.set_mother_handle(person.get_handle()) family.set_mother_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
added = True added = True
break break
elif fam_husband_handle == None and person.get_gender() == gen.lib.Person.MALE: elif fam_husband_handle == None and person.get_gender() == gen.lib.Person.MALE:
# add the person # add the person
family.set_father_handle(person.get_handle()) family.set_father_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
added = True added = True
break break
@ -1634,6 +1634,7 @@ class DataEntryGramplet(Gramplet):
family.set_father_handle(person.get_handle()) family.set_father_handle(person.get_handle())
elif person.get_gender() == gen.lib.Person.FEMALE: elif person.get_gender() == gen.lib.Person.FEMALE:
family.set_mother_handle(person.get_handle()) family.set_mother_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
# add curent_person as child # add curent_person as child
childref = gen.lib.ChildRef() childref = gen.lib.ChildRef()
childref.set_reference_handle(current_person.get_handle()) childref.set_reference_handle(current_person.get_handle())
@ -1657,11 +1658,13 @@ class DataEntryGramplet(Gramplet):
if person.get_gender() == gen.lib.Person.FEMALE: if person.get_gender() == gen.lib.Person.FEMALE:
# add the person # add the person
family.set_mother_handle(person.get_handle()) family.set_mother_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
added = True added = True
break break
elif person.get_gender() == gen.lib.Person.UNKNOWN: elif person.get_gender() == gen.lib.Person.UNKNOWN:
family.set_mother_handle(person.get_handle()) family.set_mother_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.set_gender(gen.lib.Person.FEMALE) person.set_gender(gen.lib.Person.FEMALE)
self.de_widgets["NPGender"].set_active(gen.lib.Person.FEMALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.FEMALE)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
@ -1673,11 +1676,13 @@ class DataEntryGramplet(Gramplet):
if person.get_gender() == gen.lib.Person.MALE: if person.get_gender() == gen.lib.Person.MALE:
# add the person # add the person
family.set_father_handle(person.get_handle()) family.set_father_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
added = True added = True
break break
elif person.get_gender() == gen.lib.Person.UNKNOWN: elif person.get_gender() == gen.lib.Person.UNKNOWN:
family.set_father_handle(person.get_handle()) family.set_father_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
person.set_gender(gen.lib.Person.MALE) person.set_gender(gen.lib.Person.MALE)
self.de_widgets["NPGender"].set_active(gen.lib.Person.MALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.MALE)
@ -1696,6 +1701,7 @@ class DataEntryGramplet(Gramplet):
self.dbstate.db.add_family(family, self.trans) self.dbstate.db.add_family(family, self.trans)
family.set_father_handle(current_person.get_handle()) family.set_father_handle(current_person.get_handle())
family.set_mother_handle(person.get_handle()) family.set_mother_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.set_gender(gen.lib.Person.FEMALE) person.set_gender(gen.lib.Person.FEMALE)
self.de_widgets["NPGender"].set_active(gen.lib.Person.FEMALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.FEMALE)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
@ -1706,6 +1712,7 @@ class DataEntryGramplet(Gramplet):
self.dbstate.db.add_family(family, self.trans) self.dbstate.db.add_family(family, self.trans)
family.set_father_handle(person.get_handle()) family.set_father_handle(person.get_handle())
family.set_mother_handle(current_person.get_handle()) family.set_mother_handle(current_person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.set_gender(gen.lib.Person.MALE) person.set_gender(gen.lib.Person.MALE)
self.de_widgets["NPGender"].set_active(gen.lib.Person.MALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.MALE)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
@ -1717,6 +1724,7 @@ class DataEntryGramplet(Gramplet):
self.dbstate.db.add_family(family, self.trans) self.dbstate.db.add_family(family, self.trans)
family.set_father_handle(person.get_handle()) family.set_father_handle(person.get_handle())
family.set_mother_handle(current_person.get_handle()) family.set_mother_handle(current_person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
current_person.set_gender(gen.lib.Person.FEMALE) current_person.set_gender(gen.lib.Person.FEMALE)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
current_person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle())
@ -1730,6 +1738,7 @@ class DataEntryGramplet(Gramplet):
self.dbstate.db.add_family(family, self.trans) self.dbstate.db.add_family(family, self.trans)
family.set_father_handle(person.get_handle()) family.set_father_handle(person.get_handle())
family.set_mother_handle(current_person.get_handle()) family.set_mother_handle(current_person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
current_person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle())
self.dbstate.db.commit_family(family, self.trans) self.dbstate.db.commit_family(family, self.trans)
@ -1739,6 +1748,7 @@ class DataEntryGramplet(Gramplet):
self.dbstate.db.add_family(family, self.trans) self.dbstate.db.add_family(family, self.trans)
family.set_father_handle(current_person.get_handle()) family.set_father_handle(current_person.get_handle())
family.set_mother_handle(person.get_handle()) family.set_mother_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
current_person.set_gender(gen.lib.Person.MALE) current_person.set_gender(gen.lib.Person.MALE)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
current_person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle())
@ -1748,6 +1758,7 @@ class DataEntryGramplet(Gramplet):
self.dbstate.db.add_family(family, self.trans) self.dbstate.db.add_family(family, self.trans)
family.set_father_handle(current_person.get_handle()) family.set_father_handle(current_person.get_handle())
family.set_mother_handle(person.get_handle()) family.set_mother_handle(person.get_handle())
family.set_relationship(gen.lib.FamilyRelType.MARRIED)
person.add_family_handle(family.get_handle()) person.add_family_handle(family.get_handle())
current_person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle())
self.dbstate.db.commit_family(family, self.trans) self.dbstate.db.commit_family(family, self.trans)
@ -2002,7 +2013,7 @@ register(type="gramplet",
register(type="gramplet", register(type="gramplet",
name="Data Entry Gramplet", name="Data Entry Gramplet",
tname=_("Data Entry Gramplet"), tname=_("Data Entry Gramplet"),
height=350, height=375,
expand=False, expand=False,
content = DataEntryGramplet, content = DataEntryGramplet,
title=_("Data Entry"), title=_("Data Entry"),