Skip to content

Commit

Permalink
Add option that allows to use the name of the individual as title.
Browse files Browse the repository at this point in the history
  • Loading branch information
tengel authored and prculley committed Apr 13, 2020
1 parent 67b8379 commit 32230d6
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions gramps/plugins/textreport/indivcomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def __init__(self, database, options, user):

self.sort = menu.get_option_by_name('sort').get_value()

self.name_is_title = menu.get_option_by_name('name_is_title').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_gramps_id = menu.get_option_by_name('inc_id').get_value()
Expand Down Expand Up @@ -853,16 +855,20 @@ def write_person(self, count):
self.bibli = Bibliography(
Bibliography.MODE_DATE|Bibliography.MODE_PAGE)

title1 = self._("Complete Individual Report")
text2 = self._name_display.display(self.person)
if self.name_is_title:
title1 = self._name_display.display(self.person)
else:
title1 = self._("Complete Individual Report")
text2 = self._name_display.display(self.person)
mark2 = IndexMark(text2, INDEX_TYPE_TOC, 2)
mark1 = IndexMark(title1, INDEX_TYPE_TOC, 1)
mark2 = IndexMark(text2, INDEX_TYPE_TOC, 2)
self.doc.start_paragraph("IDS-Title")
self.doc.write_text(title1, mark1)
self.doc.end_paragraph()
self.doc.start_paragraph("IDS-Title")
self.doc.write_text(text2, mark2)
self.doc.end_paragraph()
if not self.name_is_title:
self.doc.start_paragraph("IDS-Title")
self.doc.write_text(text2, mark2)
self.doc.end_paragraph()

self.doc.start_paragraph("IDS-Normal")
self.doc.end_paragraph()
Expand Down Expand Up @@ -1079,6 +1085,11 @@ def add_menu_options(self, menu):
_("Whether to start a new page before the end notes."))
menu.add_option(category_name, "pageben", pageben)

name_is_title = BooleanOption(_("Use name of person as title"), False)
name_is_title.set_help(_("Whether the title should be the name of the "
"person, or 'Complete Individual Report'"))
menu.add_option(category_name, "name_is_title", name_is_title)

################################
category_name = _("Report Options (2)")
################################
Expand Down

0 comments on commit 32230d6

Please sign in to comment.