From d3d51677f9bd72efeb76eee81ef0e519c6736e57 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Wed, 28 Aug 2019 16:03:32 +0200 Subject: [PATCH 1/3] Reduce the size of the sexuality symbol in relview Fixes #11295 --- gramps/plugins/view/relview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index b340349a6..bf403e474 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -891,7 +891,7 @@ class RelationshipView(NavigationView): else: symbol = self.homof if markup: - msg = '%s' % symbol + msg = '%s' % symbol else: msg = symbol else: From 69261509ee89bb861c07afbda5400a3552eeab4a Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Wed, 28 Aug 2019 21:16:02 +0200 Subject: [PATCH 2/3] Set good symbols for marriage, baptism, cremation and burial --- gramps/plugins/view/relview.py | 41 ++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index bf403e474..7b038ee3c 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -189,6 +189,8 @@ class RelationshipView(NavigationView): self.male = gsfs(self.symbols.SYMBOL_MALE) self.female = gsfs(self.symbols.SYMBOL_FEMALE) self.bth = gsfs(self.symbols.SYMBOL_BIRTH) + self.bptsm = gsfs(self.symbols.SYMBOL_BAPTISM) + self.marriage = gsfs(self.symbols.SYMBOL_MARRIAGE) self.marr = gsfs(self.symbols.SYMBOL_HETEROSEXUAL) self.homom = gsfs(self.symbols.SYMBOL_MALE_HOMOSEXUAL) self.homof = gsfs(self.symbols.SYMBOL_LESBIAN) @@ -196,11 +198,15 @@ class RelationshipView(NavigationView): self.unmarr = gsfs(self.symbols.SYMBOL_UNMARRIED_PARTNERSHIP) death_idx = self.uistate.death_symbol self.dth = self.symbols.get_death_symbol_for_char(death_idx) + self.burial = gsfs(self.symbols.SYMBOL_BURIED) + self.cremation = gsfs(self.symbols.SYMBOL_CREMATED) else: gsf = self.symbols.get_symbol_fallback self.male = gsf(self.symbols.SYMBOL_MALE) self.female = gsf(self.symbols.SYMBOL_FEMALE) self.bth = gsf(self.symbols.SYMBOL_BIRTH) + self.bptsm = gsf(self.symbols.SYMBOL_BAPTISM) + self.marriage = gsf(self.symbols.SYMBOL_MARRIAGE) self.marr = gsf(self.symbols.SYMBOL_HETEROSEXUAL) self.homom = gsf(self.symbols.SYMBOL_MALE_HOMOSEXUAL) self.homof = gsf(self.symbols.SYMBOL_LESBIAN) @@ -208,6 +214,8 @@ class RelationshipView(NavigationView): self.unmarr = gsf(self.symbols.SYMBOL_UNMARRIED_PARTNERSHIP) death_idx = self.symbols.DEATH_SYMBOL_LATIN_CROSS self.dth = self.symbols.get_death_symbol_fallback(death_idx) + self.burial = gsf(self.symbols.SYMBOL_BURIED) + self.cremation = gsf(self.symbols.SYMBOL_CREMATED) def font_changed(self): self.reload_symbols() @@ -1353,6 +1361,11 @@ class RelationshipView(NavigationView): return None birth = get_birth_or_fallback(self.dbstate.db, person) + if birth: + if birth.get_type() == EventType.BAPTISM: + s_birth = self.bptsm + else: + s_birth = self.bth if birth and birth.get_type() != EventType.BIRTH: sdate = get_date(birth) if sdate: @@ -1365,6 +1378,13 @@ class RelationshipView(NavigationView): bdate = "" death = get_death_or_fallback(self.dbstate.db, person) + if death: + if death.get_type() == EventType.BURIAL: + s_death = self.burial + elif death.get_type() == EventType.CREMATION: + s_death = self.cremation + else: + s_death = self.dth if death and death.get_type() != EventType.DEATH: sdate = get_date(death) if sdate: @@ -1378,15 +1398,15 @@ class RelationshipView(NavigationView): if bdate and ddate: value = _("%(birthabbrev)s %(birthdate)s, %(deathabbrev)s %(deathdate)s") % { - 'birthabbrev': self.bth, - 'deathabbrev': self.dth, + 'birthabbrev': s_birth, + 'deathabbrev': s_death, 'birthdate' : bdate, 'deathdate' : ddate } elif bdate: - value = _("%(event)s %(date)s") % {'event': self.bth, 'date': bdate} + value = _("%(event)s %(date)s") % {'event': s_birth, 'date': bdate} elif ddate: - value = _("%(event)s %(date)s") % {'event': self.dth, 'date': ddate} + value = _("%(event)s %(date)s") % {'event': s_death, 'date': ddate} else: value = "" return value @@ -1457,10 +1477,7 @@ class RelationshipView(NavigationView): (event_ref.get_role() == EventRoleType.FAMILY or event_ref.get_role() == EventRoleType.PRIMARY)): if event.get_type() == EventType.MARRIAGE: - msg = self.marriage_symbol(family, markup=False) - etype = msg - elif event.get_type() == EventType.DIVORCE: - etype = self.divorce + etype = self.marriage elif event.get_type() == EventType.DIVORCE: etype = self.divorce else: @@ -1492,19 +1509,19 @@ class RelationshipView(NavigationView): if dobj: if pname: self.write_data( - vbox, _('%(event_type)s: %(date)s in %(place)s') % + vbox, _('%(event_type)s %(date)s in %(place)s') % value, start_col, stop_col, True) else: self.write_data( - vbox, _('%(event_type)s: %(date)s') % value, + vbox, _('%(event_type)s %(date)s') % value, start_col, stop_col) elif pname: self.write_data( - vbox, _('%(event_type)s: %(place)s') % value, + vbox, _('%(event_type)s %(place)s') % value, start_col, stop_col) else: self.write_data( - vbox, '%(event_type)s:' % value, start_col, stop_col) + vbox, '%(event_type)s' % value, start_col, stop_col) def write_family(self, family_handle, person = None): family = self.dbstate.db.get_family_from_handle(family_handle) From 29994242c747c54cd7b5983bb726ab281d294eed Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 2 Sep 2019 23:04:05 +0200 Subject: [PATCH 3/3] Set symbols for the active person --- gramps/plugins/view/relview.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index 7b038ee3c..ccfabde66 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -736,20 +736,28 @@ class RelationshipView(NavigationView): # Birth event. birth = get_birth_or_fallback(self.dbstate.db, person) if birth: - birth_title = birth.get_type() + if birth.get_type() == EventType.BAPTISM: + birth_title = self.bptsm + else: + birth_title = self.bth else: - birth_title = _("Birth") + birth_title = self.bth - subgrid.attach(widgets.BasicLabel(_("%s:") % birth_title), 1, 1, 1, 1) + subgrid.attach(widgets.BasicLabel(_("%s") % birth_title), 1, 1, 1, 1) birthwidget = widgets.BasicLabel(self.format_event(birth)) birthwidget.set_selectable(True) subgrid.attach(birthwidget, 2, 1, 1, 1) death = get_death_or_fallback(self.dbstate.db, person) if death: - death_title = death.get_type() + if death.get_type() == EventType.BURIAL: + death_title = self.burial + elif death.get_type() == EventType.CREMATION: + death_title = self.cremation + else: + death_title = self.dth else: - death_title = _("Death") + death_title = self.dth showed_death = False if birth: @@ -761,7 +769,7 @@ class RelationshipView(NavigationView): age = (death_date - birth_date).format( precision=self.age_precision) subgrid.attach(widgets.BasicLabel( - _("%s:") % death_title), 1, 2, 1, 1) + _("%s") % death_title), 1, 2, 1, 1) deathwidget = widgets.BasicLabel( "%s (%s)" % (self.format_event(death), age), Pango.EllipsizeMode.END) @@ -778,14 +786,14 @@ class RelationshipView(NavigationView): "(%s)" % age, Pango.EllipsizeMode.END), 2, 2, 1, 1) else: subgrid.attach(widgets.BasicLabel( - _("%s:") % _("Death")), 1, 2, 1, 1) + _("%s") % self.dth), 1, 2, 1, 1) subgrid.attach(widgets.BasicLabel( "%s (%s)" % (_("unknown"), age), Pango.EllipsizeMode.END), 2, 2, 1, 1) showed_death = True if not showed_death: - subgrid.attach(widgets.BasicLabel(_("%s:") % death_title), + subgrid.attach(widgets.BasicLabel(_("%s") % death_title), 1, 2, 1, 1) deathwidget = widgets.BasicLabel(self.format_event(death)) deathwidget.set_selectable(True)