Remove "get_newpage()" and "set_newpage()" from the ReportOptions class. They are not really options. The BookReportDialog now takes care of inserting page breaks.
svn: r8339
This commit is contained in:
parent
8e9a3c191f
commit
698c28f230
@ -1,3 +1,11 @@
|
||||
2007-03-29 Brian Matherly <brian@gramps-project.org>
|
||||
* src/ReportBase/_ReportOptions.py
|
||||
* src/ReportBase/_Report.py
|
||||
* src/plugins/BookReport.py
|
||||
Remove "get_newpage()" and "set_newpage()" from the ReportOptions class.
|
||||
They are not really options. The BookReportDialog now takes care of
|
||||
inserting page breaks.
|
||||
|
||||
2007-03-28 Don Allingham <don@gramps-project.org>
|
||||
* src/ViewManager.py: call dbmanager if no file loaded on startup
|
||||
* src/DbManger.py: open buttons and double click
|
||||
|
@ -69,8 +69,7 @@ class Report:
|
||||
self.define_graphics_styles()
|
||||
|
||||
def begin_report(self):
|
||||
if self.options_class.get_newpage():
|
||||
self.doc.page_break()
|
||||
pass
|
||||
|
||||
def write_report(self):
|
||||
pass
|
||||
|
@ -371,7 +371,6 @@ class OptionHandler(_Options.OptionHandler):
|
||||
# We will not need to save/retreive them, just keep around.
|
||||
self.doc = None
|
||||
self.output = None
|
||||
self.newpage = False
|
||||
|
||||
# Retrieve our options from whole collection
|
||||
self.style_name = self.option_list_collection.default_style_name
|
||||
@ -540,19 +539,3 @@ class ReportOptions(_Options.Options):
|
||||
This method MUST NOT be overridden by subclasses.
|
||||
"""
|
||||
self.handler.output = val
|
||||
|
||||
def get_newpage(self):
|
||||
"""
|
||||
Return value of whether or not insert new page before the report.
|
||||
|
||||
This method MUST NOT be overridden by subclasses.
|
||||
"""
|
||||
return self.handler.newpage
|
||||
|
||||
def set_newpage(self,val):
|
||||
"""
|
||||
Set newpage to a given value.
|
||||
|
||||
This method MUST NOT be overridden by subclasses.
|
||||
"""
|
||||
self.handler.newpage = val
|
||||
|
@ -1055,15 +1055,12 @@ class BookReportDialog(ReportDialog):
|
||||
self.template_name)
|
||||
|
||||
self.rptlist = []
|
||||
newpage = 0
|
||||
for item in self.book.get_item_list():
|
||||
item.option_class.set_document(self.doc)
|
||||
item.option_class.set_newpage(newpage)
|
||||
report_class = item.get_write_item()
|
||||
obj = write_book_item(self.database,self.person,
|
||||
report_class,item.option_class)
|
||||
self.rptlist.append(obj)
|
||||
newpage = 1
|
||||
self.doc.open(self.target_path)
|
||||
|
||||
if self.print_report.get_active():
|
||||
@ -1074,7 +1071,11 @@ class BookReportDialog(ReportDialog):
|
||||
and call each item's write_book_item method."""
|
||||
|
||||
self.doc.init()
|
||||
newpage = 0
|
||||
for item in self.rptlist:
|
||||
if newpage:
|
||||
self.doc.page_break()
|
||||
newpage = 1
|
||||
item.begin_report()
|
||||
item.write_report()
|
||||
self.doc.close()
|
||||
@ -1119,18 +1120,20 @@ def cl_report(database,name,category,options_str_dict):
|
||||
# write report
|
||||
doc = clr.format(selected_style,clr.paper,clr.template_name,clr.orien)
|
||||
rptlist = []
|
||||
newpage = 0
|
||||
for item in book.get_item_list():
|
||||
item.option_class.set_document(doc)
|
||||
item.option_class.set_newpage(newpage)
|
||||
report_class = item.get_write_item()
|
||||
obj = write_book_item(database,clr.person,
|
||||
report_class,item.option_class)
|
||||
rptlist.append(obj)
|
||||
newpage = 1
|
||||
|
||||
doc.open(clr.option_class.get_output())
|
||||
doc.init()
|
||||
newpage = 0
|
||||
for item in rptlist:
|
||||
if newpage:
|
||||
doc.page_break()
|
||||
newpage = 1
|
||||
item.begin_report()
|
||||
item.write_report()
|
||||
doc.close()
|
||||
|
Loading…
Reference in New Issue
Block a user