After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 582964 - Add progress signal to GtkPrintOperation
Add progress signal to GtkPrintOperation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.17.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-05-17 18:37 UTC by Carlos Garcia Campos
Modified: 2009-08-07 07:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add progress signal to GtkPrintOperation (2.52 KB, patch)
2009-05-17 18:39 UTC, Carlos Garcia Campos
needs-work Details | Review
Add gtk_print_operation_get_n_pages_to_print() (4.12 KB, patch)
2009-08-05 18:24 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2009-05-17 18:37:35 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.
Comment 1 Carlos Garcia Campos 2009-05-17 18:39:05 UTC
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(-)
Comment 2 Carlos Garcia Campos 2009-07-12 11:33:24 UTC
ping. I would like to implement progress information in evince for 2.28 when using gtk print operation to avoid a regression. Thanks. 
Comment 3 Matthias Clasen 2009-07-13 16:26:03 UTC
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.
Comment 4 Carlos Garcia Campos 2009-07-13 17:25:50 UTC
(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.

Comment 5 Carlos Garcia Campos 2009-08-05 08:04:28 UTC
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. 
Comment 6 Matthias Clasen 2009-08-05 11:31:08 UTC
Lets go with gtk_print_operation_get_nr_of_pages_to_print()
Comment 7 Carlos Garcia Campos 2009-08-05 18:24:35 UTC
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
Comment 8 Matthias Clasen 2009-08-07 03:18:25 UTC
Looks ok, please commit.
Comment 9 Carlos Garcia Campos 2009-08-07 07:43:36 UTC
Fixed in git master.