diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1a850eb31..9b9e06812 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2003-06-08 Alex Roitman + * 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 * src/Report.py: Clean up the split into BareReportDialog and ReportDialog classes. diff --git a/gramps2/src/Report.py b/gramps2/src/Report.py index 6c0ca1433..cdb7bb07e 100644 --- a/gramps2/src/Report.py +++ b/gramps2/src/Report.py @@ -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( "%s" % new_name ) diff --git a/gramps2/src/plugins/BookReport.py b/gramps2/src/plugins/BookReport.py index b6ff2dd97..a395bed34 100644 --- a/gramps2/src/plugins/BookReport.py +++ b/gramps2/src/plugins/BookReport.py @@ -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() diff --git a/gramps2/src/plugins/FtmStyleDescendants.py b/gramps2/src/plugins/FtmStyleDescendants.py index f0346b34e..35cc7810b 100644 --- a/gramps2/src/plugins/FtmStyleDescendants.py +++ b/gramps2/src/plugins/FtmStyleDescendants.py @@ -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()