* src/DisplayTabs.py: check of event==None when determining default type

svn: r6465
This commit is contained in:
Don Allingham 2006-04-27 17:20:19 +00:00
parent 2713516e97
commit f4a15e1b15
2 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,5 @@
2006-04-27 Don Allingham <don@gramps-project.org> 2006-04-27 Don Allingham <don@gramps-project.org>
* src/DisplayTabs.py: check of event==None when determining default type
* src/ViewManager.py: support for keypress events * src/ViewManager.py: support for keypress events
* src/gramps.py: fix gnome init * src/gramps.py: fix gnome init

View File

@ -742,16 +742,17 @@ class PersonEventEmbedList(EventEmbedList):
ref_list = [ e for e in [self.obj.get_birth_ref(), self.obj.get_death_ref()] + \ ref_list = [ e for e in [self.obj.get_birth_ref(), self.obj.get_death_ref()] + \
self.obj.get_event_ref_list() if e ] self.obj.get_event_ref_list() if e ]
event = None
for event_ref in ref_list: for event_ref in ref_list:
event = self.dbstate.db.get_event_from_handle(event_ref.ref) event = self.dbstate.db.get_event_from_handle(event_ref.ref)
type_list.append(int(event.get_type())) type_list.append(int(event.get_type()))
etype = event.get_type() if event:
for etype in [RelLib.EventType.BIRTH, RelLib.EventType.DEATH]: etype = event.get_type()
if etype not in type_list: for etype in [RelLib.EventType.BIRTH, RelLib.EventType.DEATH]:
return RelLib.EventType(etype) if etype not in type_list:
else: return RelLib.EventType(etype)
return RelLib.EventType(RelLib.EventType.BIRTH) return RelLib.EventType(RelLib.EventType.BIRTH)
def get_ref_editor(self): def get_ref_editor(self):
from Editors import EditEventRef from Editors import EditEventRef