Commit graph

189 commits

Author SHA1 Message Date
Albert Astals Cid 4e6c9f8f7a Fix crash when accessing text page after save
text page was storing a pointer to a PagePrivate pointer but those die
after saving so we need to store a Page pointer since those are stable.

BUGS: 387247
2017-12-05 23:07:10 +01:00
Albert Astals Cid 3957683d76 Merge branch 'dont-use-docdata-for-annots-and-forms' into Applications/17.12 2017-11-16 15:00:23 +01:00
Albert Astals Cid 19b7e3c112 The work in this branch was sponsored by LiMux
give them some credit in the headers
2017-11-16 09:58:31 +01:00
Albert Astals Cid a2f5560c00 PDF: Support the poppler 0.62 renderToImage with update callback
Summary:
This way pages that take more than 500ms to render get updated every so often so that the
user can see that the program didn't hang, it's just that it's taking long to render

Tags:
incremental rendering, partial updates

BUGS: 344081

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8379
2017-11-09 17:28:54 +01:00
Albert Astals Cid ca5422d0e9 Implement swapBackingFile for the PDF backend
How does it work:
 * What it does is really closing and opening the file again through poppler
 * This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
	* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
		* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
	* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
	* The annotationmodel needs updating it's pointers
	* The widgets for the forms are reused and their form* updated
	* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)

TODO: Make this work for .okular files
TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
TODO: autotests
2017-10-26 15:30:44 +02:00
Albert Astals Cid 8690497be7 Add Page::annotation
Will use it later
2017-10-25 15:21:46 +02:00
Albert Astals Cid 04ed10d3ea Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-09-11 19:51:51 +02:00
Kevin Funk a53a2402ca clang-tidy: modernize-use-nullptr run
Semi-ACK'd by Albert :)
2017-09-06 00:19:48 +02:00
Albert Astals Cid 2ca1779feb Add a way to get the PagePrivate if you have the Page 2017-03-03 00:32:08 +01:00
Martin T. H. Sandsmark f05d42eac3 core: Fix build without implicit cast to/from ascii
See previous commits for details.
2016-07-11 22:07:57 +02:00
Montel Laurent 466eb79615 Use QStringLiteral 2015-10-29 13:37:11 +01:00
Frederik Gladhorn 6c602bf0e7 Use categorized logging even more 2014-09-16 23:38:25 +02:00
Frederik Gladhorn 9d89739972 Use categorized logging 2014-09-16 23:24:36 +02:00
Frederik Gladhorn 83d3f1f6b7 Revert "Some more kDebug->qDebug"
Seems like kDebug doesn't spam the user, so this needs to use qCDebug.

This reverts commit 34fbdf8c85.
2014-09-11 02:03:46 +02:00
Fabio D'Urso e059d2652c core: support for migration of annots and forms out of docdata/ 2014-09-10 12:18:34 +02:00
Frederik Gladhorn 34fbdf8c85 Some more kDebug->qDebug 2014-09-09 18:17:36 +02:00
Fabio D'Urso 57c9cae257 Don't save form contents to docdata/
But existing saved form from previous Okular versions are preserved
2014-05-11 18:52:15 +02:00
Michal Humpula c07ee043a3 Multiple Tiles Managers per Page
It's straighforward implementation. Every single place, where there were call for (or with) TilesManager, now has a DocumentObserver as companion. The m_tiledManager reference in PagePrivate was changed to QMap<DocumentObserver, TilesManager>.

REVIEW: 113986
2014-02-19 23:41:22 +01:00
Jon Mease 43246c563b Viewport transition refinements for Find and Undo/Redo actions
REVIEW: 114060

This patch introduces viewport transitions for undo/redo actions on annotations and forms.  When an annotation/form action is undone/redone but the associated annotation/form is not currently visible, the viewport is updated to center on the undo/redo action. If the annotation/form is visible, the viewport is not updated.

The viewport transitions for the Find action have also been updated to this same algorithm.  Previously the viewport was moved to center on each matching search term even if the search term was already visible in the viewport. This lead to unnecessary viewport transitions if the search term matched several items in a single paragraph for example.

These proposed changes to the viewport transition behavior are consistent with the find and undo behavior of many existing applications including Kate, Open Office, and Foxit PDF Reader.
2013-12-29 23:27:30 +01:00
Fabio D'Urso a556126816 Fix the issue exposed by the previous patch
The patch de-singletons the PageController class.

The PageController is now per-document and it gets deleted when the
document is closed.

As consequence of this, the RotationJob's done signal will not be
delivered if the document has been closed, and thus this fixes the
crash.
2013-07-30 20:40:40 +02:00
Fabio D'Urso 3c65f81fb9 Prefer annotations in the foreground in Page::objectRect 2013-07-01 22:06:46 +02:00
Peter Grasch 4d4dd68ca2 Fix usability issues with selecting annotations
REVIEW: 109627
2013-06-23 19:22:21 +02:00
Jon Mease 3c6140b616 Fix Undo / Redo of annotation creation doesn't properly handle page rotation and adds undo unit tests
BUG: 318091
REVIEW: 109989
2013-04-13 22:54:47 +02:00
Jon Mease 78faf1e68f Add undo/redo support for annotations
REVIEW: 107442
2013-04-06 00:22:48 +02:00
Albert Astals Cid 541650a4f4 Remove the concept of observer/view id
Just use the pointer as id :-)

This is BIC and SIC, increase the soversion now to makes sure we don't forget in the future

Patch based in an earlier patch by Bogdan Cristea <cristeab@gmail.com>
REVIEW: 109115
2013-02-24 23:01:02 +01:00
Mailson Menezes 7528fb8c88 Change TilesManager::tilesAt use
- The second parameter has changed to an enum
 - Now Page::tilesAt only returns tiles with pixmaps
2012-11-15 20:41:17 -03:00
Fabio D'Urso d3eb739814 Merged TilesManager::setWidth and setHeight into a single setSize method 2012-11-11 21:39:23 +01:00
Mailson Menezes f56c5a8ac9 Merge branch 'master' into tiled-rendering 2012-11-08 20:51:01 -03:00
Fabio D'Urso 437ddad588 Hide tiles manager within okularcore
Only the Tile class (tile.h) is visible from the outside
2012-11-08 20:26:17 -03:00
Fabio D'Urso e12966b259 Removed possibility to have a tiles manager per observer
Now only the PageView can have a tiles manager.
2012-11-08 20:52:01 +01:00
Jan Binder aa6ed8afc0 Replace deprecated QMatrix by QTransform
REVIEW: 105737
2012-09-08 17:06:02 +02:00
Mailson Menezes 0053b9c015 Remove unused property from PixmapObject
This property was added before the tiles manager was created.
2012-08-24 14:02:07 -03:00
Mailson Menezes 2d5b51ff88 Fix crash when changing between memory profiles 2012-08-24 14:01:54 -03:00
Mailson Menezes 851a503e81 Move tiles manager to a private header 2012-08-17 15:23:58 -03:00
Mailson Menezes 401c3f7e5d Add rotation support to tiles manager 2012-08-17 14:30:53 -03:00
Tobias Koenig 58eb957f26 Support multiple annotations in RMB menu
Provide the actions for all annotations in the RMB menu, if multiple
annotations are located on top of each other.

BUGS: 300942
REVIEW: 106035
FIXED-IN: 4.10.0
2012-08-15 17:24:11 +02:00
Mailson Menezes 3c09b93713 Merge branch 'master' into tiled-rendering
Conflicts:
	core/document.cpp
2012-08-15 11:44:22 -03:00
Mailson Menezes 032f03a0e8 Track memory usage of tiles 2012-07-16 18:19:02 -03:00
Mailson Menezes 9c09eb938e Use tiles only when it's necessary
In other words: don't use tiles when the page is not big enough
2012-07-16 18:19:01 -03:00
Mailson Menezes de2ee00ff8 Improvements on tiles manager
- Made improvements on the code (not performance)
 - Fix issue of not painting dirty tiles
2012-07-11 02:14:50 -03:00
Mailson Menezes 9f3cf45e37 Rendering with a tiles manager
Currently it's only available for PDFs and does not support rotation.
2012-07-08 18:08:38 -03:00
Fabio D'Urso 86c92ffec2 Fixes against causes of annotation data loss + Improved GUI message logic
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
2012-06-05 00:49:01 +02:00
Mailson Menezes 83282971d8 Render current viewport only 2012-05-29 14:06:02 -03:00
Fabio D'Urso 6c296b916b Use UUIDs intead of a (broken) counter to generate annotations' unique names
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.
2012-05-17 23:50:20 +02:00
Fabio D'Urso 249bea5985 Re-add restored annotations via Document so that AnnotationProxy gets notified
Previously, restored annotations followed a shorter path that bypassed AnnotationProxy
2012-05-17 23:50:14 +02:00
Fabio D'Urso ec9f068d77 Added AnnotationProxy to SaveInterface
Based on Pino Toscano's earlier work
2012-05-17 23:49:58 +02:00
Fabio D'Urso 07c57bb2ab Dead code removed (PagePrivate::modifyAnnotation)
The first if ("modified already") is always taken
2012-05-17 23:49:54 +02:00
Albert Astals Cid 9d805df013 Double click selects words
BUGS: 187347
FIXED-IN: 4.9,0
2012-03-25 23:48:47 +02:00
Jiri Baum 412e3e739e table selection tool - semi-automatic dividers
BUGS: 283440
REVIEW: 102788
2011-10-31 16:33:03 +01:00
Albert Astals Cid d41f230123 Move correctTextOrder to TextPagePrivate 2011-10-17 19:09:26 +02:00