default types for events

svn: r6278
This commit is contained in:
Don Allingham 2006-04-06 04:10:30 +00:00
parent c7c18cb044
commit c5949857fa
2 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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