From ed324676f0fcb4fd3446c6cbfe1e1a66e7419229 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Thu, 28 Apr 2016 12:19:33 -0700 Subject: [PATCH] add "living people" option to the Fan Chart report --- gramps/plugins/drawreport/fanchart.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gramps/plugins/drawreport/fanchart.py b/gramps/plugins/drawreport/fanchart.py index 3449e7570..c37bd0139 100644 --- a/gramps/plugins/drawreport/fanchart.py +++ b/gramps/plugins/drawreport/fanchart.py @@ -167,13 +167,19 @@ class FanChart(Report): draw_empty - draw background when there is no information same_style - use the same style for all generation incl_private - Whether to include private data + living_people - How to handle living people + years_past_death - Consider as living this many years after death """ Report.__init__(self, database, options, user) menu = options.menu + lang = options.menu.get_option_by_name('trans').get_value() + rlocale = self.set_locale(lang) + stdoptions.run_private_data_option(self, menu) + stdoptions.run_living_people_option(self, menu, rlocale) self.max_generations = menu.get_option_by_name('maxgen').get_value() self.circle = menu.get_option_by_name('circle').get_value() @@ -183,7 +189,7 @@ class FanChart(Report): self.draw_empty = menu.get_option_by_name('draw_empty').get_value() self.same_style = menu.get_option_by_name('same_style').get_value() self.center_person = self.database.get_person_from_gramps_id(pid) - if (self.center_person == None) : + if self.center_person is None: raise ReportError(_("Person %s is not in the Database") % pid ) self.graphic_style = [] @@ -198,8 +204,6 @@ class FanChart(Report): self.map = [None] * 2**self.max_generations self.text = {} - self.set_locale(menu.get_option_by_name('trans').get_value()) - def apply_filter(self,person_handle,index): """traverse the ancestors recursively until either the end of a line is found, or until we reach the maximum number of @@ -655,6 +659,8 @@ class FanChartOptions(MenuReportOptions): stdoptions.add_private_data_option(menu, category_name) + stdoptions.add_living_people_option(menu, category_name) + max_gen = NumberOption(_("Generations"), 5, 1, self.MAX_GENERATIONS) max_gen.set_help(_("The number of generations " "to include in the report"))