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."))
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'

View File

@ -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,