GNOME Bugzilla – Bug 582964
Add progress signal to GtkPrintOperation
Last modified: 2009-08-07 07:43:36 UTC
Right now, the only way to get progress information when printing is gtk_print_operation_set_show_progress() which uses it's own dialog window. In evince we use the message area to show such an information, but it's not possible to know the total number of pages that will printed. It would be nice to have a progress signal emitted every time a page is generated.
Created attachment 134827 [details] [review] Add progress signal to GtkPrintOperation gtk/gtkprintoperation.c | 29 ++++++++++++++++++++++++++++- gtk/gtkprintoperation.h | 3 +++ 2 files changed, 31 insertions(+), 1 deletions(-)
ping. I would like to implement progress information in evince for 2.28 when using gtk print operation to avoid a regression. Thanks.
Two initial comments: 1) Admittedly, it may be a bit ugly, but if you are only after updating the progress once per printed page, can't you just use the draw-page signal for that ? 2) If we really go for a separate ::progress signal, I think the current progress feedback should be reworked to use that signal, rather than the other way around.
(In reply to comment #3) > Two initial comments: > > 1) Admittedly, it may be a bit ugly, but if you are only after updating the > progress once per printed page, can't you just use the draw-page signal for > that ? yes, but in that case I would need a way to get priv->nr_of_pages_to_print, if we add a method in gtk_print_operation for that, it's ok to me. > 2) If we really go for a separate ::progress signal, I think the current > progress feedback should be reworked to use that signal, rather than the other > way around. > Fair enough.
Please tell me which approach you prefer (a signal or a new method to get nr_of_pages_to_print), and I'll make a new patch.
Lets go with gtk_print_operation_get_nr_of_pages_to_print()
Created attachment 139964 [details] [review] Add gtk_print_operation_get_n_pages_to_print() It returns the number of pages that will be printed to allow tracking the progress of a print operation
Looks ok, please commit.
Fixed in git master.