Commit Graph

95 Commits

Author SHA1 Message Date
Yuri Chornoivan
39b6e8147d Fix minor EBN issues 2018-09-01 11:25:57 +03:00
Yuri Chornoivan
c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Albert Astals Cid
739b591e25 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-15 10:14:45 +01:00
Albert Astals Cid
e8d9feed70 Fix potential crash in document saving
Probably doesn't happen very often since most of the times people don't save while rendering is still happening
but if that is the case we need to wait for all the rendering to finish otherwise we remove the document
from under the render thread feet and bad things happen
2018-02-14 17:51:01 +01:00
Albert Astals Cid
2d8b2c7e95 Add support for cancellable image rendering and text extraction
Summary:
Only supported by the pdf backend if using poppler >= 0.63

Sadly had to change the generator API

Text cancellation is a bit wobbly still since poppler has large parts
of the code where doesn't check for the cancellation flag, but that
is something that will get automagically fixed for us if the poppler
side is improved

Test Plan: Needs https://bugs.freedesktop.org/show_bug.cgi?id=104263

Reviewers: ervin, rkflx

Reviewed By: ervin, rkflx

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9328
2018-02-01 22:53:28 +01:00
Albert Astals Cid
a93661e892 Merge remote-tracking branch 'origin/master' into dont-use-docdata-for-annots-and-forms 2017-09-27 15:01:57 +02:00
Henrik Fehlauer
bd20e48c3c Update to synctex 1.19
Summary:
This should prevent crashes when reloading some synctex-enabled pdf
files created with newer versions of TeXLive. We also gain bugfixes,
features and improved accuracy from the last 6 years of synctex
development.

Procedure followed:
- svn co svn://tug.org/texlive/trunk/Build/source/texk/web2c/synctexdir
- Check out revision 45150
- Update files present in core/synctex/*
- Adapt Okular code to changes
- Review and drop or update/apply old patches using quilt
- Create missing patches for local synctex changes
- New patch: Omit warning message when opening non-synctex pdf
- Two new patches to fix more compiler warnings
- New patch: Plug multiple leaks and prevent a segfault

TODO for later:
- Move sync file detection code to Okular to never call into synctex C code for non-synctex files
- Evaluate feasibility of upstreaming all patches for TeXLive 2018 and using synctex as a library

BUG: 383915
FIXED-IN: 17.12.0

Test Plan:
- No crash in synctex on reloading empty.pdf from bugreport anymore.
- Shift-clicking on a word in a simple pdf opens Kate with the corresponding tex line.
- Forward and backward search in Kile seems to work.
- Works with synctex files from both TeXLive 2015 and 2017.
- PartTest::testForwardPDF still passes.
- No additional memory leaks in autotests and with basic synctex and non-synctex usage of Okular.

Reviewers: #okular, sander, #kile, aacid

Reviewed By: #okular, aacid

Subscribers: mludwig, aacid

Tags: #okular

Differential Revision: https://phabricator.kde.org/D7594
2017-09-12 21:56:49 +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
Tobias Deiminger
0957abc39a Add annotation resize functionality
Usage:
If you left-click an annotation, it gets selected. Resize handles appear on the selection rectangle. When cursor is moved over one of the 8 resize handles on the corners/edges, the cursor shape changes to indicate resize mode. Everywhere else on the annotation means "move", just as it was before resize feature was added. Pressing ESC or clicking an area outside the annotation cancels a selection. Pressing Del deletes a selected annotation.

Feature is only applicable for annotation types AText, AStamp and AGeom.

Implementation:
It works by eventually changing AnnotationPrivate::m_boundary and notifying generator (i.e. poppler) about that change. Annotation state handling is shifted out of PageView into a new class MouseAnnotation (ui/pageviewmouseannotation.cpp). Some functionality not related to resizing but to annotation interaction in general is also shifted to class MouseAnnotation, to build a single place of responsiblity.

Other changes:
Add method Document::adjustPageAnnotation, backed by a QUndoCommand.
class Okular::AdjustAnnotationCommand.
Add Annotation::adjust and Annotation::canBeResized methods.
Draw resize handles in PagePainter::paintCroppedPageOnPainter.

Resize and move work
-for types AText, AStamp and AGeom
-on all pages of document
-when viewport position changes
-when zoom level changes
-for all page rotations (0°, 90°, 180°, 270°)

Selection is canceled
-when currently selected annotation is deleted
-on mouse click outside of currently selected annotation
-ESC is pressed

Viewport is shifted when mouse cursor during move/resize comes close to viewport border.
Resize to negative is prevented.
Tiny annotations are still selectable.
If mouse is moved over an annotation type that we can focus, and the annotation is not yet focused, mouse cursor shape changes to arrow.
If mouse cursor rests over an annotation A, while annotation B is focused, a tooltip for annotation A is shown.
Selected Annotation is deleted when Del is pressed.

Test for regressions:
-Annotation interaction (focus, move, resize, start playback, ...) are only done in mode EnumMouseMode::Browse.
-If mouse is moved over an annotation type where we can start an action, mouse cursor shape changes to pointing hand.
-If mouse is moved over an annotation type that we can't interact with, mouse cursor shape stays a open hand.
-If mouse cursor rests over an annotation of any type, a tooltip for that annotation is shown.
-Grab/move scroll area (on left click + mouse move) is prevented, if mouse is over focused annotation, or over AMovie/AScreen/AFileAttachment annotation.
-A double click on a annotation starts the "annotator".

REVIEW: 127366
BUG: 177778
BUG: 314843
BUG: 358060
2017-03-19 23:18:17 +01:00
Albert Astals Cid
4573c7a646 Recalculate forms after other are edited
BUGS: 376958
2017-03-03 01:08:44 +01:00
Albert Astals Cid
1d2dd42c67 no need for & here 2017-03-02 22:45:45 +01:00
Albert Astals Cid
ec70995895 QString as key is evil, add a nice enum 2017-03-02 21:04:59 +01:00
Albert Astals Cid
be6b0b6f48 Fix porting bug regarding the font extraction progress
BUGS: 375782
2017-01-31 22:50:54 +01:00
Albert Astals Cid
ecf54e4203 Try other generators if opening fails with one generator
This is not very common but would happen so be a bit stubborner
2016-12-08 23:35:04 +01:00
Aleix Pol
a704fbce94 Fix porting QUrl issues
Reviewed by Albert Astals
2016-01-30 20:00:25 +01:00
Alex Richardson
2f9246ae42 Port to new JSON plugin loading system
This means Okular can now work without ksycoca and KDELibs4Support.

REVIEW: 126193
2016-01-04 15:59:07 +01:00
Montel Laurent
04943508cf Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	core/document.cpp
	core/version.h
2015-03-04 07:55:32 +01:00
Albert Astals Cid
10a1899058 Hack to restore KWallet support
Better fix code-wise will come with an API break in master

BUGS: 339170
2015-02-09 22:03:44 +01:00
Lukáš Tinkl
e9ae1d99af port away from KLocale 2015-01-29 21:48:47 +01:00
Lukáš Tinkl
fd6a35486e port KUrl -> QUrl 2015-01-29 20:55:57 +01:00
Montel Laurent
5da7c5f77d port to qCDebug. Autogenerate export headers 2014-10-27 22:35:06 +01:00
Montel Laurent
17a55c6dab Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	CMakeLists.txt
	core/document.cpp
	generators/poppler/CMakeLists.txt
	generators/poppler/generator_pdf.cpp
	generators/poppler/generator_pdf.h
2014-10-09 07:34:35 +02:00
Albert Astals Cid
e8fd56f3ba Fixup last commit
Somehow i ended up commiting a partial patch and not what was in reviewboard, this amends the previous commit to be what i really wanted to commit

Sorry for the mess :/
2014-10-09 00:53:54 +02:00
Albert Astals Cid
d95efa7698 Move synctex up to the core from poppler generator
This way dvi and any other potential user gets it for free

The diff is huge, but the synctex files are just moves.

And the code in core/ is also mostly just a move from the generator_pdf.cpp code

Acked by Luigi

REVIEW: 120311
2014-10-09 00:17:53 +02:00
Frederik Gladhorn
3581fb6245 Port to QTemporaryFile 2014-09-18 00:30:39 +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
Fabio D'Urso
288f87f1a5 Merge branch 'master' into dont-use-docdata-for-annots-and-forms
Conflicts:
	core/document.cpp
	core/document_p.h
	part.cpp
	part.h
2014-09-08 14:58:55 +02:00
Frederik Gladhorn
b79e706e56 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	generators/dvi/generator_dvi.cpp
	generators/ooo/generator_ooo.cpp
	part.cpp
	shell/main.cpp
	shell/shell.cpp
	shell/shell.h
	shell/shellutils.h
	tests/CMakeLists.txt
	ui/propertiesdialog.cpp
2014-08-14 13:35:43 +02:00
Albert Astals Cid
e9e3d4a435 Make documentInfo be Hash based instead of XML based 2014-08-10 22:38:13 +02:00
Albert Astals Cid
61c830cb7a Pass the command line options properly when using tabs or unique instances
Use a QString to serialize the command line options other than urls to open so it can be easily passed around to every place that opens a new shell or tab or overrides the content in a unique instance.

BUGS: 334100
FIXED-IN: 4.14.0
REVIEW: 119595
2014-08-08 22:35:53 +02:00
Frederik Gladhorn
75031eee7e Fix includes 2014-08-08 01:59:55 +02:00
Fabio D'Urso
859168eaa8 Update some variables properly when swapping backing file 2014-05-11 18:52:16 +02:00
Fabio D'Urso
31efd827f9 Load and store generalInfo metadata for .okular archives too
generalInfo metadata is everything but annots and forms, which are
stored within the .okular archive itself
2014-05-11 18:52:16 +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
Fabio D'Urso
3b227582d2 Don't save annotation changes to docdata/
But existing annotations (from previous versions) are preserved
2014-05-11 18:52:15 +02:00
Fabio D'Urso
d0af66f082 openDocumentArchive: moved unpacking code to a separate method 2014-05-11 18:52:14 +02:00
Fabio D'Urso
cebe8d6509 Merge remote-tracking branch 'origin/KDE/4.13' 2014-05-10 11:48:59 +02:00
Fabio D'Urso
f7ec9df0af Don't leak temporary unpacked metadata files extracted from .okular files 2014-05-10 11:37:50 +02:00
Albert Astals Cid
7b7fef0bea Move the messagebox about continuing search from core to ui 2014-05-10 11:33:21 +02:00
Albert Astals Cid
c8697989a1 Do not duplicate the noDialogs storage in two structs 2014-05-10 10:09:38 +02:00
Albert Astals Cid
3c3d4373ab Do not reset the search if it's a different search id
Doesn't make any sense, why would we want a "running searches map" if we
always reset the previous one?

BUGS: 334568
FIXED-IN: 4.13.2
2014-05-10 10:07:23 +02:00
Albert Astals Cid
6bf6b14f3c Do not reset the search if it's a different search id
Doesn't make any sense, why would we want a "running searches map" if we
always reset the previous one?

BUGS: 334568
FIXED-IN: 4.13.2
2014-05-10 10:04:47 +02:00
Albert Astals Cid
630d3a8a5f Simplify search parameter passing 2014-05-10 00:49:01 +02:00
Albert Astals Cid
e93d5bda01 Move KWallet code from pdf backend to ui
This helps with the widget dependency removal in the core/backends
2014-05-09 19:58:43 +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
Albert Astals Cid
076e0cfaf8 More the commands to a different file 2013-04-06 00:39:35 +02:00
Albert Astals Cid
d0fd156dc9 Minor tweaks 2013-04-06 00:28:39 +02:00