2006-05-05 06:09:11 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
|
|
|
# Copyright (C) 2000-2006 Donald N. Allingham
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GRAMPS classes
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2007-10-08 22:11:39 +05:30
|
|
|
import gen.lib
|
2006-05-05 06:09:11 +05:30
|
|
|
from _EventEmbedList import EventEmbedList
|
|
|
|
|
2006-05-16 03:29:14 +05:30
|
|
|
_std_types = [
|
2007-10-08 22:11:39 +05:30
|
|
|
gen.lib.EventType(gen.lib.EventType.BIRTH),
|
|
|
|
gen.lib.EventType(gen.lib.EventType.DEATH),
|
2006-05-16 03:29:14 +05:30
|
|
|
]
|
|
|
|
|
|
|
|
|
2006-05-05 06:09:11 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# PersonEventEmbedList
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
class PersonEventEmbedList(EventEmbedList):
|
|
|
|
|
|
|
|
def __init__(self, dbstate, uistate, track, obj):
|
|
|
|
EventEmbedList.__init__(self, dbstate, uistate, track, obj)
|
|
|
|
|
|
|
|
def get_data(self):
|
2006-05-24 02:37:26 +05:30
|
|
|
return self.obj.get_event_ref_list()
|
2006-05-05 06:09:11 +05:30
|
|
|
|
|
|
|
def default_role(self):
|
2007-10-08 22:11:39 +05:30
|
|
|
return gen.lib.EventRoleType(gen.lib.EventRoleType.PRIMARY)
|
2006-05-05 06:09:11 +05:30
|
|
|
|
|
|
|
def default_type(self):
|
|
|
|
type_list = []
|
|
|
|
|
2006-05-21 23:47:52 +05:30
|
|
|
# combine return info into a single flat sequence
|
2006-05-24 02:37:26 +05:30
|
|
|
|
2006-05-05 06:09:11 +05:30
|
|
|
event = None
|
2006-05-24 02:37:26 +05:30
|
|
|
for event_ref in self.get_data():
|
2006-05-05 06:09:11 +05:30
|
|
|
event = self.dbstate.db.get_event_from_handle(event_ref.ref)
|
2006-05-16 03:29:14 +05:30
|
|
|
type_list.append(event.get_type())
|
2006-05-05 06:09:11 +05:30
|
|
|
|
2006-05-16 03:29:14 +05:30
|
|
|
for etype in _std_types:
|
|
|
|
if etype not in type_list:
|
2007-10-08 22:11:39 +05:30
|
|
|
return gen.lib.EventType(etype)
|
|
|
|
return gen.lib.EventType(gen.lib.EventType.BIRTH)
|
2006-05-05 06:09:11 +05:30
|
|
|
|
|
|
|
def get_ref_editor(self):
|
|
|
|
from Editors import EditEventRef
|
|
|
|
return EditEventRef
|
|
|
|
|