* src/docgen/PdfDoc.py: add the ability to open the document in the

default viewer
* src/docgen/AbiWord2Doc.py: add the ability to open the document in AbiWord
* src/docgen/OpenOfficeDoc.py: fixed the search for default viewer
* src/docgen/RTFDoc.py: add the ability to open the document in the default viewer
* src/docgen/HtmlDoc.py: add the ability to open the document in the default viewer
* src/docgen/KwordDoc.py: add comment


svn: r2575
This commit is contained in:
Don Allingham
2004-01-01 18:17:47 +00:00
parent f085ad7013
commit 2582bec96c
6 changed files with 118 additions and 12 deletions

View File

@@ -26,6 +26,7 @@
#
#------------------------------------------------------------------------
import string
import os
#------------------------------------------------------------------------
#
@@ -124,6 +125,14 @@ class RTFDoc(BaseDoc.BaseDoc):
self.f.write('}\n')
self.f.close()
if self.print_req:
import grampslib
apptype = 'application/rtf'
prog = grampslib.default_application_command(apptype)
os.environ["FILE"] = self.filename
os.system ('%s "$FILE" &' % prog)
#--------------------------------------------------------------------
#
# Force a section page break
@@ -402,4 +411,20 @@ class RTFDoc(BaseDoc.BaseDoc):
self.text = self.text.replace('<super>','{{\*\updnprop5801}\up10 ')
self.text = self.text.replace('</super>','}')
Plugins.register_text_doc(_("Rich Text Format (RTF)"),RTFDoc,1,1,1,".rtf")
#------------------------------------------------------------------------
#
# Register the document generator with the GRAMPS plugin system
#
#------------------------------------------------------------------------
try:
import grampslib
import Utils
prog = grampslib.default_application_command("application/rtf")
desc = grampslib.default_application_name("application/rtf")
if Utils.search_for(prog):
print_label=_("Open in %s") % desc
except:
print_label = None
Plugins.register_text_doc(_("Rich Text Format (RTF)"),RTFDoc,1,1,1,".rtf", print_label)