Commit graph

1540 commits

Author SHA1 Message Date
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
Albert Astals Cid f943f9ee8b Remove the !this checks
It's not part of the standard and GCC recently removed support for it

Looking at the code it seems we only need one external check, let's hope i'm right :D
2016-10-17 13:02:49 +02:00
Albert Astals Cid 75c387c62c increase version in master 2016-10-07 01:00:49 +02:00
Albert Astals Cid 7003eff75e Increase version
We had the cbr fix

GIT_SILENT
2016-10-07 00:59:46 +02:00
Albert Astals Cid 744a6901d6 Increase version
Meh i forgot to update it for .0

GIT_SILENT
2016-08-23 00:22:33 +02:00
Olivier CHURLAUD 411bdee0eb Open relative path again
REVIEW: 128507
2016-08-03 16:01:30 +02:00
Martin T. H. Sandsmark f87a306ec1 Fix warning about incompatible pointers in synctex parser 2016-07-24 22:30:39 +02:00
Martin T. H. Sandsmark d2f4f1c2d7 Remove outdated compiler message 2016-07-24 22:11:46 +02:00
Martin T. H. Sandsmark a6ec5ea9de Fix parsing of lilypond URLs 2016-07-24 20:27:04 +02:00
Albert Astals Cid ea607664d2 Beta version for KDE Applications 16.08 2016-07-21 23:46:24 +02:00
Olivier CHURLAUD 33122dd825 Uncomment printing option pdf2ps 2016-07-21 20:33:04 +02:00
Olivier CHURLAUD dd8fa351ce Fonts are scanned again by poppler5
Fonts are filtered as well to only appear once.

REVIEW: 128441
2016-07-13 23:46:43 +02:00
Olivier CHURLAUD ec0b68a756 Update deprecated KArchive method + remove unused variable in
generator_pdf

Reviewer: sandsmark
2016-07-13 21:00:35 +02:00
Martin T. H. Sandsmark 89e5f17542 Improve matching of generators
Instead of trying to use the plain text generator for everything, try to
find a more specialized one first.

BUG: 323213
2016-07-13 03:23:09 +02:00
Martin T. H. Sandsmark 3985577c90 Unbreak fetching of supporting generators 2016-07-13 02:27:55 +02:00