Enable or disable justyears menu option depending on whether dates should be included

svn: r11724
This commit is contained in:
Gary Burton 2009-01-25 20:39:02 +00:00
parent ffc025aeca
commit 4f32dea6bc
2 changed files with 38 additions and 18 deletions

View File

@ -225,16 +225,17 @@ class FamilyLinesOptions(MenuReportOptions):
"in longer lines and larger graphs.")) "in longer lines and larger graphs."))
menu.add_option(category, "usesubgraphs", use_subgraphs) menu.add_option(category, "usesubgraphs", use_subgraphs)
include_dates = BooleanOption(_('Include dates'), True) self.include_dates = BooleanOption(_('Include dates'), True)
include_dates.set_help(_('Whether to include dates for people and ' \ self.include_dates.set_help(_('Whether to include dates for people ' \
'families.')) 'and families.'))
menu.add_option(category, 'incdates', include_dates) 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) self.justyears = BooleanOption(_("Limit dates to years only"), False)
justyears.set_help(_("Prints just dates' year, neither " self.justyears.set_help(_("Prints just dates' year, neither "
"month or day nor date approximation " "month or day nor date approximation "
"or interval are shown.")) "or interval are shown."))
menu.add_option(category, "justyears", justyears) menu.add_option(category, "justyears", self.justyears)
include_places = BooleanOption(_('Include places'), True) include_places = BooleanOption(_('Include places'), True)
include_places.set_help(_('Whether to include placenames for people ' \ 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()) 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' # FamilyLinesReport -- created once the user presses 'OK'

View File

@ -441,17 +441,18 @@ class RelGraphOptions(MenuReportOptions):
self.__update_filters() self.__update_filters()
incdate = BooleanOption( self.incdate = BooleanOption(
_("Include Birth, Marriage and Death dates"), True) _("Include Birth, Marriage and Death dates"), True)
incdate.set_help(_("Include the dates that the individual was born, " self.incdate.set_help(_("Include the dates that the individual was "
"got married and/or died in the graph labels.")) "born, got married and/or died in the graph labels."))
menu.add_option(category_name, "incdate", incdate) 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) self.justyears = BooleanOption(_("Limit dates to years only"), False)
justyears.set_help(_("Prints just dates' year, neither " self.justyears.set_help(_("Prints just dates' year, neither "
"month or day nor date approximation " "month or day nor date approximation "
"or interval are shown.")) "or interval are shown."))
menu.add_option(category_name, "justyears", justyears) menu.add_option(category_name, "justyears", self.justyears)
use_place = BooleanOption(_("Use place when no date"), True) use_place = BooleanOption(_("Use place when no date"), True)
use_place.set_help(_("When no birth, marriage, or death date is " 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) filter_list = ReportUtils.get_person_filters(person, False)
self.__filter.set_filters(filter_list) 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): def __filter_changed(self):
""" """
Handle filter change. If the filter is not specific to a person, Handle filter change. If the filter is not specific to a person,