2003-07-25 Tim Waugh <twaugh@redhat.com>

* src/Report.py: Support for making output formats printable.
        * src/plugins/GraphViz.py: Make it printable.


svn: r1930
This commit is contained in:
Tim Waugh
2003-07-25 18:22:07 +00:00
parent 794b331a82
commit bc09c11778
3 changed files with 44 additions and 2 deletions

View File

@@ -233,8 +233,14 @@ class GraphVizDialog(Report.ReportDialog):
def make_doc_menu(self):
"""Build a one item menu of document types that are
appropriate for this report."""
map = {"Graphviz (dot)" : None}
myMenu = Utils.build_string_optmenu(map, None)
name = "Graphviz (dot)"
menuitem = gtk.MenuItem (name)
menuitem.set_data ("d", name)
if os.system ("dot </dev/null 2>/dev/null") == 0:
menuitem.set_data ("printable", _("Generate print output"))
menuitem.show ()
myMenu = gtk.Menu ()
myMenu.append (menuitem)
self.format_menu.set_menu(myMenu)
def make_document(self):
@@ -283,6 +289,11 @@ class GraphVizDialog(Report.ReportDialog):
self.colorize, self.adoptionsdashed, self.arrowheadstyle,
self.arrowtailstyle, self.show_families)
if self.print_report.get_active ():
os.environ["DOT"] = self.target_path
os.system ('dot -Tps "$DOT" | %s' %
self.get_print_dialog_app ())
#------------------------------------------------------------------------
#
#