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 758445 - Print should be disabled if the backend doesn't support it
Print should be disabled if the backend doesn't support it
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: books
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Books Maintainers
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-21 02:54 UTC by Andreas Nilsson
Modified: 2015-11-27 14:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application, documents, edit: Disable Print menu item when unsupported (3.14 KB, patch)
2015-11-24 14:50 UTC, Bastien Nocera
committed Details | Review
[gnome-3-18] application, documents, edit: Disable Print menu item when unsupported (3.16 KB, patch)
2015-11-25 11:23 UTC, Debarshi Ray
committed Details | Review

Description Andreas Nilsson 2015-11-21 02:54:56 UTC
I tried to press the print entry in the popup from the main menu, but nothing happened.
Comment 1 Debarshi Ray 2015-11-21 10:35:53 UTC
Yes, I have seen it too. It has also crashed on occasion.
Comment 2 Bastien Nocera 2015-11-21 15:08:47 UTC
Is that only in gnome-books, or in gnome-documents as well? Any error messages on the command-line, or a backtrace for that crash?
Comment 3 Andreas Nilsson 2015-11-21 22:39:46 UTC
I don't get a crash in gnome-books, but this is the error I get:

(org.gnome.Books:6643): EvinceView-CRITICAL **: ev_print_operation_new: assertion 'ev_print_operation_exists_for_document (document)' failed
Gjs-Message: JS LOG: Unable to print document file:///home/andreasn/Documents/The%20Walking%20Dead%20141.cbr: TypeError: printOp is null


In gnome-documents I get the print dialog, but I've managed to make it crash 2 times out of 5 when opening it, navigating to the same document and printing that. This is the error I get for that:

(org.gnome.Documents:7146): EvinceView-CRITICAL **: ev_page_cache_get_form_field_mapping: assertion 'EV_IS_PAGE_CACHE (cache)' failed
Segmentation fault (core dumped)
Comment 4 Bastien Nocera 2015-11-22 00:19:08 UTC
Right, two separate bugs then.

(In reply to Andreas Nilsson from comment #3)
> I don't get a crash in gnome-books, but this is the error I get:
> 
> (org.gnome.Books:6643): EvinceView-CRITICAL **: ev_print_operation_new:
> assertion 'ev_print_operation_exists_for_document (document)' failed
> Gjs-Message: JS LOG: Unable to print document
> file:///home/andreasn/Documents/The%20Walking%20Dead%20141.cbr: TypeError:
> printOp is null

The Print menu item should be disabled if the Evince backend can't print that type. Retitled the bug to that effect.

> In gnome-documents I get the print dialog, but I've managed to make it crash
> 2 times out of 5 when opening it, navigating to the same document and
> printing that. This is the error I get for that:
> 
> (org.gnome.Documents:7146): EvinceView-CRITICAL **:
> ev_page_cache_get_form_field_mapping: assertion 'EV_IS_PAGE_CACHE (cache)'
> failed
> Segmentation fault (core dumped)

Can you file a separate bug about that, with a full backtrace?
Comment 5 Andreas Nilsson 2015-11-22 11:50:36 UTC
(In reply to Bastien Nocera from comment #4)
> Can you file a separate bug about that, with a full backtrace?

I've filed bug #758491 for that. Will need to figure out where to get the backtrace.
Comment 6 Bastien Nocera 2015-11-24 14:50:53 UTC
Created attachment 316174 [details] [review]
application, documents, edit: Disable Print menu item when unsupported

When we finish to load a document, verify whether it can be printed
before enabling the "Print..." menu item.
Comment 7 Cosimo Cecchi 2015-11-25 01:43:06 UTC
Review of attachment 316174 [details] [review]:

Looks good to me, thanks.
Comment 8 Bastien Nocera 2015-11-25 09:16:03 UTC
Attachment 316174 [details] pushed as 6edb419 - application, documents, edit: Disable Print menu item when unsupported
Comment 9 Debarshi Ray 2015-11-25 11:23:42 UTC
Created attachment 316228 [details] [review]
[gnome-3-18] application, documents, edit: Disable Print menu item when unsupported

This looks useful for older branches too. Since it needed a minor conflict resolution and I don't have any non-printable files at hand, can someone please rubber stamp it?
Comment 10 Bastien Nocera 2015-11-25 11:25:23 UTC
(In reply to Debarshi Ray from comment #9)
> Created attachment 316228 [details] [review] [review]
> [gnome-3-18] application, documents, edit: Disable Print menu item when
> unsupported
> 
> This looks useful for older branches too. Since it needed a minor conflict
> resolution and I don't have any non-printable files at hand, can someone
> please rubber stamp it?

Launch gnome-books, and open a CBR or CBZ file. The comics backend of evince doesn't have print support.
Comment 11 Andreas Nilsson 2015-11-25 23:33:04 UTC
(In reply to Debarshi Ray from comment #9)
> Created attachment 316228 [details] [review] [review]
> [gnome-3-18] application, documents, edit: Disable Print menu item when
> unsupported
> 
> This looks useful for older branches too. Since it needed a minor conflict
> resolution and I don't have any non-printable files at hand, can someone
> please rubber stamp it?

I changed to 3-18 branch and applied this patch on top. Seems to work well enough. I can lend you a file that I bought via the humble bundle for testing if you want to give it a try yourself. I'll send it by mail tomorrow.
Comment 12 Andreas Nilsson 2015-11-25 23:38:56 UTC
I found a website with some free samples after some searching.
http://www.bitcartel.com/comicbooklover/samplecomics.html

This Wasteland comic preview should do it:
http://www.bitcartel.com/downloads/wasteland_issue1_preview.cbr