* src/Report.py, src/plugins/BookReport.py,

src/plugins/FtmStyleDescendants.py: Fix changing center person -- only
remember change if OK was clicked.


svn: r1673
This commit is contained in:
Alex Roitman 2003-06-08 06:19:54 +00:00
parent c602a53503
commit ebf28a332a
4 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2003-06-08 Alex Roitman <shura@alex.neuro.umn.edu>
* src/Report.py, src/plugins/BookReport.py,
src/plugins/FtmStyleDescendants.py: Fix changing center person -- only
remember change if OK was clicked.
2003-06-07 Alex Roitman <shura@alex.neuro.umn.edu> 2003-06-07 Alex Roitman <shura@alex.neuro.umn.edu>
* src/Report.py: Clean up the split into BareReportDialog and * src/Report.py: Clean up the split into BareReportDialog and
ReportDialog classes. ReportDialog classes.

View File

@ -682,7 +682,7 @@ class BareReportDialog:
sel_person = SelectPerson.SelectPerson(self.db,'Select Person') sel_person = SelectPerson.SelectPerson(self.db,'Select Person')
new_person = sel_person.run() new_person = sel_person.run()
if new_person: if new_person:
self.person = new_person self.new_person = new_person
new_name = new_person.getPrimaryName().getRegularName() new_name = new_person.getPrimaryName().getRegularName()
if new_name: if new_name:
self.person_label.set_text( "<i>%s</i>" % new_name ) self.person_label.set_text( "<i>%s</i>" % new_name )

View File

@ -271,12 +271,17 @@ class BookReportDialog(Report.ReportDialog):
title = _("Book Report") title = _("Book Report")
self.doc.write_text(title) self.doc.write_text(title)
self.doc.end_paragraph() self.doc.end_paragraph()
first = 1
for book_item in self.item_list: for book_item in self.item_list:
write_book_item = book_item[3] write_book_item = book_item[3]
get_options = book_item[4] get_options = book_item[4]
item_options = get_options() item_options = get_options()
if write_book_item: if write_book_item:
write_book_item(self.database,self.person,self.doc,item_options) if first:
first = 0
newpage = not first
write_book_item(self.database,self.person,
self.doc,item_options,newpage)
self.doc.close() self.doc.close()

View File

@ -52,7 +52,7 @@ from intl import gettext as _
#------------------------------------------------------------------------ #------------------------------------------------------------------------
class FtmDescendantReport(Report.Report): class FtmDescendantReport(Report.Report):
def __init__(self,database,person,max,pgbrk,doc,output): def __init__(self,database,person,max,pgbrk,doc,output,newpage=0):
self.anc_map = {} self.anc_map = {}
self.gen_map = {} self.gen_map = {}
self.database = database self.database = database
@ -65,6 +65,8 @@ class FtmDescendantReport(Report.Report):
self.doc.open(output) self.doc.open(output)
else: else:
self.standalone = 0 self.standalone = 0
if newpage:
self.doc.page_break()
self.sref_map = {} self.sref_map = {}
self.sref_index = 1 self.sref_index = 1
@ -1270,6 +1272,7 @@ class FtmDescendantBareReportDialog(Report.BareReportDialog):
self.max_gen = options[1] self.max_gen = options[1]
self.pg_brk = options[2] self.pg_brk = options[2]
self.selected_style = get_stl() self.selected_style = get_stl()
self.new_person = None
self.generations_spinbox.set_value(self.max_gen) self.generations_spinbox.set_value(self.max_gen)
self.pagebreak_checkbox.set_active(self.pg_brk) self.pagebreak_checkbox.set_active(self.pg_brk)
@ -1299,6 +1302,8 @@ class FtmDescendantBareReportDialog(Report.BareReportDialog):
self.parse_style_frame() self.parse_style_frame()
self.parse_report_options_frame() self.parse_report_options_frame()
self.person = self.new_person
# Clean up the dialog object # Clean up the dialog object
self.window.destroy() self.window.destroy()
@ -1309,7 +1314,7 @@ class FtmDescendantBareReportDialog(Report.BareReportDialog):
return self.selected_style return self.selected_style
def write_book_item(database,person,doc,options): def write_book_item(database,person,doc,options,newpage=0):
"""Write the FTM Style Descendant Report options set. """Write the FTM Style Descendant Report options set.
All user dialog has already been handled and the output file opened.""" All user dialog has already been handled and the output file opened."""
try: try:
@ -1318,7 +1323,7 @@ def write_book_item(database,person,doc,options):
max_gen = options[1] max_gen = options[1]
pg_brk = options[2] pg_brk = options[2]
MyReport = FtmDescendantReport(database, person, MyReport = FtmDescendantReport(database, person,
max_gen, pg_brk, doc, None ) max_gen, pg_brk, doc, None, newpage )
MyReport.write_report() MyReport.write_report()
except Errors.ReportError, msg: except Errors.ReportError, msg:
(m1,m2) = msg.messages() (m1,m2) = msg.messages()