add "living people" option to the Fan Chart report

This commit is contained in:
Paul Franklin
2016-04-28 12:19:33 -07:00
parent 2f31096abd
commit ed324676f0

View File

@@ -167,13 +167,19 @@ class FanChart(Report):
draw_empty - draw background when there is no information draw_empty - draw background when there is no information
same_style - use the same style for all generation same_style - use the same style for all generation
incl_private - Whether to include private data 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) Report.__init__(self, database, options, user)
menu = options.menu 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_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.max_generations = menu.get_option_by_name('maxgen').get_value()
self.circle = menu.get_option_by_name('circle').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.draw_empty = menu.get_option_by_name('draw_empty').get_value()
self.same_style = menu.get_option_by_name('same_style').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) 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 ) raise ReportError(_("Person %s is not in the Database") % pid )
self.graphic_style = [] self.graphic_style = []
@@ -198,8 +204,6 @@ class FanChart(Report):
self.map = [None] * 2**self.max_generations self.map = [None] * 2**self.max_generations
self.text = {} self.text = {}
self.set_locale(menu.get_option_by_name('trans').get_value())
def apply_filter(self,person_handle,index): def apply_filter(self,person_handle,index):
"""traverse the ancestors recursively until either the end """traverse the ancestors recursively until either the end
of a line is found, or until we reach the maximum number of 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_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 = NumberOption(_("Generations"), 5, 1, self.MAX_GENERATIONS)
max_gen.set_help(_("The number of generations " max_gen.set_help(_("The number of generations "
"to include in the report")) "to include in the report"))