diff --git a/src/plugins/graph/GVFamilyLines.py b/src/plugins/graph/GVFamilyLines.py index 0dd2387fe..d118c04f9 100644 --- a/src/plugins/graph/GVFamilyLines.py +++ b/src/plugins/graph/GVFamilyLines.py @@ -225,16 +225,17 @@ class FamilyLinesOptions(MenuReportOptions): "in longer lines and larger graphs.")) menu.add_option(category, "usesubgraphs", use_subgraphs) - include_dates = BooleanOption(_('Include dates'), True) - include_dates.set_help(_('Whether to include dates for people and ' \ - 'families.')) - menu.add_option(category, 'incdates', include_dates) + self.include_dates = BooleanOption(_('Include dates'), True) + self.include_dates.set_help(_('Whether to include dates for people ' \ + 'and families.')) + menu.add_option(category, 'incdates', self.include_dates) + self.include_dates.connect('value-changed', self.include_dates_changed) - justyears = BooleanOption(_("Limit dates to years only"), False) - justyears.set_help(_("Prints just dates' year, neither " - "month or day nor date approximation " - "or interval are shown.")) - menu.add_option(category, "justyears", justyears) + self.justyears = BooleanOption(_("Limit dates to years only"), False) + self.justyears.set_help(_("Prints just dates' year, neither " + "month or day nor date approximation " + "or interval are shown.")) + menu.add_option(category, "justyears", self.justyears) include_places = BooleanOption(_('Include places'), True) include_places.set_help(_('Whether to include placenames for people ' \ @@ -269,6 +270,15 @@ class FamilyLinesOptions(MenuReportOptions): """ self.image_location.set_available(self.include_images.get_value()) + def include_dates_changed(self): + """ + Enable/disable menu items if dates are required + """ + if self.include_dates.get_value(): + self.justyears.set_available(True) + else: + self.justyears.set_available(False) + #------------------------------------------------------------------------ # # FamilyLinesReport -- created once the user presses 'OK' diff --git a/src/plugins/graph/GVRelGraph.py b/src/plugins/graph/GVRelGraph.py index 91d813f86..c5db32e25 100644 --- a/src/plugins/graph/GVRelGraph.py +++ b/src/plugins/graph/GVRelGraph.py @@ -441,17 +441,18 @@ class RelGraphOptions(MenuReportOptions): self.__update_filters() - incdate = BooleanOption( + self.incdate = BooleanOption( _("Include Birth, Marriage and Death dates"), True) - incdate.set_help(_("Include the dates that the individual was born, " - "got married and/or died in the graph labels.")) - menu.add_option(category_name, "incdate", incdate) + self.incdate.set_help(_("Include the dates that the individual was " + "born, got married and/or died in the graph labels.")) + menu.add_option(category_name, "incdate", self.incdate) + self.incdate.connect('value-changed', self.__include_dates_changed) - justyears = BooleanOption(_("Limit dates to years only"), False) - justyears.set_help(_("Prints just dates' year, neither " - "month or day nor date approximation " - "or interval are shown.")) - menu.add_option(category_name, "justyears", justyears) + self.justyears = BooleanOption(_("Limit dates to years only"), False) + self.justyears.set_help(_("Prints just dates' year, neither " + "month or day nor date approximation " + "or interval are shown.")) + menu.add_option(category_name, "justyears", self.justyears) use_place = BooleanOption(_("Use place when no date"), True) use_place.set_help(_("When no birth, marriage, or death date is " @@ -531,6 +532,15 @@ class RelGraphOptions(MenuReportOptions): filter_list = ReportUtils.get_person_filters(person, False) self.__filter.set_filters(filter_list) + def __include_dates_changed(self): + """ + Enable/disable menu items if dates are required + """ + if self.incdate.get_value(): + self.justyears.set_available(True) + else: + self.justyears.set_available(False) + def __filter_changed(self): """ Handle filter change. If the filter is not specific to a person,