_GraphvizReportDialog.py: Fix Graphviz generated PDF.

svn: r9603
This commit is contained in:
Brian Matherly 2007-12-27 22:05:45 +00:00
parent 8456e16cbc
commit 2faff1abfb
2 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2007-12-27 Brian Matherly <brian@gramps-project.org> 2007-12-27 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_GraphvisReportDialog.py: Fix to conform to 80 columns. * src/ReportBase/_GraphvizReportDialog.py: Fix Graphviz generated PDF.
2007-12-27 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_GraphvizReportDialog.py: Fix to conform to 80 columns.
Add Graphviz generated PDF as an option (requires Graphviz 2.16 to work) Add Graphviz generated PDF as an option (requires Graphviz 2.16 to work)
2007-12-27 Brian Matherly <brian@gramps-project.org> 2007-12-27 Brian Matherly <brian@gramps-project.org>

View File

@ -538,6 +538,7 @@ class GVPdfGsDoc(GVDocBase):
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
_formats = [] _formats = []
_formats += [{ 'type' : "dot", _formats += [{ 'type' : "dot",
'ext' : "dot",
'descr': _("Graphviz Dot File"), 'descr': _("Graphviz Dot File"),
'mime' : "text/x-graphviz", 'mime' : "text/x-graphviz",
'class': GVDotDoc }] 'class': GVDotDoc }]
@ -545,42 +546,50 @@ _formats += [{ 'type' : "dot",
if _dot_found: if _dot_found:
if _gs_cmd != "": if _gs_cmd != "":
_formats += [{ 'type' : "pdf", _formats += [{ 'type' : "gspdf",
'ext' : "pdf",
'descr': _("PDF (Ghostscript)"), 'descr': _("PDF (Ghostscript)"),
'mime' : "application/pdf", 'mime' : "application/pdf",
'class': GVPdfGsDoc }] 'class': GVPdfGsDoc }]
_formats += [{ 'type' : "pdf", _formats += [{ 'type' : "gvpdf",
'ext' : "pdf",
'descr': _("PDF (Graphviz)"), 'descr': _("PDF (Graphviz)"),
'mime' : "application/pdf", 'mime' : "application/pdf",
'class': GVPdfGvDoc }] 'class': GVPdfGvDoc }]
_formats += [{ 'type' : "ps", _formats += [{ 'type' : "ps",
'ext' : "ps",
'descr': _("Postscript"), 'descr': _("Postscript"),
'mime' : "application/postscript", 'mime' : "application/postscript",
'class': GVPsDoc }] 'class': GVPsDoc }]
_formats += [{ 'type' : "svg", _formats += [{ 'type' : "svg",
'ext' : "svg",
'descr': _("Structured Vector Graphics (SVG)"), 'descr': _("Structured Vector Graphics (SVG)"),
'mime' : "image/svg", 'mime' : "image/svg",
'class': GVSvgDoc }] 'class': GVSvgDoc }]
_formats += [{ 'type' : "svgz", _formats += [{ 'type' : "svgz",
'ext' : "svgz",
'descr': _("Compressed Structured Vector Graphs (SVG)"), 'descr': _("Compressed Structured Vector Graphs (SVG)"),
'mime' : "image/svgz", 'mime' : "image/svgz",
'class': GVSvgzDoc }] 'class': GVSvgzDoc }]
_formats += [{ 'type' : "jpg", _formats += [{ 'type' : "jpg",
'ext' : "jpg",
'descr': _("JPEG image"), 'descr': _("JPEG image"),
'mime' : "image/jpeg", 'mime' : "image/jpeg",
'class': GVJpegDoc }] 'class': GVJpegDoc }]
_formats += [{ 'type' : "gif", _formats += [{ 'type' : "gif",
'ext' : "gif",
'descr': _("GIF image"), 'descr': _("GIF image"),
'mime' : "image/gif", 'mime' : "image/gif",
'class': GVGifDoc }] 'class': GVGifDoc }]
_formats += [{ 'type' : "png", _formats += [{ 'type' : "png",
'ext' : "png",
'descr': _("PNG image"), 'descr': _("PNG image"),
'mime' : "image/png", 'mime' : "image/png",
'class': GVPngDoc }] 'class': GVPngDoc }]
@ -627,7 +636,7 @@ class GraphvizFormatComboBox(gtk.ComboBox):
return 0 return 0
def get_ext(self): def get_ext(self):
return '.%s' % _formats[self.get_active()]["type"] return '.%s' % _formats[self.get_active()]['ext']
def get_format_str(self): def get_format_str(self):
return _formats[self.get_active()]["type"] return _formats[self.get_active()]["type"]