Without a domain error, glib outputs on console:
> g_error_new_valist: runtime check failed: (domain != 0)
Let's just create a domain error for the file-pdf-load plugin.
This is a new API function, so now is the right time to add missing
parameters! This will allow to load a selection of pages, and even to
reorder the document while doing so. Or simply load all pages in the
right order with n_pages <= 0.
... by default.
Even though selecting nothing is equivalent to selecting all in our
code, let's just explicitly select all pages before showing the dialog
so to make this behavior explicit.
When there is a well-documented GError domain/code, use these,
especially since messages can be localized (not sure if that is the case
for this one, but theoretically it could) and change over time.
Also remove the "nice-to-have" comment on file-pdf-load since we won't
be changing it now, but leave it on file-pdf-load2 parameters which can
still change before 2.10.
- Clean out some C++ style comments (our coding style only accepts
C-style comments. Anyway these comments were just old useless code).
- A block indentation fix.
- As a guideline, it is better to keep a GError as the last parameter.
- In non-interactive mode, the new procedure must use the value in
parameter, otherwise passing the password just doesn't work.
Supports for password protected PDF. When an encrypted PDF is opened, a
dialog box asks for the password.
When an encrypted PDF is opened, a dialog box asks for the password.
The password dialog box loops as long as the password is wrong (or user
hits CANCEL/escape key)
Reviewed and fixed by Jehan.
Warning
g_thread_init has been deprecated since version 2.32 and should not be used in newly-written code. This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program.
Print a message to the user if poppler returns n_pages = 0.
Return to file open dialog.
This way we prevent uninitialised variable access down the line.
* fixes issues with poppler 0.17 completely
* uses new libgimp API to pass surfaces instead of pixbufs
* uses GTK+ 3 API to convert surfaces to pixbufs where available
I'm sure some plug-ins need to add their items *not* at the toplevel,
but since making plug-ins really tree-aware is a lot more work than
just fixing insert positions, I went for passing -1 as parent in
almost all cases. And because of laziness...