Fix child relationship bugs with multiple languages, add support for new editing in marriage window.

svn: r271
This commit is contained in:
Don Allingham 2001-07-31 21:42:25 +00:00
parent 39fb3c0c43
commit 9aefc88779
13 changed files with 1930 additions and 1836 deletions

File diff suppressed because it is too large Load Diff

View File

@ -519,7 +519,6 @@ def on_name_list_select_row(obj,row,b,c):
epo.alt_given_field.set_text(name.getFirstName())
epo.alt_last_field.set_text(name.getSurname())
epo.alt_suffix_field.set_text(name.getSuffix())
epo.name_details_field.set_text(get_detail_text(name))
#-------------------------------------------------------------------------
@ -766,7 +765,6 @@ def on_event_add_clicked(obj):
def on_event_delete_clicked(obj):
epo = obj.get_data(EDITPERSON)
row = obj.get_data(INDEX)
if row < 0:
return
@ -1523,8 +1521,8 @@ def on_ok_clicked(obj):
#-------------------------------------------------------------------------
def on_browse_clicked(obj):
import gnome.url
path = obj.get_text()
path = obj.get()
if path != "":
gnome.url.show(path)
@ -1539,7 +1537,7 @@ class EventEditor:
def __init__(self,parent,event):
self.parent = parent
self.event = event
self.top = libglade.GladeXML(const.editPersonFile, "event_edit")
self.top = libglade.GladeXML(const.dialogFile, "event_edit")
self.window = self.top.get_widget("event_edit")
self.name_field = self.top.get_widget("eventName")
self.place_field = self.top.get_widget("eventPlace")
@ -1642,7 +1640,7 @@ class AttributeEditor:
def __init__(self,parent,attrib):
self.parent = parent
self.attrib = attrib
self.top = libglade.GladeXML(const.editPersonFile, "attr_edit")
self.top = libglade.GladeXML(const.dialogFile, "attr_edit")
self.window = self.top.get_widget("attr_edit")
self.type_field = self.top.get_widget("attr_type")
self.value_field = self.top.get_widget("attr_value")

View File

@ -434,10 +434,6 @@ class GrampsParser(handler.ContentHandler):
self.person.setBirth(self.event)
elif self.event_type == "Death":
self.person.setDeath(self.event)
elif self.event_type == "Marriage":
self.family.setMarriage(self.event)
elif self.event_type == "Divorce":
self.family.setDivorce(self.event)
elif self.person:
self.person.EventList.append(self.event)
else:
@ -798,7 +794,6 @@ class GrampsParser(handler.ContentHandler):
"bookmarks" : (None, None),
"child" : (start_child,None),
"childof" : (start_childof,None),
"childlist" : (None,None),
"city" : (None, stop_city),
"country" : (None, stop_country),
"created" : (start_created, None),

View File

@ -30,6 +30,7 @@ import gnome.mime
import libglade
import os
import intl
import Sources
_ = intl.gettext
@ -87,7 +88,6 @@ class Marriage:
"on_photolist_button_press_event" : on_photolist_button_press_event,
"on_addphoto_clicked" : on_add_photo_clicked,
"on_deletephoto_clicked" : on_delete_photo_clicked,
"on_event_note_clicked" : on_event_note_clicked,
"on_close_marriage_editor" : on_close_marriage_editor,
"destroy_passed_object" : utils.destroy_passed_object
})
@ -110,14 +110,19 @@ class Marriage:
self.attr_list = self.get_widget("attr_list")
self.attr_type = self.get_widget("attr_type")
self.attr_value = self.get_widget("attr_value")
self.event_details = self.get_widget("event_details")
self.attr_details_field = self.get_widget("attr_details")
self.event_list.set_column_visibility(3,Config.show_detail)
self.attr_list.set_column_visibility(2,Config.show_detail)
self.elist = family.getEventList()[:]
self.alist = family.getAttributeList()[:]
self.events_changed = 0
self.attr_changed = 0
# set initial data
mevent_list = self.get_widget("marriageEvent")
mevent_list.set_popdown_strings(const.marriageEvents)
self.name_field.set_text("")
self.load_images()
self.type_field.set_popdown_strings(const.familyRelations)
@ -130,10 +135,6 @@ class Marriage:
self.attr_list.set_data(MARRIAGE,self)
self.attr_list.set_data(INDEX,-1)
attr_names = self.get_widget("attr_combo")
attr_names.set_popdown_strings(const.personalAttributes)
attr_names.entry.set_text("")
# set notes data
self.notes_field.set_point(0)
self.notes_field.insert_defaults(family.getNote())
@ -143,6 +144,22 @@ class Marriage:
self.redraw_attr_list()
top_window.show()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def update_events(self):
self.family.setEventList(self.elist)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def update_attributes(self):
self.family.setAttributeList(self.alist)
#---------------------------------------------------------------------
#
# redraw_attr_list - redraws the attribute list for the person
@ -153,13 +170,8 @@ class Marriage:
self.attr_list.clear()
self.attr_index = 0
details = ""
for attr in self.family.getAttributeList():
if Config.show_detail:
if attr.getNote() != "":
detail = "N"
if attr.getSourceRef():
detail = detail + "S"
for attr in self.alist:
details = get_detail_flags(attr)
self.attr_list.append([const.display_fattr(attr.getType()),\
attr.getValue(),details])
self.attr_list.set_row_data(self.attr_index,attr)
@ -186,12 +198,7 @@ class Marriage:
def add_event(self,text,event):
if not event:
return
detail = ""
if Config.show_detail:
if event.getNote() != "":
detail = "N"
if event.getSourceRef():
detail = detail + "S"
detail = get_detail_flags(event)
self.event_list.append([text,event.getQuoteDate(),event.getPlace(),detail])
self.event_list.set_row_data(self.lines,event)
self.lines = self.lines + 1
@ -242,9 +249,7 @@ class Marriage:
self.event_list.freeze()
self.event_list.clear()
self.add_event(const.display_fevent("Marriage"),self.family.getMarriage())
self.add_event(const.display_fevent("Divorce"),self.family.getDivorce())
for event in self.family.getEventList():
for event in self.elist:
self.add_event(const.display_fevent(event.getName()),event)
current_row = self.event_list.get_data(INDEX)
@ -297,6 +302,14 @@ def on_close_marriage_editor(obj):
utils.destroy_passed_object(family_obj.get_widget("marriageEditor"))
family_obj.update_events()
if family_obj.events_changed:
utils.modified()
family_obj.update_events()
if family_obj.events_changed:
utils.modified()
#-------------------------------------------------------------------------
#
# on_add_clicked - creates a new event from the data displayed in the
@ -305,34 +318,7 @@ def on_close_marriage_editor(obj):
#
#-------------------------------------------------------------------------
def on_add_clicked(obj):
family_obj = obj.get_data(MARRIAGE)
date = family_obj.date_field.get_text()
place= family_obj.place_field.get_text()
name = family_obj.name_field.get_text()
desc = family_obj.descr_field.get_text()
if name == "Marriage":
if family_obj.family.getMarriage() == None:
event = Event()
family_obj.family.setMarriage(event)
else:
event = family_obj.family.getMarriage()
elif name == "Divorce":
if family_obj.family.getDivorce() == None:
event = Event()
family_obj.family.setDivorce(event)
else:
event = family_obj.family.getDivorce()
else:
event = Event()
family_obj.family.addEvent(event)
event.set(name,date,place,desc)
family_obj.redraw_events()
utils.modified()
editor = EventEditor(obj.get_data(MARRIAGE),None)
#-------------------------------------------------------------------------
#
@ -347,14 +333,7 @@ def on_update_clicked(obj):
family_obj = obj.get_data(MARRIAGE)
event = obj.get_row_data(row)
date = family_obj.date_field.get_text()
place= family_obj.place_field.get_text()
name = family_obj.name_field.get_text()
desc = family_obj.descr_field.get_text()
update_event(event,name,date,place,desc)
family_obj.redraw_events()
editor = EventEditor(family_obj,event)
#-------------------------------------------------------------------------
#
@ -369,27 +348,13 @@ def on_delete_clicked(obj):
if row < 0:
return
active_event = obj.get_row_data(row)
del family_obj.elist[row]
if active_event == family_obj.family.getMarriage():
family_obj.family.setMarriage(None)
elif active_event == family_obj.family.getDivorce():
family_obj.family.setDivorce(None)
else:
count = 0
list = family_obj.family.getEventList()
for event in list:
if event == active_event:
del list[count]
break
count = count + 1
if family_obj.lines == 1:
obj.set_data(INDEX,None)
elif row > family_obj.lines-1:
if row > len(family_obj.elist)-1:
obj.set_data(INDEX,row-1)
family_obj.redraw_events()
family_obj.events_changed = 1
utils.modified()
#-------------------------------------------------------------------------
@ -405,9 +370,44 @@ def on_select_row(obj,row,b,c):
family_obj.date_field.set_text(event.getDate())
family_obj.place_field.set_text(event.getPlace())
family_obj.name_field.set_text(const.display_fevent(event.getName()))
family_obj.name_field.set_label(const.display_fevent(event.getName()))
family_obj.event_details.set_text(get_detail_text(event))
family_obj.descr_field.set_text(event.getDescription())
#-------------------------------------------------------------------------
#
# update_attrib
#
# Updates the specified event with the specified date. Compares against
# the previous value, so the that modified flag is not set if nothing has
# actually changed.
#
#-------------------------------------------------------------------------
def update_attrib(attr,type,value,note,priv,conf):
changed = 0
if attr.getType() != const.save_pattr(type):
attr.setType(const.save_pattr(type))
changed = 1
if attr.getValue() != value:
attr.setValue(value)
changed = 1
if attr.getNote() != note:
attr.setNote(note)
changed = 1
if attr.getPrivacy() != priv:
attr.setPrivacy(priv)
changed = 1
if attr.getConfidence() != conf:
attr.setConfidence(conf)
changed = 1
return changed
#-------------------------------------------------------------------------
#
# update_event
@ -417,22 +417,37 @@ def on_select_row(obj,row,b,c):
# actually changed.
#
#-------------------------------------------------------------------------
def update_event(event,name,date,place,desc):
def update_event(event,name,date,place,desc,note,priv,conf):
changed = 0
if event.getPlace() != place:
event.setPlace(place)
utils.modified()
changed = 1
if event.getName() != const.save_fevent(name):
event.setName(const.save_fevent(name))
utils.modified()
if event.getName() != const.save_pevent(name):
event.setName(const.save_pevent(name))
changed = 1
if event.getDescription() != desc:
event.setDescription(desc)
utils.modified()
changed = 1
if event.getNote() != note:
event.setNote(note)
changed = 1
if event.getDate() != date:
event.setDate(date)
utils.modified()
changed = 1
if event.getPrivacy() != priv:
event.setPrivacy(priv)
changed = 1
if event.getConfidence() != conf:
event.setConfidence(conf)
changed = 1
return changed
#-------------------------------------------------------------------------
#
#
@ -625,49 +640,6 @@ def on_ok_clicked(obj):
on_apply_clicked(obj)
utils.destroy_passed_object(obj)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_event_note_clicked(obj):
row = obj.get_data(INDEX)
data = obj.get_row_data(row)
family_obj = obj.get_data(MARRIAGE)
if row >= 0:
editnote = libglade.GladeXML(const.editnoteFile,"editnote")
textobj = editnote.get_widget("notetext")
en_obj = editnote.get_widget("editnote")
en_obj.set_data("n",data)
en_obj.set_data("w",textobj)
textobj.set_point(0)
textobj.insert_defaults(data.getNote())
textobj.set_word_wrap(1)
editnote.signal_autoconnect({
"on_save_note_clicked" : on_save_note_clicked,
"destroy_passed_object" : utils.destroy_passed_object
})
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_save_note_clicked(obj):
textbox = obj.get_data("w")
data = obj.get_data("n")
text = textbox.get_chars(0,-1)
if text != data.getNote():
data.setNote(text)
utils.modified()
utils.destroy_passed_object(obj)
#-------------------------------------------------------------------------
#
# on_attr_list_select_row - sets the row object attached to the passed
@ -681,8 +653,9 @@ def on_attr_list_select_row(obj,row,b,c):
family_obj = obj.get_data(MARRIAGE)
attr = obj.get_row_data(row)
family_obj.attr_type.set_text(const.display_fattr(attr.getType()))
family_obj.attr_type.set_label(const.display_fattr(attr.getType()))
family_obj.attr_value.set_text(attr.getValue())
family_obj.attr_details_field.set_text(get_detail_text(attr))
#-------------------------------------------------------------------------
#
@ -693,13 +666,7 @@ def on_update_attr_clicked(obj):
row = obj.get_data(INDEX)
if row < 0:
return
family_obj = obj.get_data(MARRIAGE)
attr = obj.get_row_data(row)
attr.setType(const.save_fattr(family_obj.attr_type.get_text()))
attr.setValue(family_obj.attr_value.get_text())
family_obj.redraw_attr_list()
AttributeEditor(obj.get_data(MARRIAGE),obj.get_row_data(row))
#-------------------------------------------------------------------------
#
@ -712,10 +679,9 @@ def on_delete_attr_clicked(obj):
return
family_obj = obj.get_data(MARRIAGE)
list = family_obj.family.getAttributeList()
del list[row]
del family_obj.alist[row]
if row > len(list)-1:
if row > len(family_obj.alist)-1:
obj.set_data(INDEX,row-1)
family_obj.redraw_attr_list()
@ -727,18 +693,256 @@ def on_delete_attr_clicked(obj):
#
#-------------------------------------------------------------------------
def on_add_attr_clicked(obj):
family_obj = obj.get_data(MARRIAGE)
AttributeEditor(obj.get_data(MARRIAGE),None)
attr = Attribute()
name = family_obj.attr_type.get_text()
attr.setType(const.save_fattr(name))
attr.setValue(family_obj.attr_value.get_text())
#-------------------------------------------------------------------------
#
# EventEditor class
#
#-------------------------------------------------------------------------
class EventEditor:
if name not in const.familyAttributes:
const.familyAttributes.append(name)
menu = family_obj.get_widget("attr_combo")
menu.set_popdown_strings(const.familyAttributes)
def __init__(self,parent,event):
self.parent = parent
self.event = event
self.top = libglade.GladeXML(const.dialogFile, "event_edit")
self.window = self.top.get_widget("event_edit")
self.name_field = self.top.get_widget("eventName")
self.place_field = self.top.get_widget("eventPlace")
self.date_field = self.top.get_widget("eventDate")
self.descr_field = self.top.get_widget("eventDescription")
self.note_field = self.top.get_widget("eventNote")
self.event_menu = self.top.get_widget("personalEvents")
self.source_field = self.top.get_widget("event_source")
self.conf_menu = self.top.get_widget("conf")
self.priv = self.top.get_widget("priv")
family_obj.family.addAttribute(attr)
family_obj.redraw_attr_list()
utils.modified()
father = parent.family.getFather()
mother = parent.family.getMother()
if father and mother:
name = _("%s and %s") % (father.getPrimaryName().getName(),
mother.getPrimaryName().getName())
elif father:
name = father.getPrimaryName().getName()
else:
name = mother.getPrimaryName().getName()
self.top.get_widget("eventTitle").set_text(name)
self.event_menu.set_popdown_strings(const.marriageEvents)
myMenu = GtkMenu()
index = 0
for name in const.confidence:
item = GtkMenuItem(name)
item.set_data("a",index)
item.show()
myMenu.append(item)
index = index + 1
self.conf_menu.set_menu(myMenu)
if event != None:
self.name_field.set_text(event.getName())
self.place_field.set_text(event.getPlace())
self.date_field.set_text(event.getDate())
self.descr_field.set_text(event.getDescription())
self.conf_menu.set_history(event.getConfidence())
self.priv.set_active(event.getPrivacy())
srcref_base = self.event.getSourceRef().getBase()
if srcref_base:
self.source_field.set_text(srcref_base.getTitle())
else:
self.source_field.set_text("")
self.note_field.set_point(0)
self.note_field.insert_defaults(event.getNote())
self.note_field.set_word_wrap(1)
else:
self.conf_menu.set_history(2)
self.window.set_data("o",self)
self.top.signal_autoconnect({
"destroy_passed_object" : utils.destroy_passed_object,
"on_event_edit_ok_clicked" : on_event_edit_ok_clicked,
"on_source_clicked" : on_edit_source_clicked
})
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_edit_source_clicked(obj):
ee = obj.get_data("o")
Sources.SourceEditor(ee.event,ee.parent.db,ee.source_field)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_event_edit_ok_clicked(obj):
ee = obj.get_data("o")
event = ee.event
ename = ee.name_field.get_text()
edate = ee.date_field.get_text()
eplace = ee.place_field.get_text()
enote = ee.note_field.get_chars(0,-1)
edesc = ee.descr_field.get_text()
epriv = ee.priv.get_active()
econf = ee.conf_menu.get_menu().get_active().get_data("a")
if event == None:
event = Event()
ee.parent.elist.append(event)
if update_event(event,ename,edate,eplace,edesc,enote,epriv,econf):
ee.parent.events_changed = 1
ee.parent.redraw_events()
utils.destroy_passed_object(obj)
#-------------------------------------------------------------------------
#
# AttributeEditor class
#
#-------------------------------------------------------------------------
class AttributeEditor:
def __init__(self,parent,attrib):
self.parent = parent
self.attrib = attrib
self.top = libglade.GladeXML(const.dialogFile, "attr_edit")
self.window = self.top.get_widget("attr_edit")
self.type_field = self.top.get_widget("attr_type")
self.value_field = self.top.get_widget("attr_value")
self.note_field = self.top.get_widget("attr_note")
self.attrib_menu = self.top.get_widget("attr_menu")
self.source_field = self.top.get_widget("attr_source")
self.conf_menu = self.top.get_widget("conf")
self.priv = self.top.get_widget("priv")
father = parent.family.getFather()
mother = parent.family.getMother()
if father and mother:
name = _("%s and %s") % (father.getPrimaryName().getName(),
mother.getPrimaryName().getName())
elif father:
name = father.getPrimaryName().getName()
else:
name = mother.getPrimaryName().getName()
self.top.get_widget("attrTitle").set_text(_("Attribute Editor for %s") % name)
if len(const.familyAttributes) > 0:
self.attrib_menu.set_popdown_strings(const.familyAttributes)
myMenu = GtkMenu()
index = 0
for name in const.confidence:
item = GtkMenuItem(name)
item.set_data("a",index)
item.show()
myMenu.append(item)
index = index + 1
self.conf_menu.set_menu(myMenu)
if attrib != None:
self.type_field.set_text(attrib.getType())
self.value_field.set_text(attrib.getValue())
srcref_base = self.attrib.getSourceRef().getBase()
if srcref_base:
self.source_field.set_text(srcref_base.getTitle())
else:
self.source_field.set_text("")
self.conf_menu.set_history(attrib.getConfidence())
self.priv.set_active(attrib.getPrivacy())
self.note_field.set_point(0)
self.note_field.insert_defaults(attrib.getNote())
self.note_field.set_word_wrap(1)
else:
self.conf_menu.set_history(2)
self.window.set_data("o",self)
self.top.signal_autoconnect({
"destroy_passed_object" : utils.destroy_passed_object,
"on_attr_edit_ok_clicked" : on_attrib_edit_ok_clicked,
"on_source_clicked" : on_attrib_source_clicked
})
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_attrib_source_clicked(obj):
ee = obj.get_data("o")
Sources.SourceEditor(ee.attrib,ee.parent.db,ee.source_field)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_attrib_edit_ok_clicked(obj):
ee = obj.get_data("o")
attrib = ee.attrib
type = ee.type_field.get_text()
value = ee.value_field.get_text()
note = ee.note_field.get_chars(0,-1)
priv = ee.priv.get_active()
conf = ee.conf_menu.get_menu().get_active().get_data("a")
if attrib == None:
attrib = Attribute()
ee.parent.alist.append(attrib)
if update_attrib(attrib,type,value,note,priv,conf):
ee.parent.attr_changed = 1
ee.parent.redraw_attr_list()
utils.destroy_passed_object(obj)
#
#
#
#-------------------------------------------------------------------------
def get_detail_flags(obj):
detail = ""
if Config.show_detail:
if obj.getNote() != "":
detail = "N"
if obj.getSourceRef().getBase():
detail = detail + "S"
if obj.getPrivacy():
detail = detail + "P"
return detail
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def get_detail_text(obj):
if obj.getNote() != "":
details = _("Note")
else:
details = ""
if obj.getSourceRef().getBase() != None:
if details == "":
details = _("Source")
else:
details = "%s, %s" % (details,_("Source"))
if obj.getPrivacy() == 1:
if details == "":
details = _("Private")
else:
details = "%s, %s" % (details,_("Private"))
return details

View File

@ -766,6 +766,9 @@ class Family:
def getAttributeList(self) :
return self.attributeList
def setAttributeList(self,list) :
self.attributeList = list
def getNote(self):
return self.note.get()
@ -817,17 +820,17 @@ class Family:
def getChildList(self):
return self.Children
def setMarriage(self,event):
self.Marriage = event
def getMarriage(self):
return self.Marriage
def setDivorce(self,event):
self.Divorce = event
for e in self.EventList:
if e.getType == "Marriage":
return e
return None
def getDivorce(self):
return self.Divorce
for e in self.EventList:
if e.getType == "Divorce":
return e
return None
def addEvent(self,event) :
self.EventList.append(event)
@ -835,6 +838,9 @@ class Family:
def getEventList(self) :
return self.EventList
def setEventList(self,list) :
self.EventList = list
def addPhoto(self,photo):
self.photoList.append(photo)

View File

@ -264,103 +264,98 @@ def exportData(database, filename, callback):
g.write(" </researcher>\n")
g.write(" </header>\n")
g.write(" <people")
person = database.getDefaultPerson()
if person:
g.write(' default="%s"' % person.getId())
g.write(">\n")
if len(personList) > 0:
g.write(" <people")
person = database.getDefaultPerson()
if person:
g.write(' default="%s"' % person.getId())
g.write(">\n")
total = len(personList) + len(familyList)
delta = max(int(total/50),1)
total = len(personList) + len(familyList)
delta = max(int(total/50),1)
count = 0
for person in personList:
if count % delta == 0:
callback(float(count)/float(total))
count = count + 1
count = 0
for person in personList:
if count % delta == 0:
callback(float(count)/float(total))
count = count + 1
write_id(g,"person",person,2)
if person.getGender() == Person.male:
write_line(g,"gender","M",3)
else:
write_line(g,"gender","F",3)
dump_name(g,"name",person.getPrimaryName(),3)
for name in person.getAlternateNames():
dump_name(g,"aka",name,3)
write_id(g,"person",person,2)
if person.getGender() == Person.male:
write_line(g,"gender","M",3)
else:
write_line(g,"gender","F",3)
dump_name(g,"name",person.getPrimaryName(),3)
for name in person.getAlternateNames():
dump_name(g,"aka",name,3)
write_line(g,"uid",person.getPafUid(),3)
write_line(g,"nick",person.getNickName(),3)
dump_my_event(g,"Birth",person.getBirth(),3)
dump_my_event(g,"Death",person.getDeath(),3)
for event in person.getEventList():
dump_event(g,event,3)
write_line(g,"uid",person.getPafUid(),3)
write_line(g,"nick",person.getNickName(),3)
dump_my_event(g,"Birth",person.getBirth(),3)
dump_my_event(g,"Death",person.getDeath(),3)
for event in person.getEventList():
dump_event(g,event,3)
for photo in person.getPhotoList():
path = photo.getPath()
if os.path.dirname(path) == fileroot:
path = os.path.basename(path)
g.write(' <img src="%s"' % fix(path) )
g.write(' descrip="%s"' % fix(photo.getDescription()))
proplist = photo.getPropertyList()
if proplist:
for key in proplist.keys():
g.write(' %s="%s"' % (key,proplist[key]))
g.write("/>\n")
for photo in person.getPhotoList():
path = photo.getPath()
if os.path.dirname(path) == fileroot:
path = os.path.basename(path)
g.write(' <img src="%s"' % fix(path) )
g.write(' descrip="%s"' % fix(photo.getDescription()))
proplist = photo.getPropertyList()
if proplist:
for key in proplist.keys():
g.write(' %s="%s"' % (key,proplist[key]))
g.write("/>\n")
if len(person.getAddressList()) > 0:
g.write(" <addresses>\n")
for address in person.getAddressList():
g.write(' <address%s">\n' % conf_priv(address))
write_line(g,"date",address.getDateObj().getSaveDate(),5)
write_line(g,"street",address.getStreet(),5)
write_line(g,"city",address.getCity(),5)
write_line(g,"state",address.getState(),5)
write_line(g,"country",address.getCountry(),5)
write_line(g,"postal",address.getPostal(),5)
if address.getNote() != "":
writeNote(g,"note",address.getNote(),5)
dump_source_ref(g,address.getSourceRef(),5)
g.write(' </address>\n')
g.write(' </addresses>\n')
if len(person.getAddressList()) > 0:
for address in person.getAddressList():
g.write(' <address%s">\n' % conf_priv(address))
write_line(g,"date",address.getDateObj().getSaveDate(),5)
write_line(g,"street",address.getStreet(),5)
write_line(g,"city",address.getCity(),5)
write_line(g,"state",address.getState(),5)
write_line(g,"country",address.getCountry(),5)
write_line(g,"postal",address.getPostal(),5)
if address.getNote() != "":
writeNote(g,"note",address.getNote(),5)
dump_source_ref(g,address.getSourceRef(),5)
g.write(' </address>\n')
if len(person.getAttributeList()) > 0:
g.write(" <attributes>\n")
for attr in person.getAttributeList():
if attr.getSourceRef() or attr.getNote():
g.write(' <attribute%s>\n' % conf_priv(attr))
write_line(g,"attr_type",attr.getType(),5)
write_line(g,"attr_value",attr.getValue(),5)
dump_source_ref(g,attr.getSourceRef(),5)
writeNote(g,"note",attr.getNote(),5)
g.write(' </attribute>\n')
else:
g.write(' <attribute type="%s">' % attr.getType())
g.write(fix(attr.getValue()))
g.write('</attribute>\n')
g.write(' </attributes>\n')
if len(person.getAttributeList()) > 0:
for attr in person.getAttributeList():
if attr.getSourceRef() or attr.getNote():
g.write(' <attribute%s>\n' % conf_priv(attr))
write_line(g,"attr_type",attr.getType(),5)
write_line(g,"attr_value",attr.getValue(),5)
dump_source_ref(g,attr.getSourceRef(),5)
writeNote(g,"note",attr.getNote(),5)
g.write(' </attribute>\n')
else:
g.write(' <attribute type="%s">' % attr.getType())
g.write(fix(attr.getValue()))
g.write('</attribute>\n')
if len(person.getUrlList()) > 0:
g.write(" <urls>\n")
for url in person.getUrlList():
g.write(' <url priv="%d" href="%s"' % \
(url.getPrivacy(),url.get_path()))
if url.get_description() != "":
g.write(' description="' + url.get_description() + '"')
g.write('/>\n')
g.write(' </urls>\n')
if len(person.getUrlList()) > 0:
for url in person.getUrlList():
g.write(' <url priv="%d" href="%s"' % \
(url.getPrivacy(),url.get_path()))
if url.get_description() != "":
g.write(' description="' + url.get_description() + '"')
g.write('/>\n')
write_ref(g,"childof",person.getMainFamily(),3)
for alt in person.getAltFamilyList():
g.write(" <childof ref=\"%s\" mrel=\"%s\" frel=\"%s\"/>\n" % \
(alt[0].getId(), alt[1], alt[2]))
write_ref(g,"childof",person.getMainFamily(),3)
for alt in person.getAltFamilyList():
g.write(" <childof ref=\"%s\" mrel=\"%s\" frel=\"%s\"/>\n" % \
(alt[0].getId(), alt[1], alt[2]))
for family in person.getFamilyList():
write_ref(g,"parentin",family,3)
for family in person.getFamilyList():
write_ref(g,"parentin",family,3)
writeNote(g,"note",person.getNote(),3)
writeNote(g,"note",person.getNote(),3)
g.write(" </person>\n")
g.write(" </people>\n")
g.write(" </person>\n")
g.write(" </people>\n")
if len(familyList) > 0:
g.write(" <families>\n")
@ -374,8 +369,6 @@ def exportData(database, filename, callback):
write_ref(g,"father",family.getFather(),3)
write_ref(g,"mother",family.getMother(),3)
dump_event(g,family.getMarriage(),3)
dump_event(g,family.getDivorce(),3)
for event in family.getEventList():
dump_event(g,event,3)
@ -397,15 +390,13 @@ def exportData(database, filename, callback):
write_ref(g,"child",person,4)
g.write(" </childlist>\n")
if len(family.getAttributeList()) > 0:
g.write(" <attributes>\n")
for attr in family.getAttributeList():
g.write(' <attribute>\n')
g.write(' <attribute>\n')
write_line(g,"attr_type",attr.getType(),5)
write_line(g,"attr_value",attr.getValue(),5)
dump_source_ref(g,attr.getSourceRef(),5)
writeNote(g,"note",attr.getNote(),5)
g.write(' </attribute>\n')
g.write(' </attributes>\n')
g.write(' </attribute>\n')
writeNote(g,"note",family.getNote(),3)
g.write(" </family>\n")
g.write(" </families>\n")

View File

@ -63,6 +63,7 @@ pluginsFile = rootDir + os.sep + "plugins.glade"
editnoteFile = rootDir + os.sep + "editnote.glade"
configFile = rootDir + os.sep + "config.glade"
stylesFile = rootDir + os.sep + "styles.glade"
dialogFile = rootDir + os.sep + "dialog.glade"
pluginsDir = rootDir + os.sep + "plugins"
filtersDir = rootDir + os.sep + "filters"
dataDir = rootDir + os.sep + "data"
@ -110,6 +111,7 @@ childRelations = {
_("Adopted") : "Adopted",
_("Stepchild") : "Stepchild",
_("Unknown") : "Unknown",
_("Other") : "Other",
}
#-------------------------------------------------------------------------
@ -370,7 +372,8 @@ _fr_e2l = {
"Married" : _("Married"),
"Unmarried" : _("Unmarried"),
"Partners" : _("Partners"),
"Unknown" : _("Unknown")
"Unknown" : _("Unknown"),
"Other" : _("Other")
}
_fr_l2e = {}

1071
gramps/src/dialog.glade Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1743,7 +1743,7 @@
<last_modification_time>Thu, 21 Dec 2000 20:47:47 GMT</last_modification_time>
</signal>
<columns>6</columns>
<column_widths>210,60,50,150,75,50</column_widths>
<column_widths>210,60,85,150,75,50</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>

View File

@ -279,6 +279,9 @@ def on_add_child_clicked(obj):
mname = mother.getPrimaryName().getName()
childWindow.get_widget("mlabel").set_text(_("Relationship to %s") % mname)
childWindow.get_widget("mrel").set_text(_("Birth"))
childWindow.get_widget("frel").set_text(_("Birth"))
redraw_child_list(2)
selectChild.show()
@ -344,6 +347,8 @@ def on_add_new_child_clicked(obj):
newChildWindow.get_widget("childSurname").set_text(surname)
newChildWindow.get_widget("addChild").show()
newChildWindow.get_widget("mrel").set_text(_("Birth"))
newChildWindow.get_widget("frel").set_text(_("Birth"))
#-------------------------------------------------------------------------
#
@ -531,11 +536,11 @@ def on_prel_changed(obj):
fatherList.clear()
motherList.clear()
fatherList.append(["unknown",""])
fatherList.append(["Unknown",""])
fatherList.set_row_data(0,None)
fatherList.set_data("father_text",fatherName)
motherList.append(["unknown",""])
motherList.append(["Unknown",""])
motherList.set_row_data(0,None)
motherList.set_data("mother_text",motherName)
@ -1995,7 +2000,7 @@ def display_marriage(family):
child_list.sort(sort.by_birthdate)
attr = ""
for child in child_list:
status = _("unknown")
status = _("Unknown")
if child.getGender():
gender = const.male
else:
@ -2006,9 +2011,9 @@ def display_marriage(family):
for fam in child.getAltFamilyList():
if fam[0] == family:
if active_person == family.getFather():
status = "%s/%s" % (fam[2],fam[1])
status = "%s/%s" % (_(fam[2]),_(fam[1]))
else:
status = "%s/%s" % (fam[1],fam[2])
status = "%s/%s" % (_(fam[1]),_(fam[2]))
if Config.show_detail:
attr = ""

View File

@ -13,42 +13,30 @@
</project>
<widget>
<class>GnomeDialog</class>
<class>GtkDialog</class>
<name>marriageEditor</name>
<title>Gramps - Marriage Editor</title>
<title>Gramps - Marriage/Relationship Editor</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_CENTER</position>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<allow_shrink>True</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox5</name>
<width>550</width>
<child_name>Dialog:vbox</child_name>
<name>dialog-vbox6</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<spacing>0</spacing>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area5</name>
<width>400</width>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<class>GtkHBox</class>
<child_name>Dialog:action_area</child_name>
<name>dialog-action_area6</name>
<border_width>10</border_width>
<homogeneous>True</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
@ -57,17 +45,49 @@
</child>
<widget>
<class>GtkButton</class>
<name>button57</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_close_marriage_editor</handler>
<object>marriageEditor</object>
<last_modification_time>Thu, 24 May 2001 22:53:21 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
<class>GtkHButtonBox</class>
<name>hbuttonbox22</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkButton</class>
<name>button107</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_close_marriage_editor</handler>
<object>marriageEditor</object>
<last_modification_time>Tue, 31 Jul 2001 15:50:12 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button108</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>destroy_passed_object</handler>
<object>marriageEditor</object>
<last_modification_time>Tue, 31 Jul 2001 15:49:42 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
@ -200,13 +220,12 @@
<spacing>0</spacing>
<widget>
<class>GtkTable</class>
<name>table6</name>
<rows>4</rows>
<columns>3</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<class>GtkFrame</class>
<name>marriageEventName</name>
<border_width>5</border_width>
<label>No Events</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
@ -214,272 +233,221 @@
</child>
<widget>
<class>GtkLabel</class>
<name>label99</name>
<label>Date</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>marriageDate</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label100</name>
<label>Description</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label101</name>
<label>Place</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label98</name>
<label>Event Type</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>marriageEvent</name>
<value_in_list>False</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>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<class>GtkTable</class>
<name>table8</name>
<rows>4</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>marriageEventName</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<class>GtkLabel</class>
<name>label212</name>
<label>Date :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
<widget>
<class>GtkButton</class>
<name>event_source</name>
<tooltip>Select the source of the information</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_showsource_clicked</handler>
<object>marriageEventList</object>
<last_modification_time>Sun, 11 Feb 2001 22:58:04 GMT</last_modification_time>
</signal>
<label>Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<widget>
<class>GtkLabel</class>
<name>label213</name>
<label>Place :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>event_note</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_event_note_clicked</handler>
<object>marriageEventList</object>
<last_modification_time>Sat, 02 Jun 2001 18:53:55 GMT</last_modification_time>
</signal>
<label>Note</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<widget>
<class>GtkLabel</class>
<name>label214</name>
<label>Description :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>marriagePlace</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>3</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>marriageDate</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>marriageDescription</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>3</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>3</xpad>
<widget>
<class>GtkLabel</class>
<name>marriagePlace</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>marriageDescription</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label218</name>
<label>Details :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>event_details</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
@ -564,8 +532,8 @@
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>2</child_ipad_x>
<child_ipad_y>2</child_ipad_y>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>4</padding>
<expand>True</expand>
@ -598,7 +566,7 @@
<object>marriageEventList</object>
<last_modification_time>Sat, 25 Nov 2000 16:52:46 GMT</last_modification_time>
</signal>
<label>Update</label>
<label>Edit</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
@ -639,186 +607,130 @@
<spacing>0</spacing>
<widget>
<class>GtkTable</class>
<name>table7</name>
<rows>2</rows>
<columns>3</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<class>GtkFrame</class>
<name>attr_type</name>
<border_width>5</border_width>
<label>No Attributes</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<fill>False</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label204</name>
<label>Value</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>attr_value</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label207</name>
<label>Attribute</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>attr_combo</name>
<value_in_list>False</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>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<class>GtkTable</class>
<name>table9</name>
<rows>2</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>attr_type</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<class>GtkLabel</class>
<name>label220</name>
<label>Value :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
<widget>
<class>GtkButton</class>
<name>attr_source</name>
<tooltip>Select the source of the information</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_showsource_clicked</handler>
<object>attr_list</object>
<last_modification_time>Sun, 11 Feb 2001 22:58:04 GMT</last_modification_time>
</signal>
<label>Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<widget>
<class>GtkLabel</class>
<name>attr_value</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>attr_note</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_event_note_clicked</handler>
<object>attr_list</object>
<last_modification_time>Sat, 02 Jun 2001 18:54:33 GMT</last_modification_time>
</signal>
<label>Note</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<widget>
<class>GtkLabel</class>
<name>label222</name>
<label>Details :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>attr_details</name>
<label></label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
@ -898,8 +810,8 @@
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>2</child_ipad_x>
<child_ipad_y>2</child_ipad_y>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>4</padding>
<expand>False</expand>
@ -932,7 +844,7 @@
<object>attr_list</object>
<last_modification_time>Sat, 02 Jun 2001 18:59:40 GMT</last_modification_time>
</signal>
<label>Update</label>
<label>Edit</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
@ -1094,7 +1006,7 @@
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label201</name>
<label>Images</label>
<label>Gallery</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>

View File

@ -401,30 +401,6 @@ class Merge:
for event in src_family.getEventList():
tgt_family.addEvent(event)
# add mariage information
marriage = src_family.getMarriage()
if marriage:
other_marriage = tgt_family.getMarriage()
if other_marriage != None:
if other_marriage.getPlace() == "":
other_marriage.setPlace(marriage.getPlace())
if other_marriage.getDate() == "":
other_marriage.setDate(marriage.getDate())
else:
tgt_family.setMarriage(marriage)
# add divorce information
divorce = src_family.getDivorce()
if divorce != None:
other_divorce = tgt_family.getDivorce()
if other_divorce != None:
if other_divorce.getPlace() == "":
other_divorce.setPlace(divorce.getPlace())
if other_divorce.getDate() == "":
other_divorce.setDate(divorce.getDate())
else:
tgt_family.setDivorce(divorce)
# change parents of the family to point to the new
# family

View File

@ -495,20 +495,9 @@ class GedcomParser:
self.ignore_sub_junk(2)
elif matches[1] == "SOUR":
self.ignore_sub_junk(2)
elif matches[1] == "MARR":
event = Event()
event.setName("Marriage")
self.family.setMarriage(event)
self.parse_family_event(event,2)
elif matches[1] == "DIV":
event = Event()
event.setName("Divorce")
self.family.setDivorce(event)
self.parse_family_event(event,2)
elif matches[1] == "OBJE":
if matches[2] and matches[2][0] == '@':
self.barf(2)
# self.ignore_sub_junk(2)
else:
self.parse_family_object(2)
elif matches[1] == "NOTE":