* src/DataViews/_PedigreeView.py,

* src/DataViews/_RelationView.py,
* src/DisplayModels/_PeopleModel.py: Only show fallbacks for birth and death if role=primary



svn: r7605
This commit is contained in:
Martin Hawlisch 2006-11-10 16:23:11 +00:00
parent d2ae1cfb27
commit 3bff15e1a8
4 changed files with 26 additions and 10 deletions

View File

@ -1,5 +1,9 @@
2006-11-10 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2006-11-10 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/plugins/ImportGeneWeb.py: Start parsing titles of a person * src/plugins/ImportGeneWeb.py: Start parsing titles of a person
* src/DataViews/_PedigreeView.py,
* src/DataViews/_RelationView.py,
* src/DisplayModels/_PeopleModel.py: Only show fallbacks for birth
and death if role=primary
2006-11-09 Alex Roitman <shura@gramps-project.org> 2006-11-09 Alex Roitman <shura@gramps-project.org>
* src/Filters/Rules/Person/_HasDeath.py (apply): Match any of the * src/Filters/Rules/Person/_HasDeath.py (apply): Match any of the

View File

@ -399,7 +399,8 @@ class FormattingHelper:
else: else:
for event_ref in person.get_event_ref_list(): for event_ref in person.get_event_ref_list():
event = self.dbstate.db.get_event_from_handle(event_ref.ref) event = self.dbstate.db.get_event_from_handle(event_ref.ref)
if event.get_type() in [RelLib.EventType.CHRISTEN, RelLib.EventType.BAPTISM]: if event.get_type() in [RelLib.EventType.CHRISTEN, RelLib.EventType.BAPTISM] and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
birth = event birth = event
birth_fallback = True birth_fallback = True
break break
@ -412,7 +413,8 @@ class FormattingHelper:
else: else:
for event_ref in person.get_event_ref_list(): for event_ref in person.get_event_ref_list():
event = self.dbstate.db.get_event_from_handle(event_ref.ref) event = self.dbstate.db.get_event_from_handle(event_ref.ref)
if event.get_type() in [RelLib.EventType.BURIAL, RelLib.EventType.CREMATION]: if event.get_type() in [RelLib.EventType.BURIAL, RelLib.EventType.CREMATION] and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
death = event death = event
death_fallback = True death_fallback = True
break break

View File

@ -493,11 +493,13 @@ class RelationshipView(PageView.PersonNavView):
else: else:
for event_ref in person.get_event_ref_list(): for event_ref in person.get_event_ref_list():
event = self.dbstate.db.get_event_from_handle(event_ref.ref) event = self.dbstate.db.get_event_from_handle(event_ref.ref)
if event.get_type() == RelLib.EventType.CHRISTEN: if event.get_type() == RelLib.EventType.CHRISTEN and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
birth_title = _('Christening') birth_title = _('Christening')
birth = event birth = event
break break
if event.get_type() == RelLib.EventType.BAPTISM: if event.get_type() == RelLib.EventType.BAPTISM and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
birth_title = _('Baptism') birth_title = _('Baptism')
birth = event birth = event
break break
@ -515,11 +517,13 @@ class RelationshipView(PageView.PersonNavView):
else: else:
for event_ref in person.get_event_ref_list(): for event_ref in person.get_event_ref_list():
event = self.dbstate.db.get_event_from_handle(event_ref.ref) event = self.dbstate.db.get_event_from_handle(event_ref.ref)
if event.get_type() == RelLib.EventType.BURIAL: if event.get_type() == RelLib.EventType.BURIAL and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
death_title = _('Burial') death_title = _('Burial')
death = event death = event
break break
if event.get_type() == RelLib.EventType.CREMATION: if event.get_type() == RelLib.EventType.CREMATION and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
death_title = _('Cremation') death_title = _('Cremation')
death = event death = event
break break
@ -792,7 +796,8 @@ class RelationshipView(PageView.PersonNavView):
else: else:
for event_ref in child.get_event_ref_list(): for event_ref in child.get_event_ref_list():
event = self.dbstate.db.get_event_from_handle(event_ref.ref) event = self.dbstate.db.get_event_from_handle(event_ref.ref)
if event.get_type() in [RelLib.EventType.CHRISTEN, RelLib.EventType.BAPTISM]: if event.get_type() in [RelLib.EventType.CHRISTEN, RelLib.EventType.BAPTISM] and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
birth = event birth = event
birth_fallback = True birth_fallback = True
break break
@ -805,7 +810,8 @@ class RelationshipView(PageView.PersonNavView):
else: else:
for event_ref in child.get_event_ref_list(): for event_ref in child.get_event_ref_list():
event = self.dbstate.db.get_event_from_handle(event_ref.ref) event = self.dbstate.db.get_event_from_handle(event_ref.ref)
if event.get_type() in [RelLib.EventType.BURIAL, RelLib.EventType.CREMATION]: if event.get_type() in [RelLib.EventType.BURIAL, RelLib.EventType.CREMATION] and\
event_ref.get_role() == RelLib.EventRoleType.PRIMARY:
death = event death = event
death_fallback = True death_fallback = True
break break

View File

@ -455,6 +455,7 @@ class PeopleModel(gtk.GenericTreeModel):
etype = event.get_type() etype = event.get_type()
date_str = DateHandler.get_date(event) date_str = DateHandler.get_date(event)
if (etype in [EventType.BAPTISM, EventType.CHRISTEN] if (etype in [EventType.BAPTISM, EventType.CHRISTEN]
and er.get_role() == RelLib.EventRoleType.PRIMARY
and date_str != ""): and date_str != ""):
return "<i>" + cgi.escape(date_str) + "</i>" return "<i>" + cgi.escape(date_str) + "</i>"
@ -481,6 +482,7 @@ class PeopleModel(gtk.GenericTreeModel):
etype = event.get_type() etype = event.get_type()
date_str = DateHandler.get_date(event) date_str = DateHandler.get_date(event)
if (etype in [EventType.BURIAL, EventType.CREMATION] if (etype in [EventType.BURIAL, EventType.CREMATION]
and er.get_role() == RelLib.EventRoleType.PRIMARY
and date_str != ""): and date_str != ""):
return "<i>" + cgi.escape(date_str) + "</i>" return "<i>" + cgi.escape(date_str) + "</i>"
@ -509,7 +511,8 @@ class PeopleModel(gtk.GenericTreeModel):
er.unserialize(event_ref) er.unserialize(event_ref)
event = self.db.get_event_from_handle(er.ref) event = self.db.get_event_from_handle(er.ref)
etype = event.get_type() etype = event.get_type()
if etype in [EventType.BAPTISM, EventType.CHRISTEN]: if etype in [EventType.BAPTISM, EventType.CHRISTEN]\
and er.get_role() == RelLib.EventRoleType.PRIMARY:
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: if place_handle:
place = self.db.get_place_from_handle(place_handle) place = self.db.get_place_from_handle(place_handle)
@ -542,7 +545,8 @@ class PeopleModel(gtk.GenericTreeModel):
er.unserialize(event_ref) er.unserialize(event_ref)
event = self.db.get_event_from_handle(er.ref) event = self.db.get_event_from_handle(er.ref)
etype = event.get_type() etype = event.get_type()
if etype in [EventType.BURIAL, EventType.CREMATION]: if etype in [EventType.BURIAL, EventType.CREMATION]\
and er.get_role() == RelLib.EventRoleType.PRIMARY:
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: if place_handle:
place = self.db.get_place_from_handle(place_handle) place = self.db.get_place_from_handle(place_handle)