Revision control support

svn: r442
This commit is contained in:
Don Allingham 2001-10-04 04:22:41 +00:00
parent df99e59206
commit 0bc491fbc1
17 changed files with 1566 additions and 827 deletions

View File

@ -1,3 +1,8 @@
Version 0.5.1post
* Support for QUAY on GEDCOM import.
* Confidence level moved to SourceReference instead of object
* Support for revision control
Version 0.5.1
* Bug fixes
* Allow gramps' ids to be edited

View File

@ -92,6 +92,7 @@ owner = Researcher()
prefsTop = None
autoload = 0
usetabs = 0
usevc = 0
uncompress = 0
show_detail = 0
hide_altnames = 0
@ -150,6 +151,7 @@ def loadConfig(call):
global autoload
global owner
global usetabs
global usevc
global uncompress
global id_visible
global id_edit
@ -172,6 +174,7 @@ def loadConfig(call):
_callback = call
lastfile = gnome.config.get_string("/gramps/data/LastFile")
usetabs = gnome.config.get_bool("/gramps/config/UseTabs")
usevc = gnome.config.get_bool("/gramps/config/UseVersionControl")
uncompress = gnome.config.get_bool("/gramps/config/DontCompressXML")
id_visible = gnome.config.get_bool("/gramps/config/IdVisible")
id_edit = gnome.config.get_bool("/gramps/config/IdEdit")
@ -243,6 +246,8 @@ def loadConfig(call):
autoload = 1
if usetabs == None:
usetabs = 0
if usevc == None:
usevc = 0
if uncompress == None:
uncompress = 0
if id_visible == None:
@ -348,6 +353,7 @@ def on_propertybox_apply(obj,page):
global nameof
global owner
global usetabs
global usevc
global uncompress
global id_visible
global id_edit
@ -370,6 +376,7 @@ def on_propertybox_apply(obj,page):
display_attr = prefsTop.get_widget("attr_display").get_active()
attr_name = string.strip(prefsTop.get_widget("attr_name").get_text())
usetabs = prefsTop.get_widget("usetabs").get_active()
usevc = prefsTop.get_widget("use_vc").get_active()
uncompress = prefsTop.get_widget("uncompress").get_active()
id_visible = prefsTop.get_widget("gid_visible").get_active()
id_edit = prefsTop.get_widget("gid_edit").get_active()
@ -400,6 +407,7 @@ def on_propertybox_apply(obj,page):
output_preference = output_obj.get_data(DATA)
gnome.config.set_bool("/gramps/config/UseTabs",usetabs)
gnome.config.set_bool("/gramps/config/UseVersionControl",usevc)
gnome.config.set_bool("/gramps/config/DontCompressXML",uncompress)
gnome.config.set_bool("/gramps/config/IdVisible",id_visible)
gnome.config.set_bool("/gramps/config/IdEdit",id_edit)
@ -542,6 +550,7 @@ def display_preferences_box():
vis = prefsTop.get_widget("gid_visible")
idedit = prefsTop.get_widget("gid_edit")
tabs = prefsTop.get_widget("usetabs")
vc = prefsTop.get_widget("use_vc")
compress = prefsTop.get_widget("uncompress")
detail = prefsTop.get_widget("showdetail")
display_attr_obj = prefsTop.get_widget("attr_display")
@ -549,6 +558,7 @@ def display_preferences_box():
auto.set_active(autoload)
detail.set_active(show_detail)
tabs.set_active(usetabs)
vc.set_active(usevc)
compress.set_active(uncompress)
vis.set_active(id_visible)
idedit.set_active(id_edit)

File diff suppressed because it is too large Load Diff

View File

@ -67,7 +67,6 @@ _DEFHTTP = "http://gramps.sourceforge.net"
INDEX = "i"
EDITPERSON = "p"
OBJECT = "o"
MENUVAL = "a"
PHOTO = "p"
TEXT = "t"
NOTEOBJ = "n"
@ -101,6 +100,7 @@ class EditPerson:
self.notes_field = self.get_widget("personNotes")
self.event_name_field = self.get_widget("eventName")
self.event_place_field = self.get_widget("eventPlace")
self.event_cause_field = self.get_widget("eventCause")
self.event_date_field = self.get_widget("eventDate")
self.event_descr_field = self.get_widget("eventDescription")
self.event_details_field = self.get_widget("event_details")
@ -137,8 +137,7 @@ class EditPerson:
self.title = self.get_widget("title")
self.bdate = self.get_widget("birthDate")
self.bplace = self.get_widget("birthPlace")
self.bpcombo = self.get_widget("bp_combo")
self.dpcombo = self.get_widget("dp_combo")
self.dcause = self.get_widget("deathCause")
self.ddate = self.get_widget("deathDate")
self.dplace = self.get_widget("deathPlace")
self.is_male = self.get_widget("genderMale")
@ -173,6 +172,7 @@ class EditPerson:
self.window.editable_enters(self.bplace);
self.window.editable_enters(self.ddate);
self.window.editable_enters(self.dplace);
self.window.editable_enters(self.dcause);
self.top.signal_autoconnect({
"destroy_passed_object" : on_cancel_edit,
@ -186,10 +186,8 @@ class EditPerson:
"on_aka_update_clicked" : on_aka_update_clicked,
"on_apply_person_clicked" : on_apply_person_clicked,
"on_attr_list_select_row" : on_attr_list_select_row,
"on_birth_note_clicked" : on_birth_note_clicked,
"on_birth_source_clicked" : on_birth_source_clicked,
"on_death_note_clicked" : on_death_note_clicked,
"on_death_source_clicked" : on_death_source_clicked,
"on_edit_birth_clicked" : on_edit_birth_clicked,
"on_edit_death_clicked" : on_edit_death_clicked,
"on_delete_address_clicked" : on_delete_addr_clicked,
"on_delete_attr_clicked" : on_delete_attr_clicked,
"on_delete_event" : on_delete_event,
@ -224,11 +222,6 @@ class EditPerson:
self.attr_list.set_column_visibility(2,Config.show_detail)
self.addr_list.set_column_visibility(2,Config.show_detail)
plist = self.db.getPlaceMap().values()
if len(plist) > 0:
utils.attach_places(plist,self.dpcombo,self.death.getPlace())
utils.attach_places(plist,self.bpcombo,self.birth.getPlace())
if Config.display_attr:
self.get_widget("user_label").set_text(Config.attr_name)
val = ""
@ -257,10 +250,7 @@ class EditPerson:
self.nick.set_text(person.getNickName())
self.title.set_text(self.pname.getTitle())
self.bdate.set_text(self.birth.getDate())
self.bplace.set_text(self.birth.getPlaceName())
self.ddate.set_text(self.death.getDate())
self.dplace.set_text(self.death.getPlaceName())
self.update_birth_death()
# load photos into the photo window
photo_list = person.getPhotoList()
@ -330,22 +320,27 @@ class EditPerson:
def redraw_attr_list(self):
utils.redraw_list(self.alist,self.attr_list,disp_attr)
#---------------------------------------------------------------------
#
# redraw_addr_list - redraws the address list for the person
#
#---------------------------------------------------------------------
def redraw_addr_list(self):
"""redraws the address list for the person"""
utils.redraw_list(self.plist,self.addr_list,disp_addr)
#---------------------------------------------------------------------
#
# redraw_event_list - redraws the event list for the person
#
#---------------------------------------------------------------------
def redraw_event_list(self):
"""redraws the event list for the person"""
utils.redraw_list(self.elist,self.event_list,disp_event)
def update_birth_death(self):
self.bdate.set_text(self.birth.getDate())
self.bplace.set_text(self.birth.getPlaceName())
self.ddate.set_text(self.death.getDate())
self.dplace.set_text(self.death.getPlaceName())
self.dplace.set_text(self.death.getPlaceName())
self.dcause.set_text(self.death.getCause())
self.bdate.set_position(0)
self.ddate.set_position(0)
self.bplace.set_position(0)
self.dplace.set_position(0)
self.dcause.set_position(0)
#-------------------------------------------------------------------------
#
# add_thumbnail - Scale the image and add it to the IconList.
@ -486,22 +481,9 @@ def did_data_change(obj):
if not epo.pname.getSourceRef().are_equal(name.getSourceRef()):
changed = 1
epo.birth.setDate(bdate)
bplace_obj = utils.get_place_from_list(epo.bpcombo)
if bplace_obj == None and bplace != "":
changed = 1
epo.birth.setPlace(bplace_obj)
if not epo.birth.are_equal(epo.person.getBirth()):
changed = 1
epo.death.setDate(ddate)
dplace_obj = utils.get_place_from_list(epo.dpcombo)
if dplace_obj == None and dplace != "":
changed = 1
epo.death.setPlace(dplace_obj)
if not epo.death.are_equal(epo.person.getDeath()):
changed = 1
@ -788,6 +770,14 @@ def on_add_addr_clicked(obj):
def on_event_add_clicked(obj):
EventEditor(obj.get_data(EDITPERSON),None)
def on_edit_birth_clicked(obj):
person = obj.get_data(EDITPERSON)
EventEditor(person,person.birth)
def on_edit_death_clicked(obj):
person = obj.get_data(EDITPERSON)
EventEditor(person,person.death)
#-------------------------------------------------------------------------
#
# on_event_update_clicked
@ -817,6 +807,7 @@ def on_event_select_row(obj,row,b,c):
epo.event_date_field.set_text(event.getDate())
epo.event_place_field.set_text(event.getPlaceName())
epo.event_name_field.set_label(const.display_pevent(event.getName()))
epo.event_cause_field.set_text(event.getCause())
epo.event_descr_field.set_text(event.getDescription())
epo.event_details_field.set_text(utils.get_detail_text(event))
@ -882,7 +873,7 @@ def on_primary_photo_clicked(obj):
# actually changed.
#
#-------------------------------------------------------------------------
def update_event(event,name,date,place,desc,note,priv,conf):
def update_event(event,name,date,place,desc,note,priv,cause):
changed = 0
if event.getPlace() != place:
@ -905,12 +896,12 @@ def update_event(event,name,date,place,desc,note,priv,conf):
event.setDate(date)
changed = 1
if event.getPrivacy() != priv:
event.setPrivacy(priv)
if event.getCause() != cause:
event.setCause(cause)
changed = 1
if event.getConfidence() != conf:
event.setConfidence(conf)
if event.getPrivacy() != priv:
event.setPrivacy(priv)
changed = 1
return changed
@ -924,7 +915,7 @@ def update_event(event,name,date,place,desc,note,priv,conf):
# actually changed.
#
#-------------------------------------------------------------------------
def update_address(addr,date,street,city,state,country,postal,note,priv,conf):
def update_address(addr,date,street,city,state,country,postal,note,priv):
changed = 0
d = Date()
@ -961,10 +952,6 @@ def update_address(addr,date,street,city,state,country,postal,note,priv,conf):
addr.setPrivacy(priv)
changed = 1
if addr.getConfidence() != conf:
addr.setConfidence(conf)
changed = 1
return changed
#-------------------------------------------------------------------------
@ -976,7 +963,7 @@ def update_address(addr,date,street,city,state,country,postal,note,priv,conf):
# actually changed.
#
#-------------------------------------------------------------------------
def update_attrib(attr,type,value,note,priv,conf):
def update_attrib(attr,type,value,note,priv):
changed = 0
if attr.getType() != const.save_pattr(type):
@ -995,10 +982,6 @@ def update_attrib(attr,type,value,note,priv,conf):
attr.setPrivacy(priv)
changed = 1
if attr.getConfidence() != conf:
attr.setConfidence(conf)
changed = 1
return changed
#-------------------------------------------------------------------------
@ -1036,7 +1019,7 @@ def update_url(url,des,addr,priv):
# actually changed.
#
#-------------------------------------------------------------------------
def update_name(name,first,last,suffix,note,priv,conf):
def update_name(name,first,last,suffix,note,priv):
changed = 0
if name.getFirstName() != first:
@ -1062,10 +1045,6 @@ def update_name(name,first,last,suffix,note,priv,conf):
name.setPrivacy(priv)
changed = 1
if name.getConfidence() != conf:
name.setConfidence(conf)
changed = 1
return changed
#-------------------------------------------------------------------------
@ -1174,23 +1153,11 @@ def save_person(obj):
epo.birth.setDate(epo.bdate.get_text())
p1 = utils.get_place_from_list(epo.bpcombo)
if p1 == None and bplace != "":
p1 = Place()
p1.set_title(bplace)
epo.db.addPlace(p1)
epo.birth.setPlace(p1)
if not person.getBirth().are_equal(epo.birth):
person.setBirth(epo.birth)
epo.death.setDate(epo.ddate.get_text())
p2 = utils.get_place_from_list(epo.dpcombo)
if p2 == None and dplace != "":
p2 = Place()
p2.set_title(dplace)
epo.db.addPlace(p2)
epo.death.setPlace(p2)
if not person.getDeath().are_equal(epo.death):
person.setDeath(epo.death)
@ -1489,11 +1456,11 @@ class EventEditor:
self.place_field = self.top.get_widget("eventPlace")
self.place_combo = self.top.get_widget("eventPlace_combo")
self.date_field = self.top.get_widget("eventDate")
self.cause_field = self.top.get_widget("eventCause")
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")
name = parent.person.getPrimaryName().getName()
@ -1505,10 +1472,9 @@ class EventEditor:
self.window.editable_enters(self.name_field);
self.window.editable_enters(self.place_field);
self.window.editable_enters(self.date_field);
self.window.editable_enters(self.cause_field);
self.window.editable_enters(self.descr_field);
utils.build_confidence_menu(self.conf_menu)
values = self.parent.db.getPlaceMap().values()
if event != None:
self.name_field.set_text(event.getName())
@ -1516,9 +1482,8 @@ class EventEditor:
utils.attach_places(values,self.place_combo,event.getPlace())
self.place_field.set_text(event.getPlaceName())
self.date_field.set_text(event.getDate())
self.cause_field.set_text(event.getCause())
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()
@ -1532,7 +1497,6 @@ class EventEditor:
self.note_field.set_word_wrap(1)
else:
utils.attach_places(values,self.place_combo,None)
self.conf_menu.set_history(2)
self.window.set_data(OBJECT,self)
self.top.signal_autoconnect({
@ -1561,12 +1525,12 @@ def on_event_edit_ok_clicked(obj):
ename = ee.name_field.get_text()
edate = ee.date_field.get_text()
ecause = ee.cause_field.get_text()
eplace = string.strip(ee.place_field.get_text())
eplace_obj = utils.get_place_from_list(ee.place_combo)
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(MENUVAL)
if event == None:
event = Event()
@ -1577,7 +1541,7 @@ def on_event_edit_ok_clicked(obj):
eplace_obj.set_title(eplace)
ee.parent.db.addPlace(eplace_obj)
if update_event(event,ename,edate,eplace_obj,edesc,enote,epriv,econf):
if update_event(event,ename,edate,eplace_obj,edesc,enote,epriv,ecause):
ee.parent.lists_changed = 1
if not event.getSourceRef().are_equal(ee.srcref):
@ -1585,6 +1549,7 @@ def on_event_edit_ok_clicked(obj):
ee.parent.lists_changed = 1
ee.parent.redraw_event_list()
ee.parent.update_birth_death()
utils.destroy_passed_object(obj)
#-------------------------------------------------------------------------
@ -1604,7 +1569,6 @@ class AttributeEditor:
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")
if self.attrib:
self.srcref = SourceRef(self.attrib.getSourceRef())
@ -1620,16 +1584,6 @@ class AttributeEditor:
self.top.get_widget("attrTitle").set_text(_("Attribute Editor for %s") % name)
self.attrib_menu.set_popdown_strings(const.personalAttributes)
myMenu = GtkMenu()
index = 0
for name in const.confidence:
item = GtkMenuItem(name)
item.set_data(MENUVAL,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())
@ -1638,16 +1592,11 @@ class AttributeEditor:
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(OBJECT,self)
self.top.signal_autoconnect({
@ -1678,13 +1627,12 @@ def on_attrib_edit_ok_clicked(obj):
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(MENUVAL)
if attrib == None:
attrib = Attribute()
ee.parent.alist.append(attrib)
if update_attrib(attrib,type,value,note,priv,conf):
if update_attrib(attrib,type,value,note,priv):
ee.parent.lists_changed = 1
if not attrib.getSourceRef().are_equal(ee.srcref):
@ -1712,7 +1660,6 @@ class NameEditor:
self.note_field = self.top.get_widget("alt_note")
self.source_field = self.top.get_widget("alt_source")
self.top.get_widget("alt_surname_list").set_popdown_strings(const.surnames)
self.conf_menu = self.top.get_widget("conf")
self.priv = self.top.get_widget("priv")
if self.name:
self.srcref = SourceRef(self.name.getSourceRef())
@ -1729,8 +1676,6 @@ class NameEditor:
self.window.editable_enters(self.surname_field);
self.window.editable_enters(self.suffix_field);
utils.build_confidence_menu(self.conf_menu)
if name != None:
self.given_field.set_text(name.getFirstName())
self.surname_field.set_text(name.getSurname())
@ -1740,13 +1685,10 @@ class NameEditor:
self.source_field.set_text(srcref_base.getTitle())
else:
self.source_field.set_text("")
self.conf_menu.set_history(name.getConfidence())
self.priv.set_active(name.getPrivacy())
self.note_field.set_point(0)
self.note_field.insert_defaults(name.getNote())
self.note_field.set_word_wrap(1)
else:
self.conf_menu.set_history(2)
self.window.set_data(OBJECT,self)
self.top.signal_autoconnect({
@ -1778,13 +1720,12 @@ def on_name_edit_ok_clicked(obj):
suffix = ee.suffix_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(MENUVAL)
if name == None:
name = Name()
ee.parent.nlist.append(name)
if update_name(name,first,last,suffix,note,priv,conf):
if update_name(name,first,last,suffix,note,priv):
ee.parent.lists_changed = 1
if not name.getSourceRef().are_equal(ee.srcref):
@ -1814,7 +1755,6 @@ class AddressEditor:
self.postal = self.top.get_widget("postal")
self.note_field = self.top.get_widget("addr_note")
self.source_field = self.top.get_widget("addr_source")
self.conf_menu = self.top.get_widget("conf")
self.priv = self.top.get_widget("priv")
if self.addr:
self.srcref = SourceRef(self.addr.getSourceRef())
@ -1835,8 +1775,6 @@ class AddressEditor:
self.window.editable_enters(self.source_field);
self.window.editable_enters(self.note_field);
utils.build_confidence_menu(self.conf_menu)
if addr != None:
self.street.set_text(addr.getStreet())
self.city.set_text(addr.getCity())
@ -1849,13 +1787,10 @@ class AddressEditor:
else:
self.source_field.set_text("")
self.conf_menu.set_history(addr.getConfidence())
self.priv.set_active(addr.getPrivacy())
self.note_field.set_point(0)
self.note_field.insert_defaults(addr.getNote())
self.note_field.set_word_wrap(1)
else:
self.conf_menu.set_history(2)
self.window.set_data(OBJECT,self)
self.top.signal_autoconnect({
@ -1890,13 +1825,12 @@ def on_addr_edit_ok_clicked(obj):
postal = ee.postal.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(MENUVAL)
if addr == None:
addr = Address()
ee.parent.plist.append(addr)
if update_address(addr,date,street,city,state,country,postal,note,priv,conf):
if update_address(addr,date,street,city,state,country,postal,note,priv):
ee.parent.lists_changed = 1
if not addr.getSourceRef().are_equal(ee.srcref):

View File

@ -77,6 +77,7 @@ class GrampsParser(handler.ContentHandler):
self.scomments_list = []
self.note_list = []
self.tlist = []
self.conf = 2
self.use_p = 0
self.in_note = 0
@ -205,7 +206,9 @@ class GrampsParser(handler.ContentHandler):
self.event = Event()
self.event_type = u2l(attrs["type"])
if attrs.has_key("conf"):
self.event.confidence = int(attrs["conf"])
self.conf = int(attrs["conf"])
else:
self.conf = 2
if attrs.has_key("priv"):
self.event.private = int(attrs["priv"])
@ -217,7 +220,9 @@ class GrampsParser(handler.ContentHandler):
def start_attribute(self,attrs):
self.attribute = Attribute()
if attrs.has_key("conf"):
self.attribute.confidence = int(attrs["conf"])
self.conf = int(attrs["conf"])
else:
self.conf = 2
if attrs.has_key("priv"):
self.attribute.privacy = int(attrs["priv"])
if attrs.has_key('type'):
@ -239,7 +244,9 @@ class GrampsParser(handler.ContentHandler):
self.address = Address()
self.person.addAddress(self.address)
if attrs.has_key("conf"):
self.address.confidence = int(attrs["conf"])
self.conf = int(attrs["conf"])
else:
self.conf = 2
if attrs.has_key("priv"):
self.address.private = int(attrs["priv"])
@ -379,7 +386,9 @@ class GrampsParser(handler.ContentHandler):
def start_name(self,attrs):
self.name = Name()
if attrs.has_key("conf"):
self.name.confidence = int(attrs["conf"])
self.conf = int(attrs["conf"])
else:
self.conf = 2
if attrs.has_key("priv"):
self.name.private = int(attrs["priv"])
@ -399,6 +408,10 @@ class GrampsParser(handler.ContentHandler):
def start_sourceref(self,attrs):
self.source_ref = SourceRef()
source = self.db.findSourceNoMap(u2l(attrs["ref"]))
if attrs.has_key("conf"):
self.source_ref.confidence = int(u2l(attrs["conf"]))
else:
self.source_ref.confidence = self.conf
self.source_ref.setBase(source)
if self.event:
self.event.setSourceRef(self.source_ref)
@ -611,6 +624,14 @@ class GrampsParser(handler.ContentHandler):
def stop_description(self,tag):
self.event.setDescription(u2l(tag))
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def stop_cause(self,tag):
self.event.setCause(u2l(tag))
#---------------------------------------------------------------------
#
#
@ -906,6 +927,7 @@ class GrampsParser(handler.ContentHandler):
"created" : (start_created, None),
"database" : (None, None),
"date" : (None, stop_date),
"cause" : (None, stop_cause),
"description": (None, stop_description),
"event" : (start_event, stop_event),
"families" : (None, stop_families),

View File

@ -103,6 +103,7 @@ class Marriage:
# widgets
self.date_field = self.get_widget("marriageDate")
self.place_field = self.get_widget("marriagePlace")
self.cause_field = self.get_widget("marriageCause")
self.name_field = self.get_widget("marriageEventName")
self.descr_field = self.get_widget("marriageDescription")
self.type_field = self.get_widget("marriage_type")
@ -379,6 +380,7 @@ def on_select_row(obj,row,b,c):
family_obj.date_field.set_text(event.getDate())
family_obj.place_field.set_text(event.getPlaceName())
family_obj.cause_field.set_text(event.getCause())
family_obj.name_field.set_label(const.display_fevent(event.getName()))
family_obj.event_details.set_text(utils.get_detail_text(event))
family_obj.descr_field.set_text(event.getDescription())
@ -392,7 +394,7 @@ def on_select_row(obj,row,b,c):
# actually changed.
#
#-------------------------------------------------------------------------
def update_attrib(attr,type,value,note,priv,conf):
def update_attrib(attr,type,value,note,priv):
changed = 0
if attr.getType() != const.save_pattr(type):
@ -411,10 +413,6 @@ def update_attrib(attr,type,value,note,priv,conf):
attr.setPrivacy(priv)
changed = 1
if attr.getConfidence() != conf:
attr.setConfidence(conf)
changed = 1
return changed
#-------------------------------------------------------------------------
@ -426,7 +424,7 @@ def update_attrib(attr,type,value,note,priv,conf):
# actually changed.
#
#-------------------------------------------------------------------------
def update_event(event,name,date,place,desc,note,priv,conf):
def update_event(event,name,date,place,desc,note,priv,cause):
changed = 0
if event.getPlace() != place:
event.setPlace(place)
@ -448,12 +446,12 @@ def update_event(event,name,date,place,desc,note,priv,conf):
event.setDate(date)
changed = 1
if event.getPrivacy() != priv:
event.setPrivacy(priv)
if event.getCause() != cause:
event.setCause(cause)
changed = 1
if event.getConfidence() != conf:
event.setConfidence(conf)
if event.getPrivacy() != priv:
event.setPrivacy(priv)
changed = 1
return changed
@ -734,13 +732,14 @@ class EventEditor:
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.cause_field = self.top.get_widget("eventCause")
self.place_combo = self.top.get_widget("eventPlace_combo")
self.date_field = self.top.get_widget("eventDate")
self.cause_field = self.top.get_widget("eventCause")
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")
father = parent.family.getFather()
@ -760,10 +759,9 @@ class EventEditor:
self.window.editable_enters(self.name_field);
self.window.editable_enters(self.place_field);
self.window.editable_enters(self.date_field);
self.window.editable_enters(self.cause_field);
self.window.editable_enters(self.descr_field);
utils.build_confidence_menu(self.conf_menu)
values = self.parent.db.getPlaceMap().values()
if event != None:
self.name_field.set_text(event.getName())
@ -771,9 +769,8 @@ class EventEditor:
utils.attach_places(values,self.place_combo,event.getPlace())
self.place_field.set_text(event.getPlaceName())
self.date_field.set_text(event.getDate())
self.cause_field.set_text(event.getCause())
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()
@ -787,7 +784,6 @@ class EventEditor:
self.note_field.set_word_wrap(1)
else:
utils.attach_places(values,self.place_combo,None)
self.conf_menu.set_history(2)
self.window.set_data("o",self)
self.top.signal_autoconnect({
@ -816,12 +812,12 @@ def on_event_edit_ok_clicked(obj):
ename = ee.name_field.get_text()
edate = ee.date_field.get_text()
ecause = ee.cause_field.get_text()
eplace = string.strip(ee.place_field.get_text())
eplace_obj = utils.get_place_from_list(ee.place_combo)
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()
@ -832,7 +828,7 @@ def on_event_edit_ok_clicked(obj):
eplace_obj.set_title(eplace)
ee.parent.db.addPlace(eplace_obj)
if update_event(event,ename,edate,eplace_obj,edesc,enote,epriv,econf):
if update_event(event,ename,edate,eplace_obj,edesc,enote,epriv,ecause):
ee.parent.lists_changed = 1
if not source_refs_equal(event.getSourceRef(),ee.srcref):
@ -859,7 +855,6 @@ class AttributeEditor:
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")
if self.attrib:
self.srcref = SourceRef(self.attrib.getSourceRef())
@ -885,8 +880,6 @@ class AttributeEditor:
if len(const.familyAttributes) > 0:
self.attrib_menu.set_popdown_strings(const.familyAttributes)
utils.build_confidence_menu(self.conf_menu)
if attrib != None:
self.type_field.set_text(attrib.getType())
self.value_field.set_text(attrib.getValue())
@ -896,14 +889,11 @@ class AttributeEditor:
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({
@ -934,13 +924,12 @@ def on_attrib_edit_ok_clicked(obj):
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):
if update_attrib(attrib,type,value,note,priv):
ee.parent.lists_changed = 1
if not source_refs_equal(attrib.getSourceRef(),ee.srcref):

View File

@ -187,6 +187,48 @@ def loadData(database, filename, callback=None):
xml_file.close()
return 1
#-------------------------------------------------------------------------
#
# Initialization function for the module. Called to start the reading
# of data.
#
#-------------------------------------------------------------------------
def loadRevision(database, file, filename, revision, callback=None):
basefile = os.path.dirname(filename)
database.smap = {}
database.pmap = {}
database.fmap = {}
parser = make_parser()
parser.setContentHandler(GrampsParser(database,callback,basefile))
filename = _("%s (revision %s)") % (filename,revision)
try:
parser.parse(file)
except SAXParseException,msg:
line = string.split(str(msg),':')
filemsg = _("%s is a corrupt file.") % filename
errtype = string.strip(line[3])
errmsg = _('A "%s" error on line %s was detected.') % (errtype,line[1])
GnomeErrorDialog("%s\n%s" % (filemsg,errmsg))
return 0
except IOError,msg:
errmsg = "%s\n%s" % (_("Error reading %s") % filename, str(msg))
GnomeErrorDialog(errmsg)
import traceback
traceback.print_exc()
return 0
except:
GnomeErrorDialog(_("Error reading %s") % filename)
import traceback
traceback.print_exc()
return 0
file.close()
return 1
if __name__ == "__main__":
import profile

View File

@ -82,18 +82,15 @@ class SourceNote:
return self.note
class DataObj(SourceNote):
"""Base class for data elements, providing source, note, privacy,
and confidence data"""
"""Base class for data elements, providing source, note, and privacy data"""
def __init__(self,source=None):
"""Create a new DataObj, copying data from a source object if provided"""
SourceNote.__init__(self,source)
if source:
self.confidence = source.confidence
self.private = source.private
else:
self.confidence = CONF_NORMAL
self.private = 0
def setPrivacy(self,val):
@ -104,15 +101,6 @@ class DataObj(SourceNote):
"""Returns the privacy level of the data"""
return self.private
def setConfidence(self,val):
"""Sets the confidence level"""
self.confidence = val
def getConfidence(self):
"""Returns the confidence level"""
return self.confidence
class Place(SourceNote):
"""Contains information related to a place, including multiple address
information (since place names can change with time), longitude, latitude,
@ -593,8 +581,6 @@ class Name(DataObj):
return 0
if self.private != other.private:
return 0
if self.confidence != other.confidence:
return 0
if self.getNote() != other.getNote():
return 0
if not self.getSourceRef().are_equal(other.getSourceRef()):
@ -913,11 +899,13 @@ class Event(DataObj):
self.date = Date(source.date)
self.description = source.description
self.name = source.name
self.cause = source.cause
else:
self.place = None
self.date = Date()
self.description = ""
self.name = ""
self.cause = ""
def set(self,name,date,place,description):
"""sets the name, date, place, and description of an Event instance"""
@ -938,7 +926,7 @@ class Event(DataObj):
return 0
if self.description != other.description:
return 0
if self.confidence != other.confidence:
if self.cause != other.cause:
return 0
if self.private != other.private:
return 0
@ -962,6 +950,14 @@ class Event(DataObj):
"""returns the Place instance of the Event"""
return self.place
def setCause(self,cause):
"""sets the cause of the Event"""
self.cause = cause
def getCause(self):
"""returns the cause of the Event"""
return self.cause
def getPlaceName(self):
"""returns the title of the Place associated with the Event"""
if self.place:
@ -1234,18 +1230,28 @@ class SourceRef:
def __init__(self,source=None):
"""creates a new SourceRef, copying from the source if present"""
if source:
self.confidence = source.confidence
self.ref = source.ref
self.page = source.page
self.date = Date(source.date)
self.comments = Note(source.comments.get())
self.text = source.text
else:
self.confidence = CONF_NORMAL
self.ref = None
self.page = ""
self.date = Date()
self.comments = Note()
self.text = ""
def setConfidence(self,val):
"""Sets the confidence level"""
self.confidence = val
def getConfidence(self):
"""Returns the confidence level"""
return self.confidence
def setBase(self,ref):
"""sets the Source instance to which the SourceRef refers"""
self.ref = ref
@ -1301,6 +1307,8 @@ class SourceRef:
return 0
if self.getComments() != other.getComments():
return 0
if self.confidence != other.confidence:
return 0
return 1
elif not self.ref and not other.ref:
return 1

View File

@ -46,6 +46,7 @@ from RelLib import *
SOURCEDISP = "s"
ACTIVESRC = "a"
INDEX = "i"
MENUVAL = "a"
#-------------------------------------------------------------------------
#
@ -74,6 +75,9 @@ class SourceEditor:
self.source_field = self.get_widget("sourceList")
self.title_menu = self.get_widget("source_title")
self.title_menu.set_data("o",self)
self.conf_menu = self.get_widget("conf")
utils.build_confidence_menu(self.conf_menu)
self.conf_menu.set_history(srcref.getConfidence())
self.author_field = self.get_widget("sauthor")
self.pub_field = self.get_widget("spubinfo")
@ -189,12 +193,14 @@ def on_sourceok_clicked(obj):
page = src_edit.get_widget("spage").get_text()
date = src_edit.get_widget("sdate").get_text()
text = src_edit.get_widget("stext").get_chars(0,-1)
conf = src_edit.get_widget("conf").get_menu().get_active().get_data(MENUVAL)
comments = src_edit.get_widget("scomment").get_chars(0,-1)
src_edit.source_ref.setPage(page)
src_edit.source_ref.getDate().set(date)
src_edit.source_ref.setText(text)
src_edit.source_ref.setComments(comments)
src_edit.source_ref.setConfidence(conf)
if src_edit.update:
if src_edit.source_ref.getBase():
@ -229,3 +235,4 @@ def on_source_changed(obj):
src_entry.get_widget("sdate").set_sensitive(active)
src_entry.get_widget("stext").set_sensitive(active)
src_entry.get_widget("scomment").set_sensitive(active)
src_entry.get_widget("conf").set_sensitive(active)

View File

@ -89,15 +89,10 @@ def dump_event(g,event,index=1):
#
#-------------------------------------------------------------------------
def conf_priv(obj):
if obj.getConfidence() != 2:
cnf = ' conf="%d" ' % obj.getConfidence()
else:
cnf = ''
if obj.getPrivacy() != 0:
priv = ' priv="%d"' % obj.getPrivacy()
return ' priv="%d"' % obj.getPrivacy()
else:
priv = ''
return "%s%s" % (cnf,priv)
return ''
#-------------------------------------------------------------------------
#
@ -111,6 +106,7 @@ def dump_my_event(g,name,event,index=1):
date = event.getSaveDate()
place = event.getPlace()
description = event.getDescription()
cause = event.getCause()
if (not name or name == "Birth" or name == "Death") and \
not date and not place and not description:
return
@ -119,6 +115,7 @@ def dump_my_event(g,name,event,index=1):
g.write('%s<event type="%s"%s>\n' % (sp,fix(name),conf_priv(event)))
write_line(g,"date",date,index+1)
write_ref(g,"place",place,index+1)
write_line(g,"cause",cause,index+1)
write_line(g,"description",description,index+1)
if event.getNote() != "":
writeNote(g,"note",event.getNote(),index+1)
@ -139,11 +136,15 @@ def dump_source_ref(g,source_ref,index=1):
c = source_ref.getComments()
t = source_ref.getText()
d = source_ref.getDate().getSaveDate()
q = source_ref.getConfidence()
g.write(" " * index)
if p == "" and c == "" and t == "" and d == "":
if p == "" and c == "" and t == "" and d == "" and q == 2:
g.write('<sourceref ref="%s"/>\n' % source.getId())
else:
g.write('<sourceref ref="%s">\n' % source.getId())
if q == 2:
g.write('<sourceref ref="%s">\n' % source.getId())
else:
g.write('<sourceref ref="%s" conf="%d">\n' % (source.getId(),q))
write_line(g,"spage",p,index+1)
writeNote(g,"scomments",c,index+1)
writeNote(g,"stext",t,index+1)

View File

@ -59,71 +59,12 @@
<widget>
<class>GtkTable</class>
<name>table13</name>
<rows>6</rows>
<rows>3</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkEntry</class>
<name>attr_name</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Thu, 24 May 2001 21:14:30 GMT</last_modification_time>
</signal>
<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>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>attr_display</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Thu, 24 May 2001 21:14:10 GMT</last_modification_time>
</signal>
<label>Display attribute on Edit Person form</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>autoload</name>
@ -182,6 +123,140 @@
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>use_vc</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Tue, 02 Oct 2001 14:14:35 GMT</last_modification_time>
</signal>
<label>Use Revision Control</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>vc_menu</name>
<can_focus>True</can_focus>
<items>RCS
</items>
<initial_choice>0</initial_choice>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label61</name>
<label>General</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkTable</class>
<name>table27</name>
<rows>4</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkEntry</class>
<name>attr_name</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Thu, 24 May 2001 21:14:30 GMT</last_modification_time>
</signal>
<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>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>attr_display</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Thu, 24 May 2001 21:14:10 GMT</last_modification_time>
</signal>
<label>Display attribute on Edit Person form</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>usetabs</name>
@ -198,8 +273,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
@ -227,8 +302,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
@ -256,8 +331,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>2</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
@ -273,8 +348,8 @@
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label61</name>
<label>General</label>
<name>label209</name>
<label>Display</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>

View File

@ -75,7 +75,7 @@ gtkrcFile = rootDir + os.sep + "gtkrc"
#
#-------------------------------------------------------------------------
progName = "gramps"
version = "0.5.1"
version = "0.6.0pre"
copyright = "(C) 2001 Donald N. Allingham"
authors = ["Donald N. Allingham"]
comments = _("Gramps (Genealogical Research and Analysis Management Programming System) is a personal genealogy program that can be extended by using the Python programming language.")

View File

@ -125,7 +125,7 @@
<widget>
<class>GtkTable</class>
<name>table21</name>
<rows>7</rows>
<rows>8</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
@ -201,8 +201,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -248,8 +248,8 @@
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
@ -321,8 +321,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -407,8 +407,8 @@
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>6</top_attach>
<bottom_attach>7</bottom_attach>
<top_attach>7</top_attach>
<bottom_attach>8</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
@ -441,8 +441,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>6</top_attach>
<bottom_attach>7</bottom_attach>
<top_attach>7</top_attach>
<bottom_attach>8</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -462,8 +462,8 @@
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -512,20 +512,17 @@
</widget>
<widget>
<class>GtkLabel</class>
<name>label178</name>
<label>Confidence</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>8</ypad>
<class>GtkCheckButton</class>
<name>priv</name>
<can_focus>True</can_focus>
<label>Private Record</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>6</top_attach>
<bottom_attach>7</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -538,15 +535,20 @@
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox24</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<class>GtkLabel</class>
<name>causelabel</name>
<label>Cause</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>1</left_attach>
<right_attach>2</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<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>
@ -554,40 +556,32 @@
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>conf</name>
<can_focus>True</can_focus>
<items>Very Low
Low
Normal
High
Very High
</items>
<initial_choice>0</initial_choice>
<child>
<padding>3</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>priv</name>
<can_focus>True</can_focus>
<label>Private Record</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>eventCause</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>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>
@ -974,36 +968,12 @@ Very High
</widget>
<widget>
<class>GtkLabel</class>
<name>label177</name>
<label>Confidence</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>GtkHBox</class>
<name>hbox25</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<class>GtkCheckButton</class>
<name>priv</name>
<can_focus>True</can_focus>
<label>Private Record</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
@ -1016,40 +986,8 @@ Very High
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
<yfill>False</yfill>
</child>
<widget>
<class>GtkOptionMenu</class>
<name>conf</name>
<can_focus>True</can_focus>
<items>Very Low
Low
Normal
High
Very High
</items>
<initial_choice>0</initial_choice>
<child>
<padding>3</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>priv</name>
<can_focus>True</can_focus>
<label>Private Record</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>

View File

@ -4738,7 +4738,7 @@ Unknown
<widget>
<class>GtkTable</class>
<name>table19</name>
<rows>4</rows>
<rows>5</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
@ -4759,8 +4759,8 @@ Unknown
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
@ -4792,8 +4792,8 @@ Unknown
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
@ -4824,8 +4824,8 @@ Unknown
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
@ -4848,8 +4848,8 @@ Unknown
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
@ -4867,15 +4867,15 @@ Unknown
<label>Volume/Film/Page</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
@ -4900,8 +4900,8 @@ Unknown
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
@ -4926,8 +4926,8 @@ Unknown
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
@ -4952,8 +4952,8 @@ Unknown
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
@ -4964,6 +4964,59 @@ Unknown
<yfill>True</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label243</name>
<label>Confidence</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>0</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>GtkOptionMenu</class>
<name>conf</name>
<can_focus>True</can_focus>
<items>Very Low
Low
Normal
High
Very High
</items>
<initial_choice>2</initial_choice>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
</widget>
@ -6049,4 +6102,365 @@ Unknown
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>dbopen</name>
<title>Gramps - Open a database</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</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-vbox15</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area15</name>
<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>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button127</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_ok_button1_clicked</handler>
<object>dbopen</object>
<last_modification_time>Wed, 03 Oct 2001 02:55:59 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button129</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>destroy_passed_object</handler>
<object>dbopen</object>
<last_modification_time>Wed, 03 Oct 2001 02:56:46 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox44</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label245</name>
<label>Open a database</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHSeparator</class>
<name>hseparator24</name>
<child>
<padding>10</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkHBox</class>
<name>hbox33</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label246</name>
<label>Database</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>5</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GnomeFileEntry</class>
<name>dbname</name>
<width>400</width>
<history_id>recentdbs</history_id>
<max_saved>15</max_saved>
<title>Open a GRAMPS Databases</title>
<directory>True</directory>
<modal>False</modal>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GnomeEntry:entry</child_name>
<name>combo-entry2</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
</widget>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>getoldrev</name>
<border_width>10</border_width>
<can_focus>True</can_focus>
<label>Revert to an older version from revision control</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>revselect</name>
<title>Gramps - Select an older revision</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</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-vbox16</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area16</name>
<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>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button132</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_loadrev_clicked</handler>
<object>revselect</object>
<last_modification_time>Wed, 03 Oct 2001 04:33:08 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button134</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>destroy_passed_object</handler>
<object>revselect</object>
<last_modification_time>Wed, 03 Oct 2001 04:32:38 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox45</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label247</name>
<label>Revert to an older revision</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHSeparator</class>
<name>hseparator25</name>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow29</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>revlist</name>
<width>500</width>
<height>200</height>
<can_focus>True</can_focus>
<columns>3</columns>
<column_widths>77,128,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label250</name>
<label>Revision</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label251</name>
<label>Date</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>comlabel</name>
<label>Comment</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>

View File

@ -68,7 +68,7 @@ import EditPerson
import EditPlace
import Marriage
import Find
import VersionControl
#-------------------------------------------------------------------------
#
# Global variables.
@ -1105,11 +1105,54 @@ def on_reports_clicked(obj):
#-------------------------------------------------------------------------
def on_ok_button1_clicked(obj):
new_database_response(0)
filename = obj.get_filename()
dbname = obj.get_data("dbname")
getoldrev = obj.get_data("getoldrev")
filename = dbname.get_full_path(1)
utils.destroy_passed_object(obj)
if filename != "":
read_file(filename)
if getoldrev.get_active():
dialog = libglade.GladeXML(const.gladeFile, "revselect")
revsel = dialog.get_widget("revselect")
dialog.signal_autoconnect({
"destroy_passed_object" : utils.destroy_passed_object,
"on_loadrev_clicked" : on_loadrev_clicked,
})
revlist = dialog.get_widget("revlist")
revsel.set_data("o",revlist)
vc = VersionControl.RcsVersionControl(filename)
l = vc.revision_list()
l.reverse()
index = 0
for f in l:
revlist.append([f[0],f[1],f[2]])
revlist.set_row_data(index,f[0])
index = index + 1
revlist.set_data("n",filename)
else:
if filename != "":
read_file(filename)
def on_loadrev_clicked(obj):
clist = obj.get_data("o")
filename = clist.get_data("n")
if len(clist.selection) > 0:
rev = clist.get_row_data(clist.selection[0])
vc = VersionControl.RcsVersionControl(filename)
f = vc.get_version(rev)
load_revision(f,filename,rev)
utils.destroy_passed_object(obj)
active_person = None
for person in database.getPersonMap().values():
if active_person == None:
active_person = person
lastname = person.getPrimaryName().getSurname()
if lastname and lastname not in const.surnames:
const.surnames.append(lastname)
statusbar.set_progress(1.0)
full_update()
statusbar.set_progress(0.0)
#-------------------------------------------------------------------------
#
@ -1144,6 +1187,39 @@ def read_file(filename):
full_update()
statusbar.set_progress(0.0)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def read_revision(filename,rev):
base = os.path.basename(filename)
if base == const.indexFile:
filename = os.path.dirname(filename)
elif not os.path.isdir(filename):
displayError(_("%s is not a directory") % filename)
return
statusbar.set_status(_("Loading %s ...") % filename)
if load_database(filename) == 1:
topWindow.set_title("%s - %s" % (_("Gramps"),filename))
else:
statusbar.set_status("")
Config.save_last_file("")
active_person = None
for person in database.getPersonMap().values():
if active_person == None:
active_person = person
lastname = person.getPrimaryName().getSurname()
if lastname and lastname not in const.surnames:
const.surnames.append(lastname)
statusbar.set_progress(1.0)
full_update()
statusbar.set_progress(0.0)
#-------------------------------------------------------------------------
#
# Called from the fileselector, when the OK button is pressed (Save
@ -1164,7 +1240,9 @@ def on_ok_button2_clicked(obj):
#-------------------------------------------------------------------------
def save_file(filename):
import WriteXML
import VersionControl
path = filename
filename = os.path.normpath(filename)
statusbar.set_status(_("Saving %s ...") % filename)
@ -1199,6 +1277,11 @@ def save_file(filename):
database.setSavePath(old_file)
utils.clearModified()
Config.save_last_file(old_file)
if Config.usevc:
vc = VersionControl.RcsVersionControl(path)
vc.checkin(filename,"comments not supported yet",not Config.uncompress)
statusbar.set_status("")
statusbar.set_progress(0)
@ -1839,14 +1922,19 @@ def on_spouse_list_select_row(obj,row,b,c):
#
#-------------------------------------------------------------------------
def on_open_activate(obj):
wFs = libglade.GladeXML (const.gladeFile, FILESEL)
wFs = libglade.GladeXML(const.gladeFile, "dbopen")
wFs.signal_autoconnect({
"on_ok_button1_clicked": on_ok_button1_clicked,
"destroy_passed_object": utils.destroy_passed_object
})
fileSelector = wFs.get_widget(FILESEL)
fileSelector.set_filename(Config.db_dir)
fileSelector = wFs.get_widget("dbopen")
dbname = wFs.get_widget("dbname")
getoldrev = wFs.get_widget("getoldrev")
fileSelector.set_data("dbname",dbname)
dbname.set_default_path(Config.db_dir)
fileSelector.set_data("getoldrev",getoldrev)
getoldrev.set_sensitive(Config.usevc)
fileSelector.show()
#-------------------------------------------------------------------------
@ -2786,6 +2874,59 @@ def load_database(name):
active_person = person
return 1
def load_revision(f,name,revision):
global active_person
filename = name + os.sep + const.indexFile
if ReadXML.loadRevision(database,f,filename, revision,load_progress) == 0:
return 0
database.setSavePath(name)
res = database.getResearcher()
if res.getName() == "" and Config.owner.getName() != "":
database.setResearcher(Config.owner)
utils.modified()
setup_bookmarks()
mylist = database.getPersonEventTypes()
for type in mylist:
ntype = const.display_pevent(type)
if ntype not in const.personalEvents:
const.personalEvents.append(ntype)
mylist = database.getFamilyEventTypes()
for type in mylist:
ntype = const.display_fevent(type)
if ntype not in const.marriageEvents:
const.marriageEvents.append(ntype)
mylist = database.getPersonAttributeTypes()
for type in mylist:
ntype = const.display_pattr(type)
if ntype not in const.personalAttributes:
const.personalAttributes.append(ntype)
mylist = database.getFamilyAttributeTypes()
for type in mylist:
if type not in const.familyAttributes:
const.familyAttributes.append(type)
mylist = database.getFamilyRelationTypes()
for type in mylist:
if type not in const.familyRelations:
const.familyRelations.append(type)
Config.save_last_file(name)
gtop.get_widget("filter").set_text("")
person = database.getDefaultPerson()
if person:
active_person = person
return 1
#-------------------------------------------------------------------------
#
#

View File

@ -318,7 +318,7 @@
<widget>
<class>GtkTable</class>
<name>table8</name>
<rows>4</rows>
<rows>5</rows>
<columns>3</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
@ -389,8 +389,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -467,8 +467,8 @@
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
@ -493,8 +493,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -519,8 +519,8 @@
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
@ -597,8 +597,8 @@
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -623,8 +623,86 @@
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</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>label230</name>
<label>Cause</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>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>label231</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>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>marriageCause</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>2</left_attach>
<right_attach>3</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>

View File

@ -496,7 +496,6 @@ class GedcomParser:
elif matches[1] == "CHIL":
mrel,frel = self.parse_ftw_relations(2)
child = self.db.findPerson(matches[2],self.pmap)
print child.getPrimaryName().getName(),mrel,frel
self.family.addChild(child)
if (mrel == "Birth" or mrel == "") and \
(frel == "Birth" or frel == "") :
@ -967,10 +966,7 @@ class GedcomParser:
self.ignore_sub_junk(level+1)
elif matches[1] == "CAUS":
info = matches[2] + self.parse_continue_data(level+1)
if note == "":
note = "%s: %s" % (_("Cause of Death"), info)
else:
note = "%s\n%s: %s" % (note,_("Cause of Death"), info)
event.setCause(info)
elif matches[1] == "NOTE":
info = matches[2] + self.parse_continue_data(level+1)
if note == "":
@ -1061,12 +1057,8 @@ class GedcomParser:
else:
self.barf(level+1)
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def parse_source_reference(self,source,level):
"""Reads the data associated with a SOUR reference"""
while 1:
matches = self.get_next()
@ -1082,7 +1074,11 @@ class GedcomParser:
source.setDate(d)
source.setText(text)
elif matches[1] == "QUAY":
pass
val = int(matches[2])
if val > 1:
source.setConfidence(val+1)
else:
source.setConfidence(val)
elif matches[1] == "NOTE":
if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@":
note = matches[1] + self.parse_continue_data(1)
@ -1099,11 +1095,7 @@ class GedcomParser:
self.barf(level+1)
def parse_source_data(self,level):
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
"""Parses the source data"""
date = ""
note = ""
while 1:
@ -1120,12 +1112,8 @@ class GedcomParser:
else:
self.barf(level+1)
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def parse_name(self,name,level):
"""Parses the person's name information"""
while 1:
matches = self.get_next()
@ -1174,12 +1162,8 @@ class GedcomParser:
else:
self.barf(level+1)
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def parse_header_head(self):
"""validiates that this is a valid GEDCOM file"""
line = string.replace(self.lines[self.index],'\r','')
match = headRE.search(line)
if not match: