diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 911d89cca..ff33e0685 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -8,7 +8,8 @@ family dialog (SelectFamily) * src/GrampsWidgets.py: select default value in menu * src/BaseDoc.py: pylint - * src/DisplayTabs.py: handle temple not set for LdsOrd + * src/DisplayTabs.py: handle temple not set for LdsOrd, provide list of + default types * src/RelLib/_LdsOrd.py: unserialize returns self * src/RelLib/_LdsOrdBase.py: variable name change diff --git a/gramps2/src/DisplayTabs.py b/gramps2/src/DisplayTabs.py index be28095dd..4ad9d39af 100644 --- a/gramps2/src/DisplayTabs.py +++ b/gramps2/src/DisplayTabs.py @@ -735,7 +735,19 @@ class PersonEventEmbedList(EventEmbedList): return (RelLib.EventRef.PRIMARY,'') def default_type(self): - return (RelLib.Event.BIRTH,'') + type_list = [] + ref_list = [ e for e in [self.obj.get_birth_ref(), self.obj.get_death_ref()] + \ + self.obj.get_event_ref_list() if e ] + + for event_ref in ref_list: + event = self.dbstate.db.get_event_from_handle(event_ref.ref) + type_list.append(event.get_type()[0]) + + for etype in [RelLib.Event.BIRTH, RelLib.Event.DEATH]: + if etype not in type_list: + return (etype,'') + else: + return (RelLib.Event.BIRTH,'') def get_ref_editor(self): from Editors import EditEventRef