Ancestor report:
- removed father uses main option
  changed to 'center person uses' option on tree tab
- option main_disp to father_disp
- opton sec_dis to mother_disp
- moved secondary tab to display tab
- display boxes are now labeled 'father display' and mother display'

Descendant report:
- changed cli opts to 'descend_disp' and 'spouse_disp'
- removed 'use separate display for spouses'
- changed default note location to bottom left

Both reports:
- added 'Sizes' tab to hold scale and resize options only
- 'print' tab is now the 'include' tab
- options on the include tab say 'include' instead of 'print'
- moved 'Note' tab into the 'include' tab and labeled 'include note'
- moved some of the resize tooltip into the description
- tried to get the 'compress' tool tip a little better



svn: r17030
This commit is contained in:
Craig J. Anderson 2011-04-03 01:13:32 +00:00
parent 76279fd813
commit c50862b54e
2 changed files with 106 additions and 134 deletions

View File

@ -124,18 +124,6 @@ class FamilyBox(AncestorBoxBase):
return int((delta/2) + (tmp_y*delta)) return int((delta/2) + (tmp_y*delta))
#------------------------------------------------------------------------
#
# Line class
#
#------------------------------------------------------------------------
#class Line(LineBase):
# """ Our line class."""
# def __init__(self, start):
# LineBase.__init__(self, start)
# self.linestr = 'AC2-line'
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# Titles Class(es) # Titles Class(es)
@ -185,19 +173,14 @@ class CalcItems(object):
self.__blank_father = None self.__blank_father = None
self.__blank_mother = None self.__blank_mother = None
main = self.__calc_l.calc_lines( None, None, __gui.get_val("main_disp")) self.__blank_father = \
secn = self.__calc_l.calc_lines( None, None, __gui.get_val("sec_disp")) self.__calc_l.calc_lines( None, None, __gui.get_val("father_disp"))
self.__blank_mother = \
self.__calc_l.calc_lines( None, None, __gui.get_val("mother_disp"))
self.disp_father = __gui.get_val("main_disp") self.center_use = __gui.get_val("center_uses")
self.__blank_father = main self.disp_father = __gui.get_val("father_disp")
self.disp_mother = __gui.get_val("main_disp") self.disp_mother = __gui.get_val("mother_disp")
self.__blank_mother = main
if __gui.get_val('dif_sec') == 1:
self.disp_father = __gui.get_val("sec_disp")
self.__blank_father = secn
elif __gui.get_val('dif_sec') == 2:
self.disp_mother = __gui.get_val("sec_disp")
self.__blank_mother = secn
self.disp_marr = [__gui.get_val("marr_disp")] self.disp_marr = [__gui.get_val("marr_disp")]
self.__blank_marriage = \ self.__blank_marriage = \
@ -205,7 +188,7 @@ class CalcItems(object):
def calc_person(self, index, indi_handle, fams_handle): def calc_person(self, index, indi_handle, fams_handle):
working_lines = "" working_lines = ""
if index == 1 or index % 2 == 0: #The center person always uses main if index % 2 == 0 or (index == 1 and self.center_use == 0):
if indi_handle == fams_handle == None: if indi_handle == fams_handle == None:
working_lines = self.__blank_father working_lines = self.__blank_father
else: else:
@ -875,6 +858,7 @@ class AncestorTreeOptions(MenuReportOptions):
def add_menu_options(self, menu): def add_menu_options(self, menu):
##################
category_name = _("Tree Options") category_name = _("Tree Options")
pid = PersonOption(_("Center Person")) pid = PersonOption(_("Center Person"))
@ -894,7 +878,8 @@ class AncestorTreeOptions(MenuReportOptions):
self.__fillout_vals() self.__fillout_vals()
compress = BooleanOption(_('Co_mpress tree'), True) compress = BooleanOption(_('Co_mpress tree'), True)
compress.set_help(_("Whether to compress the tree.")) compress.set_help(_("Whether to remove any extra blank spaces set "
"aside for people that are unknown"))
menu.add_option(category_name, "compress", compress) menu.add_option(category_name, "compress", compress)
#better to 'Show siblings of\nthe center person #better to 'Show siblings of\nthe center person
@ -907,23 +892,20 @@ class AncestorTreeOptions(MenuReportOptions):
#Spouse_disp.set_help(_("Show spouses of the center person?")) #Spouse_disp.set_help(_("Show spouses of the center person?"))
#menu.add_option(category_name, "Spouse_disp", Spouse_disp) #menu.add_option(category_name, "Spouse_disp", Spouse_disp)
centerDisp = EnumeratedListOption(_("Center person uses\n"
"which format"), 0)
centerDisp.add_item( 0, _("Use Fathers Display format"))
centerDisp.add_item( 1, _("Use Mothers display format"))
centerDisp.set_help(_("Which Display format to use the center person"))
menu.add_option(category_name, "center_uses", centerDisp)
##################
category_name = _("Display") category_name = _("Display")
disp = TextOption(_("Main\nDisplay Format"), disp = TextOption(_("Fathers\nDisplay Format"),
["$n","%s $b" % _BORN,"%s $d" %_DIED] ) ["$n","%s $b" % _BORN,"%s $d" %_DIED] )
disp.set_help(_("Display format for the output box.")) disp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "main_disp", disp) menu.add_option(category_name, "father_disp", disp)
difMom = EnumeratedListOption(_("Use Main/Secondary\nDisplay "
"Format for"), 0)
difMom.add_item( 0, _("Everyone uses the Main Display format"))
difMom.add_item( 1, _("Mothers use Main, and Fathers use the "
"Secondary"))
difMom.add_item( 2, _("Fathers use Main, and Mothers use the "
"Secondary"))
difMom.set_help(_("Which Display format to use for Fathers and "
"Mothers"))
menu.add_option(category_name, "dif_sec", difMom)
#Will add when libsubstkeyword supports it. #Will add when libsubstkeyword supports it.
#missing = EnumeratedListOption(_("Replace missing\nplaces\\dates \ #missing = EnumeratedListOption(_("Replace missing\nplaces\\dates \
@ -933,15 +915,15 @@ class AncestorTreeOptions(MenuReportOptions):
#missing.set_help(_("What will print when information is not known")) #missing.set_help(_("What will print when information is not known"))
#menu.add_option(category_name, "miss_val", missing) #menu.add_option(category_name, "miss_val", missing)
category_name = _("Secondary") #category_name = _("Secondary")
dispMom = TextOption(_("Secondary\nDisplay Format"), dispMom = TextOption(_("Mothers\nDisplay Format"),
["$n","%s $b" % _BORN, ["$n","%s $b" % _BORN,
"%s $m" %_MARR, "%s $m" %_MARR,
"%s $d" %_DIED] "%s $d" %_DIED]
) )
dispMom.set_help(_("Display format for the output box.")) dispMom.set_help(_("Display format for the output box."))
menu.add_option(category_name, "sec_disp", dispMom) menu.add_option(category_name, "mother_disp", dispMom)
incmarr = BooleanOption(_('Include Marriage information'), False) incmarr = BooleanOption(_('Include Marriage information'), False)
incmarr.set_help(_("Whether to include marriage information in the " incmarr.set_help(_("Whether to include marriage information in the "
@ -952,7 +934,8 @@ class AncestorTreeOptions(MenuReportOptions):
marrdisp.set_help(_("Display format for the output box.")) marrdisp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "marr_disp", marrdisp) menu.add_option(category_name, "marr_disp", marrdisp)
category_name = _("Print") ##################
category_name = _("Sizes")
self.scale = EnumeratedListOption(_("Scale tree to fit"), 0) self.scale = EnumeratedListOption(_("Scale tree to fit"), 0)
self.scale.add_item( 0, _("Do not scale tree")) self.scale.add_item( 0, _("Do not scale tree"))
@ -965,42 +948,45 @@ class AncestorTreeOptions(MenuReportOptions):
self.scale.connect('value-changed', self.__check_blank) self.scale.connect('value-changed', self.__check_blank)
if "BKI" not in self.name.split(","): if "BKI" not in self.name.split(","):
self.__onepage = BooleanOption(_("Resize Page to Fit Tree size.\n" self.__onepage = BooleanOption(_("Resize Page to Fit Tree size\n"
"Note: Overrides options in the 'Paper Option' tab"), "\n"
"Note: Overrides options in the 'Paper Option' tab\n"
"\n"
"With this option selected, the following will happen:\n"
"\n"
"With the 'Do not scale tree' option the page\n"
" is resized to the height/width of the tree\n"
"\n"
"With 'Scale tree to fit page width only' the height of\n"
" the page is resized to the height of the tree\n"
"\n"
"With 'Scale tree to fit the size of the page' the page\n"
" is resized to remove any gap in either height or width"
),
False) False)
self.__onepage.set_help( self.__onepage.set_help(
_("Whether to resize the page to fit the size \n" _("Whether to resize the page to fit the size \n"
"of the tree. Note: the page will have a \n" "of the tree. Note: the page will have a \n"
"non standard size.\n" "non standard size."
"\n" ))
"With the 'Do not scale tree' option\n"
" the page is resized to the height/width \n"
" of the tree\n"
"\n"
"With 'Scale tree to fit page width only'\n"
" the height of the page is resized to the \n"
" height of the tree\n"
"\n"
"With 'Scale tree to fit the size of the page'\n"
" the page is resized to remove any gap in \n"
" either the height or width.")
)
menu.add_option(category_name, "resize_page", self.__onepage) menu.add_option(category_name, "resize_page", self.__onepage)
self.__onepage.connect('value-changed', self.__check_blank) self.__onepage.connect('value-changed', self.__check_blank)
else: else:
self.__onepage = None self.__onepage = None
##################
category_name = _("Include")
self.title = EnumeratedListOption(_("Report Title"), 0) self.title = EnumeratedListOption(_("Report Title"), 0)
self.title.add_item( 0, _("Do not print a title")) self.title.add_item( 0, _("Do not include a title"))
self.title.add_item( 1, _("Include Report Title")) self.title.add_item( 1, _("Include Report Title"))
menu.add_option(category_name, "report_title", self.title) menu.add_option(category_name, "report_title", self.title)
border = BooleanOption(_('Print a border'), True) border = BooleanOption(_('Include a border'), True)
border.set_help(_("Whether to make a border around the report.")) border.set_help(_("Whether to make a border around the report."))
menu.add_option(category_name, "inc_border", border) menu.add_option(category_name, "inc_border", border)
prnnum = BooleanOption(_('Print Page Numbers'), False) prnnum = BooleanOption(_('Include Page Numbers'), False)
prnnum.set_help(_("Whether to print page numbers on each page.")) prnnum.set_help(_("Whether to print page numbers on each page."))
menu.add_option(category_name, "inc_pagenum", prnnum) menu.add_option(category_name, "inc_pagenum", prnnum)
@ -1010,14 +996,14 @@ class AncestorTreeOptions(MenuReportOptions):
self.__check_blank() self.__check_blank()
category_name = _("Notes") #category_name = _("Notes")
self.usenote = BooleanOption(_('Include a personal note'), False) self.usenote = BooleanOption(_('Include a personal note'), False)
self.usenote.set_help(_("Whether to include a personalized note on " self.usenote.set_help(_("Whether to include a personalized note on "
"the report.")) "the report."))
menu.add_option(category_name, "inc_note", self.usenote) menu.add_option(category_name, "inc_note", self.usenote)
self.notedisp = TextOption(_("Note to add\nto the graph\n\n$T " self.notedisp = TextOption(_("Note to add\nto the tree\n\n$T "
"inserts today's date"), []) "inserts today's date"), [])
self.notedisp.set_help(_("Add a personal note")) self.notedisp.set_help(_("Add a personal note"))
menu.add_option(category_name, "note_disp", self.notedisp) menu.add_option(category_name, "note_disp", self.notedisp)

View File

@ -134,19 +134,6 @@ class PlaceHolderBox(BoxBase):
return return
#------------------------------------------------------------------------
#
# Line class
#
#------------------------------------------------------------------------
#class Line(LineBase):
# """ Our line class."""
#
# def __init__(self, start):
# LineBase.__init__(self, start)
# self.linestr = "CG2-line"
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# Titles Class(es) # Titles Class(es)
@ -1242,11 +1229,11 @@ class GuiConnect():
return CalcLines(database, display_repl) return CalcLines(database, display_repl)
def working_lines(self, box): def working_lines(self, box):
display = self.get_val("main_disp") display = self.get_val("dsecend_disp")
if self.get_val('diffspouse'): #if self.get_val('diffspouse'):
display_spou = self.get_val("spouse_disp") display_spou = self.get_val("spouse_disp")
else: #else:
display_spou = display # display_spou = display
display_marr = [self.get_val("marr_disp")] display_marr = [self.get_val("marr_disp")]
if box.boxstr == "CG2-fam-box": #((((( if box.boxstr == "CG2-fam-box": #(((((
@ -1462,6 +1449,7 @@ class DescendTreeOptions(MenuReportOptions):
""" """
Add options to the menu for the descendant report. Add options to the menu for the descendant report.
""" """
##################
category_name = _("Tree Options") category_name = _("Tree Options")
if self.name.split(",")[0] == _RPT_NAME: if self.name.split(",")[0] == _RPT_NAME:
@ -1492,15 +1480,17 @@ class DescendTreeOptions(MenuReportOptions):
menu.add_option(category_name, "maxspouse", max_spouse) menu.add_option(category_name, "maxspouse", max_spouse)
compresst = BooleanOption(_('Co_mpress tree'), False) compresst = BooleanOption(_('Co_mpress tree'), False)
compresst.set_help(_("Whether to compress the tree.")) compresst.set_help(_("Whether to move people up, where possible, "
"resulting in a smaller tree"))
menu.add_option(category_name, "compress_tree", compresst) menu.add_option(category_name, "compress_tree", compresst)
##################
category_name = _("Display") category_name = _("Display")
disp = TextOption(_("Personal\nDisplay Format"), disp = TextOption(_("Descendant\nDisplay Format"),
["$n","%s $b" % _BORN,"%s $d" %_DIED]) ["$n","%s $b" % _BORN,"%s $d" %_DIED])
disp.set_help(_("Display format for the output box.")) disp.set_help(_("Display format for a descendant."))
menu.add_option(category_name, "main_disp", disp) menu.add_option(category_name, "dsecend_disp", disp)
bold = BooleanOption(_('Bold direct descendants'), True) bold = BooleanOption(_('Bold direct descendants'), True)
bold.set_help( bold.set_help(
@ -1509,21 +1499,12 @@ class DescendTreeOptions(MenuReportOptions):
) )
menu.add_option(category_name, "bolddirect", bold) menu.add_option(category_name, "bolddirect", bold)
#Will add when libsubstkeyword supports it. #bug 4767
#missing = EnumeratedListOption(_("Replace missing\nplaces\\dates \ #diffspouse = BooleanOption(
# with"), 0) # _("Use separate display format for spouses"),
#missing.add_item( 0, _("Does not display anything")) # True)
#missing.add_item( 1, _("Displays '_____'")) #diffspouse.set_help(_("Whether spouses can have a different format."))
#missing.set_help(_("What will print when information is not known")) #menu.add_option(category_name, "diffspouse", diffspouse)
#menu.add_option(category_name, "miss_val", missing)
category_name = _("Secondary")
diffspouse = BooleanOption(
_("Use separate display format for spouses"),
True)
diffspouse.set_help(_("Whether spouses can have a different format."))
menu.add_option(category_name, "diffspouse", diffspouse)
indspouce = BooleanOption(_('Indent Spouses'), True) indspouce = BooleanOption(_('Indent Spouses'), True)
indspouce.set_help(_("Whether to indent the spouses in the tree.")) indspouce.set_help(_("Whether to indent the spouses in the tree."))
@ -1531,7 +1512,7 @@ class DescendTreeOptions(MenuReportOptions):
sdisp = TextOption(_("Spousal\nDisplay Format"), sdisp = TextOption(_("Spousal\nDisplay Format"),
["$n","%s $b" % _BORN,"%s $d" %_DIED]) ["$n","%s $b" % _BORN,"%s $d" %_DIED])
sdisp.set_help(_("Display format for the output box.")) sdisp.set_help(_("Display format for a spouse."))
menu.add_option(category_name, "spouse_disp", sdisp) menu.add_option(category_name, "spouse_disp", sdisp)
incmarr = BooleanOption(_('Include Marriage information'), True) incmarr = BooleanOption(_('Include Marriage information'), True)
@ -1544,6 +1525,7 @@ class DescendTreeOptions(MenuReportOptions):
marrdisp.set_help(_("Display format for the output box.")) marrdisp.set_help(_("Display format for the output box."))
menu.add_option(category_name, "marr_disp", marrdisp) menu.add_option(category_name, "marr_disp", marrdisp)
##################
category_name = _("Replace") category_name = _("Replace")
repldisp = TextOption( repldisp = TextOption(
@ -1552,7 +1534,8 @@ class DescendTreeOptions(MenuReportOptions):
repldisp.set_help(_("i.e.\nUnited States of America/U.S.A")) repldisp.set_help(_("i.e.\nUnited States of America/U.S.A"))
menu.add_option(category_name, "replace_list", repldisp) menu.add_option(category_name, "replace_list", repldisp)
category_name = _("Print") ##################
category_name = _("Sizes")
self.scale = EnumeratedListOption(_("Scale tree to fit"), 0) self.scale = EnumeratedListOption(_("Scale tree to fit"), 0)
self.scale.add_item( 0, _("Do not scale tree")) self.scale.add_item( 0, _("Do not scale tree"))
@ -1565,52 +1548,55 @@ class DescendTreeOptions(MenuReportOptions):
self.scale.connect('value-changed', self.__check_blank) self.scale.connect('value-changed', self.__check_blank)
if "BKI" not in self.name.split(","): if "BKI" not in self.name.split(","):
self.__onepage = BooleanOption(_("Resize Page to Fit Tree size.\n" self.__onepage = BooleanOption(_("Resize Page to Fit Tree size\n"
"Note: Overrides options in the 'Paper Option' tab"), "\n"
"Note: Overrides options in the 'Paper Option' tab\n"
"\n"
"With this option selected, the following will happen:\n"
"\n"
"With the 'Do not scale tree' option the page\n"
" is resized to the height/width of the tree\n"
"\n"
"With 'Scale tree to fit page width only' the height of\n"
" the page is resized to the height of the tree\n"
"\n"
"With 'Scale tree to fit the size of the page' the page\n"
" is resized to remove any gap in either height or width"
),
False) False)
self.__onepage.set_help( self.__onepage.set_help(
_("Whether to resize the page to fit the size \n" _("Whether to resize the page to fit the size \n"
"of the tree. Note: the page will have a \n" "of the tree. Note: the page will have a \n"
"non standard size.\n" "non standard size."
"\n" ))
"With the 'Do not scale tree' option\n"
" the page is resized to the height/width \n"
" of the tree\n"
"\n"
"With 'Scale tree to fit page width only'\n"
" the height of the page is resized to the \n"
" height of the tree\n"
"\n"
"With 'Scale tree to fit the size of the page'\n"
" the page is resized to remove any gap in \n"
" either the height or width.")
)
menu.add_option(category_name, "resize_page", self.__onepage) menu.add_option(category_name, "resize_page", self.__onepage)
self.__onepage.connect('value-changed', self.__check_blank) self.__onepage.connect('value-changed', self.__check_blank)
else: else:
self.__onepage = None self.__onepage = None
##################
category_name = _("Include")
self.title = EnumeratedListOption(_("Report Title"), 0) self.title = EnumeratedListOption(_("Report Title"), 0)
self.title.add_item( 0, _("Do not print a title")) self.title.add_item( 0, _("Do not include a title"))
self.title.set_help(_("Choose a title for the report")) self.title.set_help(_("Choose a title for the report"))
menu.add_option(category_name, "report_title", self.title) menu.add_option(category_name, "report_title", self.title)
self.showparents.connect('value-changed', self.__Title_enum) self.showparents.connect('value-changed', self.__Title_enum)
border = BooleanOption(_('Print a border'), True) border = BooleanOption(_('Include a border'), True)
border.set_help(_("Whether to make a border around the report.")) border.set_help(_("Whether to make a border around the report."))
menu.add_option(category_name, "inc_border", border) menu.add_option(category_name, "inc_border", border)
prnnum = BooleanOption(_('Print Page Numbers'), False) prnnum = BooleanOption(_('Include Page Numbers'), False)
prnnum.set_help(_("Whether to print page numbers on each page.")) prnnum.set_help(_("Whether to include page numbers on each page."))
menu.add_option(category_name, "inc_pagenum", prnnum) menu.add_option(category_name, "inc_pagenum", prnnum)
self.__blank = BooleanOption(_('Include Blank Pages'), True) self.__blank = BooleanOption(_('Include Blank Pages'), True)
self.__blank.set_help(_("Whether to include pages that are blank.")) self.__blank.set_help(_("Whether to include pages that are blank."))
menu.add_option(category_name, "inc_blank", self.__blank) menu.add_option(category_name, "inc_blank", self.__blank)
category_name = _("Notes") #category_name = _("Notes")
self.usenote = BooleanOption(_('Include a personal note'), False) self.usenote = BooleanOption(_('Include a personal note'), False)
self.usenote.set_help( self.usenote.set_help(
@ -1619,13 +1605,13 @@ class DescendTreeOptions(MenuReportOptions):
menu.add_option(category_name, "inc_note", self.usenote) menu.add_option(category_name, "inc_note", self.usenote)
self.notedisp = TextOption( self.notedisp = TextOption(
_("Note to add\nto the graph\n\n$T inserts today's date"), _("Note to add\nto the tree\n\n$T inserts today's date"),
[]) [])
self.notedisp.set_help(_("Add a personal note")) self.notedisp.set_help(_("Add a personal note"))
menu.add_option(category_name, "note_disp", self.notedisp) menu.add_option(category_name, "note_disp", self.notedisp)
locals = NoteType(0) locals = NoteType(0)
notelocal = EnumeratedListOption(_("Note Location"), 0) notelocal = EnumeratedListOption(_("Note Location"), 2)
for num, text in locals.note_locals(): for num, text in locals.note_locals():
notelocal.add_item( num, text ) notelocal.add_item( num, text )
notelocal.set_help(_("Where to place a personal note.")) notelocal.set_help(_("Where to place a personal note."))
@ -1642,7 +1628,7 @@ class DescendTreeOptions(MenuReportOptions):
def __Title_enum(self): def __Title_enum(self):
item_list = [ item_list = [
[0, "Do not print a title" ], [0, "Do not include a title" ],
[1, "Descendant Chart for [selected person(s)]" ], [1, "Descendant Chart for [selected person(s)]" ],
] ]
if self.name != _RPT_NAME: if self.name != _RPT_NAME: