From e4c6227dc8656f3e3cef2f34f38a85dffbb6c3c4 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 11 Aug 2003 17:33:27 +0000 Subject: [PATCH] 2003-08-11 Tim Waugh * src/docgen/OpenDrawDoc.py: Fixed tag mismatch. Added report printing support. * src/Report.py: Report printing support added to Draw-style reports. svn: r1991 --- ChangeLog | 4 ++++ src/Report.py | 3 ++- src/docgen/OpenDrawDoc.py | 13 ++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d84379a2..125e05629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ 2003-08-11 Tim Waugh + * src/docgen/OpenDrawDoc.py: Fixed tag mismatch. Added report printing + support. + * src/Report.py: Report printing support added to Draw-style + reports. * src/plugins/Ancestors.py: Use Relationship.get_grandparents_string. 2003-08-10 Don Allingham diff --git a/src/Report.py b/src/Report.py index a035109a2..97edc715e 100644 --- a/src/Report.py +++ b/src/Report.py @@ -1312,7 +1312,8 @@ class DrawReportDialog(ReportDialog): def make_document(self): """Create a document of the type requested by the user.""" self.doc = self.format(self.selected_style,self.paper,self.orien) - + if self.print_report.get_active (): + self.doc.print_requested () class TemplateParser(handler.ContentHandler): """ diff --git a/src/docgen/OpenDrawDoc.py b/src/docgen/OpenDrawDoc.py index 1164ba080..b677a5b01 100644 --- a/src/docgen/OpenDrawDoc.py +++ b/src/docgen/OpenDrawDoc.py @@ -110,6 +110,7 @@ class OpenDrawDoc(DrawDoc.DrawDoc): self.f.write('\n') self.f.write('') self.f.write('') + self.f.write('\n') self.f.write('\n') self.f.write('\n') @@ -152,6 +153,11 @@ class OpenDrawDoc(DrawDoc.DrawDoc): except: raise Errors.ReportError("Could not create %s" % self.filename) + print self.print_req + if self.print_req: + os.environ["FILE"] = self.filename + os.system ('/usr/bin/oodraw "$FILE" &') + def _write_zip(self): file = zipfile.ZipFile(self.filename,"w",zipfile.ZIP_DEFLATED) @@ -597,4 +603,9 @@ class OpenDrawDoc(DrawDoc.DrawDoc): # Register document generator # #------------------------------------------------------------------------- -Plugins.register_draw_doc(_("OpenOffice.org Draw"),OpenDrawDoc,1,1,".sxd"); +print_label = None +if os.access ("/usr/bin/oodraw", os.X_OK): + print_label = _("Open in OpenOffice.org") + +Plugins.register_draw_doc(_("OpenOffice.org Draw"),OpenDrawDoc,1,1,".sxd", + print_label);