2003-08-05 Tim Waugh <twaugh@redhat.com>
* src/Report.py, src/TextDoc.py, src/DrawDoc.py: Adjusted the way that 'Print Report' is handled. * src/docgen/OpenOfficeDoc.py, src/docgen/PSDrawDoc.py: Likewise. * src/plugins/AncestorChart.py: Undo previous change to do with printing reports. svn: r1962
This commit is contained in:
parent
b563b8ea77
commit
a5ee260def
@ -1,3 +1,10 @@
|
||||
2003-08-05 Tim Waugh <twaugh@redhat.com>
|
||||
* src/Report.py, src/TextDoc.py, src/DrawDoc.py: Adjusted the way
|
||||
that 'Print Report' is handled.
|
||||
* src/docgen/OpenOfficeDoc.py, src/docgen/PSDrawDoc.py: Likewise.
|
||||
* src/plugins/AncestorChart.py: Undo previous change to do with
|
||||
printing reports.
|
||||
|
||||
2003-08-04 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||
* src/plugins/GraphViz.py (make_doc_menu): Add paper option to the menu.
|
||||
* src/GenericFilter.py: Fixes for existing filters (ancestors and
|
||||
|
@ -126,6 +126,10 @@ class DrawDoc:
|
||||
self.style_list = styles.get_styles()
|
||||
self.draw_styles = {}
|
||||
self.name = ""
|
||||
self.print_req = 0
|
||||
|
||||
def print_requested (self):
|
||||
self.print_req = 1
|
||||
|
||||
def get_usable_width(self):
|
||||
return self.width - (self.rmargin + self.lmargin)
|
||||
|
@ -1274,6 +1274,8 @@ class TextReportDialog(ReportDialog):
|
||||
"""Create a document of the type requested by the user."""
|
||||
self.doc = self.format(self.selected_style,self.paper,
|
||||
self.template_name,self.orien)
|
||||
if self.print_report.get_active ():
|
||||
self.doc.print_requested ()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -979,6 +979,10 @@ class TextDoc:
|
||||
self.cell_styles = {}
|
||||
self.name = ""
|
||||
self.photo_list = []
|
||||
self.print_req = 0
|
||||
|
||||
def print_requested (self):
|
||||
self.print_req = 1
|
||||
|
||||
def set_owner(self,owner):
|
||||
"""
|
||||
@ -1056,9 +1060,6 @@ class TextDoc:
|
||||
"Closes the document"
|
||||
pass
|
||||
|
||||
def print_report(self):
|
||||
pass
|
||||
|
||||
def line_break(self):
|
||||
"Forces a line break within a paragraph"
|
||||
pass
|
||||
|
@ -243,6 +243,9 @@ class OpenOfficeDoc(TextDoc.TextDoc):
|
||||
self._write_manifest()
|
||||
self._write_meta_file()
|
||||
self._write_zip()
|
||||
if self.print_req:
|
||||
os.environ["FILE"] = self.filename
|
||||
os.system ('/usr/bin/oowriter "$FILE" &')
|
||||
|
||||
def add_photo(self,name,pos,x_cm,y_cm):
|
||||
|
||||
@ -617,5 +620,10 @@ class OpenOfficeDoc(TextDoc.TextDoc):
|
||||
self.f.write('</office:document-meta>\n')
|
||||
self.f.close()
|
||||
|
||||
Plugins.register_text_doc(_("OpenOffice.org Writer"),OpenOfficeDoc,1,1,1,".sxw")
|
||||
print_label = None
|
||||
if os.access ("/usr/bin/oowriter", os.X_OK):
|
||||
print_label = _("Open in OpenOffice.org")
|
||||
|
||||
Plugins.register_text_doc(_("OpenOffice.org Writer"),OpenOfficeDoc,1,1,1,
|
||||
".sxw",print_label)
|
||||
Plugins.register_book_doc(_("OpenOffice.org Writer"),OpenOfficeDoc,1,1,1,".sxw")
|
||||
|
@ -124,9 +124,8 @@ class PSDrawDoc(DrawDoc.DrawDoc):
|
||||
self.f.write('%d\n' % self.page)
|
||||
self.f.write('%%EOF\n')
|
||||
self.f.close()
|
||||
|
||||
def print_report(self):
|
||||
return run_print_dialog (self.filename)
|
||||
if self.print_req:
|
||||
run_print_dialog (self.filename)
|
||||
|
||||
def start_paragraph(self,style_name):
|
||||
pass
|
||||
|
@ -257,8 +257,6 @@ class AncestorChartDialog(Report.DrawReportDialog):
|
||||
MyReport = AncestorChart(self.db, self.person, self.target_path,
|
||||
self.max_gen, self.doc, self.report_text)
|
||||
MyReport.write_report()
|
||||
if self.print_report.get_active ():
|
||||
self.doc.print_report()
|
||||
except Errors.ReportError, msg:
|
||||
(m1,m2) = msg.messages()
|
||||
ErrorDialog(m1,m2)
|
||||
|
Loading…
Reference in New Issue
Block a user