From 7b8ed5ded7ca39058655fa2b8b0d901deca4c9cc Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 30 Mar 2008 15:06:34 +0000 Subject: [PATCH] 0001232: Preview now allows Print; no more PRINT_OPERATION failure svn: r10426 --- src/docgen/GtkPrint.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/docgen/GtkPrint.py b/src/docgen/GtkPrint.py index 07f70c250..9572e528f 100644 --- a/src/docgen/GtkPrint.py +++ b/src/docgen/GtkPrint.py @@ -537,9 +537,19 @@ class GtkPrint(CairoDoc): # run print dialog while True: self.preview = None - res = operation.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, None) - if self.preview is None: + res = operation.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG) + if self.preview is None: # cancel or print break + # set up printing again; can't reuse PrintOperation? + operation = gtk.PrintOperation() + operation.set_default_page_setup(page_setup) + operation.connect("begin_print", self.on_begin_print) + operation.connect("draw_page", self.on_draw_page) + operation.connect("paginate", self.on_paginate) + operation.connect("preview", self.on_preview) + # set print settings if it was stored previously + if PRINT_SETTINGS is not None: + operation.set_print_settings(PRINT_SETTINGS) # store print settings if printing was successful if res == gtk.PRINT_OPERATION_RESULT_APPLY: