diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f9137a820..8efc5ad32 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2007-01-02 Don Allingham + * 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 * src/DisplayTabs/_PersonBackRefList.py: new file * src/DisplayTabs/__init__.py: add PersonBackRefList diff --git a/gramps2/src/Editors/_EditPerson.py b/gramps2/src/Editors/_EditPerson.py index c4733ada9..f1b5155e7 100644 --- a/gramps2/src/Editors/_EditPerson.py +++ b/gramps2/src/Editors/_EditPerson.py @@ -164,6 +164,26 @@ class EditPerson(EditPrimary): self.eventbox.connect('button-press-event', 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): """ Connects the GrampsWidget objects to field in the interface. This @@ -305,11 +325,9 @@ class EditPerson(EditPrimary): WebEmbedList(self.dbstate, self.uistate, self.track, self.obj.get_url_list())) - self.pref_list = self._add_tab( - notebook, - PersonRefEmbedList(self.dbstate, self.uistate, self.track, - self.obj.get_person_ref_list())) - + self.person_ref_list = PersonRefEmbedList(self.dbstate, self.uistate, self.track, + self.obj.get_person_ref_list()) + self.pref_list = self._add_tab(notebook, self.person_ref_list) self.lds_list = self._add_tab( notebook, LdsEmbedList(self.dbstate, self.uistate, self.track, diff --git a/gramps2/src/GrampsDb/_WriteGedcom.py b/gramps2/src/GrampsDb/_WriteGedcom.py index 5774ad82e..5cef1fd65 100644 --- a/gramps2/src/GrampsDb/_WriteGedcom.py +++ b/gramps2/src/GrampsDb/_WriteGedcom.py @@ -1390,7 +1390,7 @@ class GedcomWriter(UpdateCallback): conf = ref.get_confidence_level() # Cap the maximum level 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])) ref_text = ref.get_text() diff --git a/gramps2/src/RelLib/_Person.py b/gramps2/src/RelLib/_Person.py index 59112aea1..2d5f3ae0f 100644 --- a/gramps2/src/RelLib/_Person.py +++ b/gramps2/src/RelLib/_Person.py @@ -641,6 +641,17 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase, """ 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): """ Adds the L{Family} handle to the Person instance's list of