Commit graph

1554 commits

Author SHA1 Message Date
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
8944660ce7 Unbreak the code, need to register the metatype too ^_^ 2017-11-02 23:41:12 +01:00
Albert Astals Cid
c2c1d76a0f Merge remote-tracking branch 'origin/Applications/17.08' 2017-11-02 17:50:02 +01:00
Albert Astals Cid
662fa69a2d Fix crash on rotation jobs
We don't need to delete the threadweaver job, threadweaver does it by itself,
and if we call deleteLater it may happen that the main thread deletes it
and then when the threadweaver thread tries to call the delete things are
gone and it goes kaboom

BUGS: 382725
2017-11-02 17:49:08 +01:00
Albert Astals Cid
453f45e7f7 Start the text generation request via a queued connection
Summary:
so that pixmap generation gets a chance to start before the text generation

This makes that on files where both the text generation and the pixmap generation
are slow at least we see something "as fast as possible" since only either text generation
or pixmap generation threads run at the same time

Reviewers: #okular, mlaurent

Reviewed By: mlaurent

Subscribers: michaelweghorn, dvratil, mlaurent, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8378
2017-10-31 10:04:03 +01:00
Lukas Hetzenecker
ecc1141e02 HiDPI Support for Okular
Summary:
This patch enables HiDPI throughout the application

Every pixmap is multiplied by the devicePixelRatioF
QPainter code is ajusted to take the DPR value into account

All pixmaps get cached with the highest DPR of all screens. When moving the application to another screen, the cache doesn't have to be invalidated.

BUGS: 362856 383589
REVIEW: D6268
2017-10-14 14:47:20 +02:00
Albert Astals Cid
ef7c9c67bf Implement continuous search
Show non-intrusive info messages whenever the search start over from the
beginning or the bottom of the document, instead of asking the user if
s/he wants to continue the search. This is consistent with search in
KWrite/Kate and with web browsers.

Based on work of and reviewed by Elvis Angelaccio
2017-09-26 23:27:25 +02:00
l10n daemon script
62ce3db93b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-09-16 05:03:07 +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
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
a8a79368c7 Fix memory leak in text document settings d-pointers 2017-08-27 13:19:16 +02:00
Albert Astals Cid
0eb2f227b0 Fix memory leak in text document settings d-pointers 2017-08-27 13:18:31 +02:00
Albert Astals Cid
afd3a1423a Make it clear that the caller to convert takes ownership 2017-08-25 01:17:31 +02:00
Albert Astals Cid
0919ad87d1 Fix width and height being switched when printing Custom size
BUGS: 383734
2017-08-21 00:09:27 +02:00
Albert Astals Cid
fd5cc83e85 Fix warning in newer gcc versions 2017-07-27 16:57:40 +02:00
Oliver Sander
5fdbecf446 Simplify method FilePrinter::psPaperSize
The method FilePrinter::psPaperSize used to contain a long
list of hard-coded paper sizes for the different paper formats.
This patch makes the method get the same information
from QPrinter directly, which is much simpler and more
robust, too.

Note that the method is not actually used anywhere in okular,
though, so this change is purely cosmetic.

REVIEW: 130043
2017-07-05 20:37:36 +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
cfc158977f Add the additional action to form 2017-03-03 00:41:06 +01:00
Albert Astals Cid
56bcdad680 Refresh the pixmap of the page that contains the field when setting its text 2017-03-03 00:36:08 +01: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
Albert Astals Cid
1d2dd42c67 no need for & here 2017-03-02 22:45:45 +01:00
Albert Astals Cid
19be15b6a5 Field readOnly applies to the user but not to JS 2017-03-02 22:38:29 +01:00
Albert Astals Cid
519f0acac7 document which variant kind is returned 2017-03-02 22:23:41 +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
191a37fb52 Q_DECL_OVERRIDE -> override 2017-03-02 20:39:24 +01:00
Albert Astals Cid
4072eb0c3a Add override 2017-03-02 20:38:50 +01:00
Albert Astals Cid
b50aff3ed7 Q_NULLPTR -> nullptr 2017-03-02 20:09:32 +01:00
l10n daemon script
53a6cde141 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-02-04 06:23:35 +01:00
Albert Astals Cid
91f092cdf4 Merge remote-tracking branch 'origin/Applications/16.12' 2017-02-01 00:50:29 +01:00
Albert Astals Cid
96d8953878 Fix Enter turning the thumbnail filter bar into a regular search bar
BUGS: 375755
2017-02-01 00:49:21 +01:00
Albert Astals Cid
021cc986a8 Merge remote-tracking branch 'origin/Applications/16.12' 2017-01-31 22:52:45 +01:00
Albert Astals Cid
be6b0b6f48 Fix porting bug regarding the font extraction progress
BUGS: 375782
2017-01-31 22:50:54 +01:00
Elvis Angelaccio
3b610bd86a Fix wrong apidox
The duration argument is used as input of QTimer::start(),
which requires milliseconds and not seconds.

REVIEW: 129894
2017-01-29 18:30:03 +01:00
Martin T. H. Sandsmark
7f3eebd9f3 Only show warning messages by default
REVIEW: 129832
2017-01-16 18:41:33 +01:00
Albert Astals Cid
ed4a9f42f4 Merge remote-tracking branch 'origin/Applications/16.12' 2017-01-16 00:37:25 +01:00
Albert Astals Cid
f467807506 Remove #ifdefs for Qt we require in cmake anyway 2017-01-16 00:36:08 +01:00
Martin T. H. Sandsmark
033f21c826 Port some missing debug output to categorized logging 2017-01-14 19:15:26 +01:00
Antonio Rojas
84c9910da9 Avoid duplicates in the available backends list
If a generator can open multiple mime types that match the same file, avoid showing a backend chooser dialog with multiple instances of the same
backend

REVIEW: 129791
BUG: 374650
2017-01-08 19:48:10 +01:00
Antonio Rojas
f3f077e1a6 Avoid duplicates in the available backends list
If a generator can open multiple mime types that match the same file, avoid showing a backend chooser dialog with multiple instances of the same
backend

REVIEW: 129791
BUG: 374650
2017-01-08 19:38:42 +01:00
l10n daemon script
fb77e0d1fd SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-12-20 13:06:28 +01:00
Albert Astals Cid
ef860fb1d8 Merge remote-tracking branch 'origin/Applications/16.12' 2016-12-08 23:39:47 +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
Miklós Máté
e81fb3d639 Check all supported mime types the generator supports
Stopping on the first inherit match can prevent finding a perfect match, and thus we might enter a competition of inherit matches from other generators.

Example: spectre supports application/postscript and image/x-eps. When opening an eps the app/ps is an inherit match, but so is text/plain from the txt generator. Thanks to stable_sort() the txt generator is deterministically selected from the above two inherit matches. Unless we continue and find the perfect match, which is spectre:image/x-eps.

REVIEW: 129610
2016-12-08 22:42:44 +01:00
Albert Astals Cid
2868e3e5ca Support SetOCGState links
Needs a very recent poppler

BUGS: 368402
REVIEW: 129216
2016-11-26 16:00:46 +01:00
Albert Vaca
3c93b2523e Added missing overrides found by clang-tidy 2016-10-29 17:07:10 +02:00
Albert Vaca
c71f308252 Fixes suggested by Clazy 2016-10-29 16:33:05 +02:00
Albert Vaca
dd126149d6 Use Qt to detect the paper type and name. 2016-10-29 16:33:05 +02:00
Aleix Pol
ebeeac8d72 Set the version to 1.0
Remove redundant version.h file in favor of the ecm-generated.
Use minor version from KDE_APPLICATIONS_VERSION_*

Reviewed by Albert Astals
2016-10-29 12:42:59 +02:00
Albert Astals Cid
62eea3336b Merge remote-tracking branch 'origin/master' into frameworks 2016-10-29 11:13:24 +02:00