-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gender symbol option to the detailed ancestral report
- Loading branch information
1 parent
ca6205d
commit fa3c2c8
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
# Copyright (C) 2013-2014 Paul Franklin | ||
# Copyright (C) 2014 Gerald Kunzmann <[email protected]> | ||
# Copyright (C) 2017 Robert Carnell <bertcarnell_at_gmail.com> | ||
# Copyright (C) 2024-2025 Dave Khuon | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -70,6 +71,7 @@ | |
from gramps.gen.proxy import CacheProxyDb | ||
from gramps.gen.display.name import displayer as _nd | ||
|
||
|
||
# ------------------------------------------------------------------------ | ||
# | ||
# Constants | ||
|
@@ -105,6 +107,7 @@ def __init__(self, database, options, user): | |
pageben - Whether to include page break before End Notes. | ||
firstName - Whether to use first names instead of pronouns. | ||
fulldate - Whether to use full dates instead of just year. | ||
showgender - Whether to include prepend person name with gender. | ||
listchildren - Whether to list children. | ||
list_children_spouses - Whether to list the spouses of the children | ||
includenotes - Whether to include notes. | ||
|
@@ -147,6 +150,7 @@ def __init__(self, database, options, user): | |
self.pgbrkenotes = get_value("pageben") | ||
self.fulldate = get_value("fulldates") | ||
use_fulldate = self.fulldate | ||
self.showgender = get_value("showgender") | ||
self.listchildren = get_value("listc") | ||
self.list_children_spouses = get_value("listc_spouses") | ||
self.includenotes = get_value("incnotes") | ||
|
@@ -318,6 +322,8 @@ def write_more_header(first, name): | |
mark = utils.get_person_mark(self._db, person) | ||
|
||
self.doc.start_bold() | ||
if self.showgender: | ||
self.doc.write_text(utils.get_gender_symbol(person) + " ") | ||
self.doc.write_text(name, mark) | ||
if name[-1:] == ".": | ||
self.doc.write_text_citation("%s " % self.endnotes(person)) | ||
|
@@ -642,6 +648,8 @@ def write_children(self, family): | |
child_name = self._nd.display(child) | ||
if not child_name: | ||
child_name = self._("Unknown") | ||
if self.showgender: | ||
child_name = utils.get_gender_symbol(child) + " " + child_name | ||
child_mark = utils.get_person_mark(self._db, child) | ||
|
||
if self.childref and self.prev_gen_handles.get(child_handle): | ||
|
@@ -770,6 +778,8 @@ def write_mate(self, person): | |
name = self._("Unknown") | ||
mark = utils.get_person_mark(self._db, ind) | ||
|
||
if self.showgender: | ||
name = utils.get_gender_symbol(ind) + " " + name | ||
if family.get_relationship() == FamilyRelType.MARRIED: | ||
self.doc.write_text(self._("Spouse: %s") % name, mark) | ||
else: | ||
|
@@ -918,6 +928,10 @@ def add_menu_options(self, menu): | |
|
||
addopt = partial(menu.add_option, _("Include")) | ||
|
||
showgender = BooleanOption(_("Show gender symbol in front of name"), True) | ||
showgender.set_help(_("Whether to show gender symbol in front of name.")) | ||
addopt("showgender", showgender) | ||
|
||
listc = BooleanOption(_("Include children"), True) | ||
listc.set_help(_("Whether to list children.")) | ||
addopt("listc", listc) | ||
|