* 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:
parent
c602a53503
commit
ebf28a332a
@ -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>
|
||||
* src/Report.py: Clean up the split into BareReportDialog and
|
||||
ReportDialog classes.
|
||||
|
@ -682,7 +682,7 @@ class BareReportDialog:
|
||||
sel_person = SelectPerson.SelectPerson(self.db,'Select Person')
|
||||
new_person = sel_person.run()
|
||||
if new_person:
|
||||
self.person = new_person
|
||||
self.new_person = new_person
|
||||
new_name = new_person.getPrimaryName().getRegularName()
|
||||
if new_name:
|
||||
self.person_label.set_text( "<i>%s</i>" % new_name )
|
||||
|
@ -271,12 +271,17 @@ class BookReportDialog(Report.ReportDialog):
|
||||
title = _("Book Report")
|
||||
self.doc.write_text(title)
|
||||
self.doc.end_paragraph()
|
||||
first = 1
|
||||
for book_item in self.item_list:
|
||||
write_book_item = book_item[3]
|
||||
get_options = book_item[4]
|
||||
item_options = get_options()
|
||||
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()
|
||||
|
||||
|
@ -52,7 +52,7 @@ from intl import gettext as _
|
||||
#------------------------------------------------------------------------
|
||||
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.gen_map = {}
|
||||
self.database = database
|
||||
@ -65,6 +65,8 @@ class FtmDescendantReport(Report.Report):
|
||||
self.doc.open(output)
|
||||
else:
|
||||
self.standalone = 0
|
||||
if newpage:
|
||||
self.doc.page_break()
|
||||
self.sref_map = {}
|
||||
self.sref_index = 1
|
||||
|
||||
@ -1270,6 +1272,7 @@ class FtmDescendantBareReportDialog(Report.BareReportDialog):
|
||||
self.max_gen = options[1]
|
||||
self.pg_brk = options[2]
|
||||
self.selected_style = get_stl()
|
||||
self.new_person = None
|
||||
|
||||
self.generations_spinbox.set_value(self.max_gen)
|
||||
self.pagebreak_checkbox.set_active(self.pg_brk)
|
||||
@ -1299,6 +1302,8 @@ class FtmDescendantBareReportDialog(Report.BareReportDialog):
|
||||
self.parse_style_frame()
|
||||
self.parse_report_options_frame()
|
||||
|
||||
self.person = self.new_person
|
||||
|
||||
# Clean up the dialog object
|
||||
self.window.destroy()
|
||||
|
||||
@ -1309,7 +1314,7 @@ class FtmDescendantBareReportDialog(Report.BareReportDialog):
|
||||
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.
|
||||
All user dialog has already been handled and the output file opened."""
|
||||
try:
|
||||
@ -1318,7 +1323,7 @@ def write_book_item(database,person,doc,options):
|
||||
max_gen = options[1]
|
||||
pg_brk = options[2]
|
||||
MyReport = FtmDescendantReport(database, person,
|
||||
max_gen, pg_brk, doc, None )
|
||||
max_gen, pg_brk, doc, None, newpage )
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
(m1,m2) = msg.messages()
|
||||
|
Loading…
Reference in New Issue
Block a user