Provide birth/death fallback at other places too.
svn: r7577
This commit is contained in:
parent
54351adc6e
commit
6a6d742f52
@ -679,7 +679,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
if self.show_details:
|
if self.show_details:
|
||||||
value = self.info_string(handle)
|
value = self.info_string(handle)
|
||||||
if value:
|
if value:
|
||||||
vbox.pack_start(GrampsWidgets.BasicLabel(value))
|
vbox.pack_start(GrampsWidgets.MarkupLabel(value))
|
||||||
|
|
||||||
eventbox = gtk.EventBox()
|
eventbox = gtk.EventBox()
|
||||||
if self.use_shade:
|
if self.use_shade:
|
||||||
@ -720,7 +720,7 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
if self.show_details:
|
if self.show_details:
|
||||||
value = self.info_string(handle)
|
value = self.info_string(handle)
|
||||||
if value:
|
if value:
|
||||||
l = GrampsWidgets.BasicLabel(value)
|
l = GrampsWidgets.MarkupLabel(value)
|
||||||
l.set_padding(16, 0)
|
l.set_padding(16, 0)
|
||||||
vbox.add(l)
|
vbox.add(l)
|
||||||
|
|
||||||
@ -732,13 +732,46 @@ class RelationshipView(PageView.PersonNavView):
|
|||||||
child = self.dbstate.db.get_person_from_handle(handle)
|
child = self.dbstate.db.get_person_from_handle(handle)
|
||||||
if not child:
|
if not child:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
birth_ref = child.get_birth_ref()
|
birth_ref = child.get_birth_ref()
|
||||||
|
birth = None
|
||||||
|
birth_fallback = False
|
||||||
|
if birth_ref:
|
||||||
|
birth = self.dbstate.db.get_event_from_handle(birth_ref.ref)
|
||||||
|
else:
|
||||||
|
for event_ref in child.get_event_ref_list():
|
||||||
|
event = self.dbstate.db.get_event_from_handle(event_ref.ref)
|
||||||
|
if event.get_type() in [RelLib.EventType.CHRISTEN, RelLib.EventType.BAPTISM]:
|
||||||
|
birth = event
|
||||||
|
birth_fallback = True
|
||||||
|
break
|
||||||
|
|
||||||
death_ref = child.get_death_ref()
|
death_ref = child.get_death_ref()
|
||||||
value = None
|
death = None
|
||||||
if birth_ref or death_ref:
|
death_fallback = False
|
||||||
info = ReportUtils.get_birth_death_strings(self.dbstate.db, child)
|
if death_ref:
|
||||||
bdate = info[0]
|
death = self.dbstate.db.get_event_from_handle(death_ref.ref)
|
||||||
ddate = info[4]
|
else:
|
||||||
|
for event_ref in child.get_event_ref_list():
|
||||||
|
event = self.dbstate.db.get_event_from_handle(event_ref.ref)
|
||||||
|
if event.get_type() in [RelLib.EventType.BURIAL, RelLib.EventType.CREMATION]:
|
||||||
|
death = event
|
||||||
|
death_fallback = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if birth and birth_fallback:
|
||||||
|
bdate = "<i>%s</i>" % birth.get_date_object()
|
||||||
|
elif birth:
|
||||||
|
bdate = birth.get_date_object()
|
||||||
|
else:
|
||||||
|
bdate = ""
|
||||||
|
if death and death_fallback:
|
||||||
|
ddate = "<i>%s</i>" % death.get_date_object()
|
||||||
|
elif death:
|
||||||
|
ddate = death.get_date_object()
|
||||||
|
else:
|
||||||
|
ddate = ""
|
||||||
|
|
||||||
if bdate and ddate:
|
if bdate and ddate:
|
||||||
value = _("b. %s, d. %s") % (bdate, ddate)
|
value = _("b. %s, d. %s") % (bdate, ddate)
|
||||||
elif bdate:
|
elif bdate:
|
||||||
|
Loading…
Reference in New Issue
Block a user