The only affected generator is poppler (because it's the only one with
saving support).
Since version 0.20, Poppler can save annotations to PDF. If the user is
using an older version, this patch warns him that annotations are not
saved.
as of Eugene Trounev sent them to me more than three years ago, just gz-compressing them now;
followup of b811186781
(apparently I forgot to commit them at that time)
It was "Note" before d2fa4c9, but it was changed to "Comment" for
compatibility reasons. Setting it to "Note", this time in UI code,
doesn't break d2fa4c9 and restores the default icon users are used to.
This patch makes sure that the file saved in the .okular file keeps
the original filename (and, in particular, the extension) even if the
user is re-exporting a .okular archive as .okular archive. Before this
patch, the file boundled in the .okular archive would be named like the
.okular file it was exported from (eg foo.okular instead of foo.pdf).
Note: Okular had no problems in reopening it, but advanced users
unpacking the ZIP file obtained a .okular file which is actually a
native file, and not an okular archive.
Do not assume that oldPage == m_document->viewport().pageNumber, because
it's false if we are processing a viewport change notification.
It caused presentation drawings to turn into persistent annotations,
when switching page from the main okular window.
In general, this patch also tidies up PresentationWidget::changePage a bit:
- Removed redundant checks: they are always true
- Removed duplicated code that performed the page opening actions:
Previously the first slide and the other ones followed different code
paths, both doing the same things. I unified them.
I also changed slotNextPage so that it never sets m_frameIndex = -1, because
it confuses changePage and makes it skip page closing actions.
1) If the user had previously annotated the document with an old okular
version and the document contains existing annotations and no /Encrypt
(ie the case where annotation changes are no longer saved locally), make
Document::saveDocumentInfo write the original unmodified local
annotations back to XML, so that it seems that the original file was not
changed. If the user makes annotation changes, code from previous
patches already asks him to save them to a different document on close.
2) Ask "Save changes?" if the user has modified annotations in a .okular
archive.
BUG: 300197
3) Turned a "sorry" message in a "information" (with dontshowthisagain),
because now we also have the "Save changes?" prompt to inform the user.
4) Suppressed all annotation-related message boxes on document opening
- Make "Comment" the default stamp instead of "Note" (because we used to omit
the "icon" in the exported DOM if it was "Comment")
- Don't omit the icon name anymore
This patch turns Okular into a ReadWritePart. Annotation editing is always
disabled if we're loaded as ReadOnlyPart, no matter the document type.
REVIEW: 105020
The only affected generator is poppler. Note that:
Document has /Encrypt <=iff=> SaveInterface supportsOption(SaveChanges) is false
This patch enforces the following behavior (and warns the user the first time
he edits an annotation).
- If the document has /Encrypt, warn that "Save as" is not available, but it's
possible to export as okular archive. New annotations will be automatically
saved to XML as usual.
Note that the previous patch already made all existing annotations uneditable,
because there's no way to save them.
- If the document has no /Encrypt and there are existing external annotations,
warn that changes won't be saved automatically. The user needs to "Save as" or
changes will be lost.
- If the document has no /Encrypt and there aren't existing external
annotations, don't show any warning. New annotations will be automatically saved
to XML as usual and to file if "Save as" is pressed.
The previous counter-based approach didn't take into account existing names used
by external annotations and names used in other pages.
Instead of creating a document-global table of used names, I used random UUIDs
as a source of unique names.