diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index db5006959..7718a226e 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -782,9 +782,6 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): def date_calendar_changed(self, obj): config.set('preferences.calendar-format-report', obj.get_active()) - OkDialog(_('Change is not immediate'), - _('Changing the data format will not take ' - 'effect until the next time Gramps is started.')) def add_date_panel(self): table = gtk.Table(2, 7) diff --git a/src/plugins/drawreport/FanChart.py b/src/plugins/drawreport/FanChart.py index 27a942a4b..0e0328e0a 100644 --- a/src/plugins/drawreport/FanChart.py +++ b/src/plugins/drawreport/FanChart.py @@ -166,6 +166,8 @@ class FanChart(Report): self.background_style.append(background_style_name) text_style_name = 'text_style' + '%d' % i self.text_style.append(text_style_name) + + self.calendar = 0 Report.__init__(self, database, options_class) @@ -268,11 +270,12 @@ class FanChart(Report): def get_info(self,person_handle,generation): person = self.database.get_person_from_handle(person_handle) pn = person.get_primary_name() + self.calendar = config.get('preferences.calendar-format-report') birth_ref = person.get_birth_ref() if birth_ref: birth = self.database.get_event_from_handle(birth_ref.ref) - b = birth.get_date_object().to_calendar(cal).get_year() + b = birth.get_date_object().to_calendar(self.calendar).get_year() if b == 0: b = "" else: @@ -281,7 +284,7 @@ class FanChart(Report): death_ref = person.get_death_ref() if death_ref: death = self.database.get_event_from_handle(death_ref.ref) - d = death.get_date_object().to_calendar(cal).get_year() + d = death.get_date_object().to_calendar(self.calendar).get_year() if d == 0: d = "" else: diff --git a/src/plugins/drawreport/TimeLine.py b/src/plugins/drawreport/TimeLine.py index f6ca1a960..d3dc1f887 100644 --- a/src/plugins/drawreport/TimeLine.py +++ b/src/plugins/drawreport/TimeLine.py @@ -104,6 +104,7 @@ class TimeLine(Report): sort_functions = _get_sort_functions(Sort.Sort(database)) self.sort_name = sort_functions[sort_func_num][0] self.sort_func = sort_functions[sort_func_num][1] + self.calendar = 0 def write_report(self): self.progress = ProgressMeter(_('Timeline')) @@ -143,18 +144,20 @@ class TimeLine(Report): self.plist.sort(key=self.sort_func) self.progress.set_pass(_('Calculating timeline...'), len(self.plist)) + self.calendar = config.get('preferences.calendar-format-report') + for p_id in self.plist: self.progress.step() p = self.database.get_person_from_handle(p_id) birth = get_birth_or_fallback(self.database, p) if birth: - b = birth.get_date_object().to_calendar(cal).get_year() + b = birth.get_date_object().to_calendar(self.calendar).get_year() else: b = None death = get_death_or_fallback(self.database, p) if death: - d = death.get_date_object().to_calendar(cal).get_year() + d = death.get_date_object().to_calendar(self.calendar).get_year() else: d = None @@ -244,18 +247,20 @@ class TimeLine(Report): self.plist = self.filter.apply(self.database, self.database.iter_person_handles()) + + self.calendar = config.get('preferences.calendar-format-report') for p_id in self.plist: p = self.database.get_person_from_handle(p_id) birth = get_birth_or_fallback(self.database, p) if birth: - b = birth.get_date_object().to_calendar(cal).get_year() + b = birth.get_date_object().to_calendar(self.calendar).get_year() else: b = None death = get_death_or_fallback(self.database, p) if death: - d = death.get_date_object().to_calendar(cal).get_year() + d = death.get_date_object().to_calendar(self.calendar).get_year() else: d = None