2007-01-02 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_WriteGedcom.py: handle illegal confidence
	* src/RelLib/_Person.py: set_parent_family_list
	* src/Editors/_EditPerson.py: catch family changes



svn: r7865
This commit is contained in:
Don Allingham 2007-01-03 02:37:34 +00:00
parent cdb76d6209
commit 8f12743e79
4 changed files with 40 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2007-01-02 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_WriteGedcom.py: handle illegal confidence
* src/RelLib/_Person.py: set_parent_family_list
* src/Editors/_EditPerson.py: catch family changes
2007-01-02 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2007-01-02 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/DisplayTabs/_PersonBackRefList.py: new file * src/DisplayTabs/_PersonBackRefList.py: new file
* src/DisplayTabs/__init__.py: add PersonBackRefList * src/DisplayTabs/__init__.py: add PersonBackRefList

View File

@ -164,6 +164,26 @@ class EditPerson(EditPrimary):
self.eventbox.connect('button-press-event', self.eventbox.connect('button-press-event',
self._image_button_press) self._image_button_press)
self._add_db_signal('family-rebuild', self.family_change)
self._add_db_signal('family-delete', self.family_change)
self._add_db_signal('family-update', self.family_change)
self._add_db_signal('family-add', self.family_change)
def family_change(self, handle_list):
flist = self.obj.get_family_handle_list() + self.obj.get_parent_family_handle_list()
for handle in handle_list:
if handle in flist:
self._update_families()
return
def _update_families(self):
phandle = self.obj.get_handle()
person = self.dbstate.db.get_person_from_handle(phandle)
self.obj.set_family_handle_list(person.get_family_handle_list())
self.obj.set_parent_family_handle_list(person.get_parent_family_handle_list())
self.person_ref_list.data = self.obj.get_person_ref_list()
self.person_ref_list.rebuild()
def _setup_fields(self): def _setup_fields(self):
""" """
Connects the GrampsWidget objects to field in the interface. This Connects the GrampsWidget objects to field in the interface. This
@ -305,11 +325,9 @@ class EditPerson(EditPrimary):
WebEmbedList(self.dbstate, self.uistate, self.track, WebEmbedList(self.dbstate, self.uistate, self.track,
self.obj.get_url_list())) self.obj.get_url_list()))
self.pref_list = self._add_tab( self.person_ref_list = PersonRefEmbedList(self.dbstate, self.uistate, self.track,
notebook, self.obj.get_person_ref_list())
PersonRefEmbedList(self.dbstate, self.uistate, self.track, self.pref_list = self._add_tab(notebook, self.person_ref_list)
self.obj.get_person_ref_list()))
self.lds_list = self._add_tab( self.lds_list = self._add_tab(
notebook, notebook,
LdsEmbedList(self.dbstate, self.uistate, self.track, LdsEmbedList(self.dbstate, self.uistate, self.track,

View File

@ -1390,7 +1390,7 @@ class GedcomWriter(UpdateCallback):
conf = ref.get_confidence_level() conf = ref.get_confidence_level()
# Cap the maximum level # Cap the maximum level
conf = min(conf,RelLib.SourceRef.CONF_VERY_HIGH) conf = min(conf,RelLib.SourceRef.CONF_VERY_HIGH)
if conf != RelLib.SourceRef.CONF_NORMAL: if conf != RelLib.SourceRef.CONF_NORMAL and conf != -1:
self.write_long_text("QUAY",level+1, str(quay_map[conf])) self.write_long_text("QUAY",level+1, str(quay_map[conf]))
ref_text = ref.get_text() ref_text = ref.get_text()

View File

@ -641,6 +641,17 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase,
""" """
return self.parent_family_list return self.parent_family_list
def set_parent_family_handle_list(self, family_list):
"""
Returns the list of L{Family} handles in which the person is a
child.
@return: Returns the list of handles corresponding to the
L{Family} records with which the person is a child.
@rtype: list
"""
self.parent_family_list = family_list
def add_parent_family_handle(self, family_handle): def add_parent_family_handle(self, family_handle):
""" """
Adds the L{Family} handle to the Person instance's list of Adds the L{Family} handle to the Person instance's list of