Started the support families with parents of the same sex.

svn: r247
This commit is contained in:
Don Allingham 2001-07-14 20:03:36 +00:00
parent a2e1fb1287
commit 7dc2d9f482
8 changed files with 230 additions and 38 deletions

View File

@ -1258,7 +1258,8 @@
<widget>
<class>GtkButton</class>
<name>button103</name>
<name>name_source</name>
<tooltip>Edit source information for the highlighted name</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -1286,7 +1287,8 @@
<widget>
<class>GtkButton</class>
<name>button104</name>
<name>name_note</name>
<tooltip>Edit note information for the highlighted name</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -1673,8 +1675,8 @@
<widget>
<class>GtkButton</class>
<name>button86</name>
<tooltip>Choose source information</tooltip>
<name>event_source</name>
<tooltip>Edit source information for the highlighted event</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -1702,7 +1704,8 @@
<widget>
<class>GtkButton</class>
<name>edit_note</name>
<name>event_note</name>
<tooltip>Edit note information for the highlighted event</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -2072,8 +2075,8 @@
<widget>
<class>GtkButton</class>
<name>button95</name>
<tooltip>Choose source information</tooltip>
<name>attr_source</name>
<tooltip>Edit source information for the highlighted attribute</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -2101,7 +2104,8 @@
<widget>
<class>GtkButton</class>
<name>button97</name>
<name>attr_note</name>
<tooltip>Edit note information for the highlighted attribute</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -2598,8 +2602,8 @@
<widget>
<class>GtkButton</class>
<name>button91</name>
<tooltip>Choose source information</tooltip>
<name>addr_source</name>
<tooltip>Edit source information for the highlighted address</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -2627,7 +2631,8 @@
<widget>
<class>GtkButton</class>
<name>button98</name>
<name>addr_note</name>
<tooltip>Edit note information for the highlighted address</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>

View File

@ -123,6 +123,14 @@ class EditPerson:
self.dplace = self.get_widget("deathPlace")
self.is_male = self.get_widget("genderMale")
self.is_female = self.get_widget("genderFemale")
self.event_note = self.get_widget("event_note")
self.event_source = self.get_widget("event_source")
self.addr_note = self.get_widget("addr_note")
self.addr_source = self.get_widget("addr_source")
self.attr_note = self.get_widget("attr_note")
self.attr_source = self.get_widget("attr_source")
self.name_note = self.get_widget("name_note")
self.name_source = self.get_widget("name_source")
self.selectedIcon = -1
@ -295,6 +303,11 @@ class EditPerson:
current_row = current_row - 1
self.name_list.select_row(current_row,0)
self.name_list.moveto(current_row,0)
self.name_note.set_sensitive(1)
self.name_source.set_sensitive(1)
else:
self.name_note.set_sensitive(0)
self.name_source.set_sensitive(0)
self.name_list.set_data(INDEX,current_row)
self.name_list.thaw()
@ -356,6 +369,11 @@ class EditPerson:
current_row = current_row - 1
self.attr_list.select_row(current_row,0)
self.attr_list.moveto(current_row,0)
self.attr_note.set_sensitive(1)
self.attr_source.set_sensitive(1)
else:
self.attr_note.set_sensitive(0)
self.attr_source.set_sensitive(0)
self.attr_list.set_data(INDEX,current_row)
self.attr_list.thaw()
@ -391,6 +409,11 @@ class EditPerson:
current_row = current_row - 1
self.address_list.select_row(current_row,0)
self.address_list.moveto(current_row,0)
self.addr_note.set_sensitive(1)
self.addr_source.set_sensitive(1)
else:
self.addr_note.set_sensitive(0)
self.addr_source.set_sensitive(0)
self.address_list.set_data(INDEX,current_row)
self.address_list.thaw()
@ -426,6 +449,12 @@ class EditPerson:
current_row = current_row - 1
self.event_list.select_row(current_row,0)
self.event_list.moveto(current_row,0)
self.event_note.set_sensitive(1)
self.event_source.set_sensitive(1)
else:
self.event_note.set_sensitive(0)
self.event_source.set_sensitive(0)
self.event_list.set_data(INDEX,current_row)
self.event_list.thaw()
@ -799,8 +828,8 @@ def on_event_add_clicked(obj):
if place not in const.places:
const.places.append(place)
const.places.sort()
edit_person_obj.get_widget("dp_place").set_popdown_strings(const.places)
edit_person_obj.get_widget("bp_place").set_popdown_strings(const.places)
edit_person_obj.get_widget("dp_combo").set_popdown_strings(const.places)
edit_person_obj.get_widget("bp_combo").set_popdown_strings(const.places)
edit_person_obj.get_widget("eventPlace_combo").set_popdown_strings(const.places)
edit_person_obj.person.addEvent(event)

View File

@ -279,7 +279,15 @@ def on_close_marriage_editor(obj):
relation = family_obj.type_field.entry.get_text()
if const.save_frel(relation) != family_obj.family.getRelationship():
family_obj.family.setRelationship(const.save_frel(relation))
father = family_obj.family.getFather()
mother = family_obj.family.getMother()
if father.getGender() == mother.getGender():
family_obj.family.setRelationship("Partners")
else:
val = const.save_frel(relation)
if val == "Partners":
val = "Unknown"
family_obj.family.setRelationship(val)
utils.modified()
text = family_obj.notes_field.get_chars(0,-1)

View File

@ -356,7 +356,7 @@ def save_fattr(st):
_fr_e2l = {
"Married" : _("Married"),
"Common Law" : _("Common Law"),
"Unmarried" : _("Unmarried"),
"Partners" : _("Partners"),
"Unknown" : _("Unknown")
}

View File

@ -2752,13 +2752,15 @@
<widget>
<class>GtkVBox</class>
<name>vbox11</name>
<width>400</width>
<height>400</height>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkLabel</class>
<name>spouseTitle</name>
<label>Choose Spouse</label>
<label>Choose Spouse/Partner</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
@ -2772,6 +2774,77 @@
</child>
</widget>
<widget>
<class>GtkHSeparator</class>
<name>hseparator18</name>
<child>
<padding>10</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox29</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label228</name>
<label>Relationship Type</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>10</xpad>
<ypad>10</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>rel_combo</name>
<value_in_list>True</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items></items>
<child>
<padding>10</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>rel_type</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_rel_type_changed</handler>
<last_modification_time>Sat, 14 Jul 2001 15:29:20 GMT</last_modification_time>
</signal>
<editable>False</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow9</name>
@ -2789,7 +2862,7 @@
<class>GtkCList</class>
<name>spouseList</name>
<width>350</width>
<height>200</height>
<height>400</height>
<can_focus>True</can_focus>
<signal>
<name>select_row</name>
@ -3103,7 +3176,7 @@
<widget>
<class>GtkLabel</class>
<name>label223</name>
<label>Relationship to Mother</label>
<label>Relationship to child</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
@ -3277,7 +3350,7 @@ Unknown
<widget>
<class>GtkLabel</class>
<name>label186</name>
<label>Relationship to Father</label>
<label>Relationship to child</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
@ -3452,7 +3525,7 @@ Unknown
<widget>
<class>GtkCList</class>
<name>addChild</name>
<width>370</width>
<width>450</width>
<height>200</height>
<can_focus>True</can_focus>
<signal>
@ -3466,7 +3539,7 @@ Unknown
<last_modification_time>Sat, 14 Jul 2001 02:02:37 GMT</last_modification_time>
</signal>
<columns>3</columns>
<column_widths>200,80,40</column_widths>
<column_widths>200,167,40</column_widths>
<selection_mode>GTK_SELECTION_MULTIPLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
@ -3548,7 +3621,7 @@ Unknown
<widget>
<class>GtkLabel</class>
<name>label220</name>
<name>mlabel</name>
<label>Relationship to Mother</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@ -3627,7 +3700,7 @@ Unknown
<widget>
<class>GtkLabel</class>
<name>label222</name>
<name>flabel</name>
<label>Relationship to Father</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@ -5029,7 +5102,7 @@ Unknown
<widget>
<class>GtkLabel</class>
<name>label192</name>
<name>mlabel</name>
<label>Relationship to Mother</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
@ -5234,7 +5307,7 @@ Unknown
<widget>
<class>GtkLabel</class>
<name>label217</name>
<name>flabel</name>
<label>Relationship to Father</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>

View File

@ -255,6 +255,17 @@ def on_add_child_clicked(obj):
selectChild = childWindow.get_widget("selectChild")
addChildList = childWindow.get_widget("addChild")
addChildList.set_column_visibility(1,Config.id_visible)
father = active_family.getFather()
if father != None:
fname = father.getPrimaryName().getName()
childWindow.get_widget("flabel").set_text(_("Relationship to %s") % fname)
mother = active_family.getMother()
if mother != None:
mname = mother.getPrimaryName().getName()
childWindow.get_widget("mlabel").set_text(_("Relationship to %s") % mname)
redraw_child_list(2)
selectChild.show()
@ -308,6 +319,16 @@ def on_add_new_child_clicked(obj):
else:
surname = ""
father = active_family.getFather()
if father != None:
fname = father.getPrimaryName().getName()
newChildWindow.get_widget("flabel").set_text(_("Relationship to %s") % fname)
mother = active_family.getMother()
if mother != None:
mname = mother.getPrimaryName().getName()
newChildWindow.get_widget("mlabel").set_text(_("Relationship to %s") % mname)
newChildWindow.get_widget("childSurname").set_text(surname)
newChildWindow.get_widget("addChild").show()
@ -382,7 +403,16 @@ def on_save_child_clicked(obj):
active_family.addChild(select_child)
mrel = const.childRelations[childWindow.get_widget("mrel").get_text()]
mother = active_family.getMother()
if mother and mother.getGender() != Person.female:
if mrel == "Birth":
mrel = "Unknown"
frel = const.childRelations[childWindow.get_widget("frel").get_text()]
father = active_family.getFather()
if father and father.getGender() != Person.male:
if frel == "Birth":
frel = "Unknown"
if mrel == "Birth" and frel == "Birth":
family = select_child.getMainFamily()
@ -931,13 +961,15 @@ def on_select_spouse_clicked(obj):
active_person.addFamily(family)
select_spouse.addFamily(family)
if active_person.getGender() == Person.male:
family.setFather(active_person)
if active_person == Person.male:
family.setMother(select_spouse)
family.setFather(active_person)
else:
family.setFather(select_spouse)
family.setMother(active_person)
family.setRelationship(const.save_frel(obj.get_data("d").get_text()))
select_spouse = None
utils.destroy_passed_object(obj)
@ -1051,26 +1083,51 @@ def on_editperson_clicked(obj):
def add_spouse():
spouseDialog = libglade.GladeXML(const.gladeFile, "spouseDialog")
spouseList = spouseDialog.get_widget("spouseList")
spouseDialog.get_widget("rel_combo").set_popdown_strings(const.familyRelations)
rel_type = spouseDialog.get_widget("rel_type")
rel_type.set_data("d",spouseList)
spouseDialog.get_widget("spouseDialog").set_data("d",rel_type)
spouseDialog.signal_autoconnect({
"on_spouseList_select_row" : on_spouseList_select_row,
"on_select_spouse_clicked" : on_select_spouse_clicked,
"on_rel_type_changed" : on_rel_type_changed,
"destroy_passed_object" : utils.destroy_passed_object
})
spouseList = spouseDialog.get_widget("spouseList")
rel_type.set_text(_("Unknown"))
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_rel_type_changed(obj):
nameList = database.getPersonMap().values()
nameList.sort(sort.by_last_name)
spouse_list = obj.get_data("d")
spouse_list.clear()
spouse_list.freeze()
text = obj.get_text()
gender = active_person.getGender()
if text == _("Partners"):
if gender == Person.male:
gender = Person.female
else:
gender = Person.male
index = 0
for person in nameList:
if person.getGender() == gender:
continue
spouseList.append([Config.nameof(person),birthday(person)])
spouseList.set_row_data(index,person)
spouse_list.append([person.getPrimaryName().getName(),birthday(person)])
spouse_list.set_row_data(index,person)
index = index + 1
spouse_list.thaw()
#-------------------------------------------------------------------------
#
@ -1636,6 +1693,9 @@ def load_family():
menuitem.show()
typeMenu.append(menuitem)
for fam in family_types:
if active_person == fam[0].getFather():
menuitem = GtkMenuItem("%s/%s" % (fam[1],fam[2]))
else:
menuitem = GtkMenuItem("%s/%s" % (fam[2],fam[1]))
menuitem.set_data("parents",fam[0])
menuitem.connect("activate",on_current_type_changed)
@ -1646,6 +1706,16 @@ def load_family():
else:
gtop.get_widget("childtype").hide()
fn = _("Father")
mn = _("Mother")
if active_parents and active_parents.getRelationship() == "Partners":
fn = _("Parent")
mn = _("Parent")
gtop.get_widget("editFather").children()[0].set_text(fn)
gtop.get_widget("editMother").children()[0].set_text(mn)
change_parents(active_parents)
if active_person:
@ -1769,6 +1839,8 @@ def load_tree():
tips = GtkTooltips()
for i in range(1,16):
pv[i].set_text(text[i])
pv[i].set_position(0)
if tip[i] != "":
tips.set_tip(pv[i],tip[i])
else:
@ -1849,7 +1921,10 @@ def display_marriage(family):
else:
for fam in child.getAltFamilyList():
if fam[0] == family:
if active_person == family.getFather():
status = "%s/%s" % (fam[2],fam[1])
else:
status = "%s/%s" % (fam[1],fam[2])
if Config.show_detail:
attr = ""

View File

@ -85,7 +85,7 @@
<widget>
<class>GtkLabel</class>
<name>marriageTitle</name>
<label>Marriage/Family Editor</label>
<label>Marriage/Relationship Editor</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
@ -379,7 +379,7 @@
<widget>
<class>GtkButton</class>
<name>marriageSource</name>
<name>event_source</name>
<tooltip>Select the source of the information</tooltip>
<can_focus>True</can_focus>
<signal>
@ -408,7 +408,7 @@
<widget>
<class>GtkButton</class>
<name>button107</name>
<name>event_note</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
@ -766,7 +766,7 @@
<widget>
<class>GtkButton</class>
<name>button102</name>
<name>attr_source</name>
<tooltip>Select the source of the information</tooltip>
<can_focus>True</can_focus>
<signal>
@ -795,7 +795,7 @@
<widget>
<class>GtkButton</class>
<name>button106</name>
<name>attr_note</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>

View File

@ -558,6 +558,8 @@ class GedcomParser:
self.parse_name(name,2)
elif matches[1] == "RIN" or matches[1] == "RFN":
pass
elif matches[1] == "_UID":
self.person.setPafUid(matches[2])
elif matches[1] == "AFN" or matches[1] == "CHAN":
self.ignore_sub_junk(2)
elif matches[1] == "ALIA":