* src/AttrEdit.py: don't used reserved word "list"
* src/EditPerson.py: Pass correct attribute list to editor * src/GrampsBSDDB.py: persistently load/save attribute lists * src/GrampsDbBase.py: update attributes on commit * src/Marriage.py: Pass correct attribute list to editor svn: r5017
This commit is contained in:
parent
db62a824fb
commit
ac235ff7be
@ -1,3 +1,10 @@
|
|||||||
|
2005-08-04 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/AttrEdit.py: don't used reserved word "list"
|
||||||
|
* src/EditPerson.py: Pass correct attribute list to editor
|
||||||
|
* src/GrampsBSDDB.py: persistently load/save attribute lists
|
||||||
|
* src/GrampsDbBase.py: update attributes on commit
|
||||||
|
* src/Marriage.py: Pass correct attribute list to editor
|
||||||
|
|
||||||
2005-08-04 Alex Roitman <shura@gramps-project.org>
|
2005-08-04 Alex Roitman <shura@gramps-project.org>
|
||||||
* NEWS: Update.
|
* NEWS: Update.
|
||||||
* src/MergePeople.py: Typos.
|
* src/MergePeople.py: Typos.
|
||||||
|
@ -64,7 +64,7 @@ class AttributeEditor:
|
|||||||
"""
|
"""
|
||||||
Displays a dialog that allows the user to edit an attribute.
|
Displays a dialog that allows the user to edit an attribute.
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent, attrib, title, list, callback,
|
def __init__(self, parent, attrib, title, data_list, callback,
|
||||||
parent_window=None):
|
parent_window=None):
|
||||||
"""
|
"""
|
||||||
Displays the dialog box.
|
Displays the dialog box.
|
||||||
@ -88,7 +88,7 @@ class AttributeEditor:
|
|||||||
self.attrib = attrib
|
self.attrib = attrib
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self.child_windows = {}
|
self.child_windows = {}
|
||||||
self.alist = list
|
self.alist = data_list
|
||||||
|
|
||||||
self.top = gtk.glade.XML(const.dialogFile, "attr_edit","gramps")
|
self.top = gtk.glade.XML(const.dialogFile, "attr_edit","gramps")
|
||||||
self.slist = self.top.get_widget("slist")
|
self.slist = self.top.get_widget("slist")
|
||||||
@ -122,7 +122,7 @@ class AttributeEditor:
|
|||||||
l = self.top.get_widget("title")
|
l = self.top.get_widget("title")
|
||||||
Utils.set_titles(self.window,l,title,_('Attribute Editor'))
|
Utils.set_titles(self.window,l,title,_('Attribute Editor'))
|
||||||
|
|
||||||
AutoComp.fill_combo(self.attrib_menu,list)
|
AutoComp.fill_combo(self.attrib_menu,data_list)
|
||||||
|
|
||||||
if attrib != None:
|
if attrib != None:
|
||||||
self.type_field.set_text(const.display_attr(attrib.get_type()))
|
self.type_field.set_text(const.display_attr(attrib.get_type()))
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
import os
|
import os
|
||||||
import locale
|
import locale
|
||||||
|
import sets
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -1182,8 +1183,9 @@ class EditPerson:
|
|||||||
"""Brings up the AttributeEditor for a new attribute"""
|
"""Brings up the AttributeEditor for a new attribute"""
|
||||||
import AttrEdit
|
import AttrEdit
|
||||||
pname = self.nd.display(self.person)
|
pname = self.nd.display(self.person)
|
||||||
AttrEdit.AttributeEditor(self,None,pname,const.personalAttributes,
|
attr_list = list(sets.Set(const.personalAttributes + self.db.get_person_attribute_types()))
|
||||||
self.attr_edit_callback,self.window)
|
AttrEdit.AttributeEditor(
|
||||||
|
self,None,pname, attr_list, self.attr_edit_callback,self.window)
|
||||||
|
|
||||||
def on_up_clicked(self,obj):
|
def on_up_clicked(self,obj):
|
||||||
sel = obj.get_selection()
|
sel = obj.get_selection()
|
||||||
@ -1465,7 +1467,8 @@ class EditPerson:
|
|||||||
if node:
|
if node:
|
||||||
attr = self.atree.get_object(node)
|
attr = self.atree.get_object(node)
|
||||||
pname = self.nd.display(self.person)
|
pname = self.nd.display(self.person)
|
||||||
AttrEdit.AttributeEditor(self,attr,pname,const.personalAttributes,
|
attr_list = list(sets.Set(const.personalAttributes + self.db.get_person_attribute_types()))
|
||||||
|
AttrEdit.AttributeEditor(self,attr,pname,attr_list,
|
||||||
self.attr_edit_callback,self.window)
|
self.attr_edit_callback,self.window)
|
||||||
|
|
||||||
def on_update_addr_clicked(self,obj):
|
def on_update_addr_clicked(self,obj):
|
||||||
|
@ -186,6 +186,8 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.bookmarks = self.metadata.get('bookmarks')
|
self.bookmarks = self.metadata.get('bookmarks')
|
||||||
self.family_event_names = sets.Set(self.metadata.get('fevent_names',[]))
|
self.family_event_names = sets.Set(self.metadata.get('fevent_names',[]))
|
||||||
self.individual_event_names = sets.Set(self.metadata.get('pevent_names',[]))
|
self.individual_event_names = sets.Set(self.metadata.get('pevent_names',[]))
|
||||||
|
self.family_attributes = sets.Set(self.metadata.get('fattr_names',[]))
|
||||||
|
self.individual_attributes = sets.Set(self.metadata.get('pattr_names',[]))
|
||||||
|
|
||||||
gstats = self.metadata.get('gender_stats')
|
gstats = self.metadata.get('gender_stats')
|
||||||
|
|
||||||
@ -314,6 +316,8 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.metadata['gender_stats'] = self.genderStats.save_stats()
|
self.metadata['gender_stats'] = self.genderStats.save_stats()
|
||||||
self.metadata['fevent_names'] = list(self.family_event_names)
|
self.metadata['fevent_names'] = list(self.family_event_names)
|
||||||
self.metadata['pevent_names'] = list(self.individual_event_names)
|
self.metadata['pevent_names'] = list(self.individual_event_names)
|
||||||
|
self.metadata['fattr_names'] = list(self.family_attributes)
|
||||||
|
self.metadata['pattr_names'] = list(self.individual_attributes)
|
||||||
self.metadata.close()
|
self.metadata.close()
|
||||||
self.surnames.close()
|
self.surnames.close()
|
||||||
self.id_trans.close()
|
self.id_trans.close()
|
||||||
|
@ -155,6 +155,8 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
|
|||||||
|
|
||||||
self.family_event_names = sets.Set()
|
self.family_event_names = sets.Set()
|
||||||
self.individual_event_names = sets.Set()
|
self.individual_event_names = sets.Set()
|
||||||
|
self.individual_attributes = sets.Set()
|
||||||
|
self.family_attributes = sets.Set()
|
||||||
|
|
||||||
self.set_person_id_prefix(GrampsKeys.get_person_id_prefix())
|
self.set_person_id_prefix(GrampsKeys.get_person_id_prefix())
|
||||||
self.set_object_id_prefix(GrampsKeys.get_object_id_prefix())
|
self.set_object_id_prefix(GrampsKeys.get_object_id_prefix())
|
||||||
@ -298,6 +300,9 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
|
|||||||
else:
|
else:
|
||||||
self.genderStats.count_person(person,self)
|
self.genderStats.count_person(person,self)
|
||||||
|
|
||||||
|
for attr in person.attribute_list:
|
||||||
|
self.individual_attributes.add(attr.type)
|
||||||
|
|
||||||
self.person_map[handle] = person.serialize()
|
self.person_map[handle] = person.serialize()
|
||||||
if old_data:
|
if old_data:
|
||||||
self.emit('person-update',([handle],))
|
self.emit('person-update',([handle],))
|
||||||
@ -409,6 +414,9 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
|
|||||||
transaction.add(FAMILY_KEY,handle,old_data)
|
transaction.add(FAMILY_KEY,handle,old_data)
|
||||||
self.family_map[handle] = family.serialize()
|
self.family_map[handle] = family.serialize()
|
||||||
|
|
||||||
|
for attr in family.attribute_list:
|
||||||
|
self.family_attributes.add(attr.type)
|
||||||
|
|
||||||
if old_data:
|
if old_data:
|
||||||
self.emit('family-update',([handle],))
|
self.emit('family-update',([handle],))
|
||||||
else:
|
else:
|
||||||
@ -1137,12 +1145,12 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
|
|||||||
def get_person_attribute_types(self):
|
def get_person_attribute_types(self):
|
||||||
"""returns a list of all Attribute types assocated with Person
|
"""returns a list of all Attribute types assocated with Person
|
||||||
instances in the database"""
|
instances in the database"""
|
||||||
return []
|
return list(self.individual_attributes)
|
||||||
|
|
||||||
def get_family_attribute_types(self):
|
def get_family_attribute_types(self):
|
||||||
"""returns a list of all Attribute types assocated with Family
|
"""returns a list of all Attribute types assocated with Family
|
||||||
instances in the database"""
|
instances in the database"""
|
||||||
return []
|
return list(self.family_attributes)
|
||||||
|
|
||||||
def get_family_event_types(self):
|
def get_family_event_types(self):
|
||||||
"""returns a list of all Event types assocated with Family
|
"""returns a list of all Event types assocated with Family
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
import sets
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -814,9 +815,9 @@ class Marriage:
|
|||||||
name = NameDisplay.displayer.display(father)
|
name = NameDisplay.displayer.display(father)
|
||||||
else:
|
else:
|
||||||
name = NameDisplay.displayer.display(mother)
|
name = NameDisplay.displayer.display(mother)
|
||||||
|
attr_list = list(sets.Set(const.familyAttributes + self.db.get_family_attribute_types()))
|
||||||
AttrEdit.AttributeEditor(
|
AttrEdit.AttributeEditor(
|
||||||
self, attr, name, const.familyAttributes,
|
self, attr, name, attr_list, self.attr_edit_callback, self.window)
|
||||||
self.attr_edit_callback, self.window)
|
|
||||||
|
|
||||||
def on_delete_attr_clicked(self,obj):
|
def on_delete_attr_clicked(self,obj):
|
||||||
if Utils.delete_selected(obj,self.alist):
|
if Utils.delete_selected(obj,self.alist):
|
||||||
@ -837,9 +838,9 @@ class Marriage:
|
|||||||
name = NameDisplay.displayer.display(father)
|
name = NameDisplay.displayer.display(father)
|
||||||
else:
|
else:
|
||||||
name = NameDisplay.displayer.display(mother)
|
name = NameDisplay.displayer.display(mother)
|
||||||
|
attr_list = list(sets.Set(const.familyAttributes + self.db.get_family_attribute_types()))
|
||||||
AttrEdit.AttributeEditor(
|
AttrEdit.AttributeEditor(
|
||||||
self, None, name, const.familyAttributes,
|
self, None, name, attr_list, self.attr_edit_callback, self.window)
|
||||||
self.attr_edit_callback, self.window)
|
|
||||||
|
|
||||||
def move_element(self,list,src,dest):
|
def move_element(self,list,src,dest):
|
||||||
if src == -1:
|
if src == -1:
|
||||||
|
Loading…
Reference in New Issue
Block a user