enable C.I.R. to include or exclude Person and Family Notes

This commit is contained in:
Paul Franklin 2016-05-28 15:40:02 -07:00
parent e84f09b55e
commit af2f29322e

View File

@ -113,6 +113,7 @@ class IndivCompleteReport(Report):
incl_private - Whether to include private data incl_private - Whether to include private data
incl_attrs - Whether to include attributes incl_attrs - Whether to include attributes
incl_census - Whether to include census events incl_census - Whether to include census events
incl_notes - Whether to include person and family notes
incl_tags - Whether to include tags incl_tags - Whether to include tags
living_people - How to handle living people living_people - How to handle living people
years_past_death - Consider as living this many years after death years_past_death - Consider as living this many years after death
@ -140,6 +141,7 @@ class IndivCompleteReport(Report):
self.use_gramps_id = menu.get_option_by_name('grampsid').get_value() self.use_gramps_id = menu.get_option_by_name('grampsid').get_value()
self.use_attrs = menu.get_option_by_name('incl_attrs').get_value() self.use_attrs = menu.get_option_by_name('incl_attrs').get_value()
self.use_census = menu.get_option_by_name('incl_census').get_value() self.use_census = menu.get_option_by_name('incl_census').get_value()
self.use_notes = menu.get_option_by_name('incl_notes').get_value()
self.use_tags = menu.get_option_by_name('incl_tags').get_value() self.use_tags = menu.get_option_by_name('incl_tags').get_value()
filter_option = options.menu.get_option_by_name('filter') filter_option = options.menu.get_option_by_name('filter')
@ -231,7 +233,7 @@ class IndivCompleteReport(Report):
def write_note(self): def write_note(self):
notelist = self.person.get_note_list() notelist = self.person.get_note_list()
notelist += self.family_notes_list notelist += self.family_notes_list
if not notelist: if not notelist or not self.use_notes:
return return
self.doc.start_table('note','IDS-IndTable') self.doc.start_table('note','IDS-IndTable')
self.doc.start_row() self.doc.start_row()
@ -943,6 +945,8 @@ class IndivCompleteOptions(MenuReportOptions):
self.__db = dbase self.__db = dbase
self.__pid = None self.__pid = None
self.__filter = None self.__filter = None
self.__cites = None
self.__incsrcnotes = None
MenuReportOptions.__init__(self, name, dbase) MenuReportOptions.__init__(self, name, dbase)
def add_menu_options(self, menu): def add_menu_options(self, menu):
@ -985,14 +989,18 @@ class IndivCompleteOptions(MenuReportOptions):
category_name = _("Include") category_name = _("Include")
################################ ################################
cites = BooleanOption(_("Include Source Information"), True) self.__cites = BooleanOption(_("Include Source Information"), True)
cites.set_help(_("Whether to cite sources.")) self.__cites.set_help(_("Whether to cite sources."))
menu.add_option(category_name, "cites", cites) menu.add_option(category_name, "cites", self.__cites)
self.__cites.connect('value-changed', self.__sources_changed)
incsrcnotes = BooleanOption(_("Include sources notes"), False) self.__incsrcnotes = BooleanOption(_("Include sources notes"), False)
incsrcnotes.set_help(_("Whether to include source notes in the " self.__incsrcnotes.set_help(
"Endnotes section. Only works if Include sources is selected.")) _("Whether to include source notes in the Endnotes section. "
menu.add_option(category_name, "incsrcnotes", incsrcnotes) "Only works if Include sources is selected."))
menu.add_option(category_name, "incsrcnotes", self.__incsrcnotes)
self.__incsrcnotes.connect('value-changed', self.__sources_changed)
self.__sources_changed()
images = BooleanOption(_("Include Photo/Images from Gallery"), True) images = BooleanOption(_("Include Photo/Images from Gallery"), True)
images.set_help(_("Whether to include images.")) images.set_help(_("Whether to include images."))
@ -1010,6 +1018,10 @@ class IndivCompleteOptions(MenuReportOptions):
grampsid.set_help(_("Whether to include Gramps ID next to names.")) grampsid.set_help(_("Whether to include Gramps ID next to names."))
menu.add_option(category_name, "grampsid", grampsid) menu.add_option(category_name, "grampsid", grampsid)
incl_notes = BooleanOption(_("Include Notes"), True)
incl_notes.set_help(_("Whether to include Person and Family Notes."))
menu.add_option(category_name, "incl_notes", incl_notes)
tags = BooleanOption(_("Include Tags"), True) tags = BooleanOption(_("Include Tags"), True)
tags.set_help(_("Whether to include tags.")) tags.set_help(_("Whether to include tags."))
menu.add_option(category_name, "incl_tags", tags) menu.add_option(category_name, "incl_tags", tags)
@ -1051,6 +1063,16 @@ class IndivCompleteOptions(MenuReportOptions):
# The rest don't # The rest don't
self.__pid.set_available(False) self.__pid.set_available(False)
def __sources_changed(self):
"""
If Endnotes are not enabled, disable sources in the Endnotes.
"""
cites_value = self.__cites.get_value()
if cites_value:
self.__incsrcnotes.set_available(True)
else:
self.__incsrcnotes.set_available(False)
def make_default_style(self, default_style): def make_default_style(self, default_style):
"""Make the default output style for the Individual Complete Report.""" """Make the default output style for the Individual Complete Report."""
# Paragraph Styles # Paragraph Styles