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
All pages in a CHM File are now ordered accordingly to TOC Data. If a page is not in TOC, it will be added at the end.
Testing Done:
I created a small example chm file to test this. I can provide the file, if someone would like to have it.
Bugs closed: 236688
Reviewed at https://git.reviewboard.kde.org/r/130078/
Transfers zoom handling from KHTML to KHTMLView and QImage.
This way the font now actually increases when you zoom in and zoom handling is more in line with the other generators.
Bugs closed: 164198
Reviewed at https://git.reviewboard.kde.org/r/130127/
Okular sends a 'qFatal()', if no encoding could be guessed. This will also create a core dump crashing Okular and all open document in this instance.
Bugs closed: 262265
Reviewed at https://git.reviewboard.kde.org/r/130106/
kio_msits emitting mimetype function ported to QT5. A kio slave should always emit the mimetype (see kio slave api doc).
Reviewed at https://git.reviewboard.kde.org/r/130113/
Prevent MouseAnnotation from accessing PageViewItem widgets any longer
after PageView deletes them in PageView::notifySetup().
BUGS: 378696
REVIEW: 130087
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