Summary:
Typewriter is originally specified by the PDF reference as special FreeText annotation, where Intent=FreeTextTypewriter. It features opaque letters on transparent background, so that users can fill non interactive forms. Herewith typewriter is implemented natively for PDF, and there's also an Okular specific implementation for other document types. The added tool reuses the inline note UI.
This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.
FEATURE: 353401
Test Plan:
- okularpartrc is generated (if not yet existing) with typewriter as 10th tool
- typewriter tool is also available in Annotation Tools -> Add, Typ "Typewriter"
- selecting the tool and left click into document opens inline note input dialog
- finishing creates an annotation similar to inline note, but with transparent background
- saving into PDF results in /Subtype FreeText /IT /FreeTextTypeWriter
- saving typewriter into archive stores color with alpha channel = 0x00
- opening annotated archive works, if archive was created with old Okular, and opened in patched Okular
- opening annotated archive works, if archive was created with patched Okular, and opened in old Okular
Reviewers: sander
Reviewed By: sander
Subscribers: ngraham, sander, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15204
Summary:
We request a inhibit lock of DBus type UNIX_FD from systemd logind. It's wrapped into (and owned by) a QDBusUnixFileDescriptor object of automatic storage. The file descriptor will be closed in QDBusUnixFileDescriptor Dtor, and may be reused by some other facility (e.g. pulseaudio).
If we want to store the lock longer than QDBusUnixFileDescriptor lifetime, we have to dup the file descriptor. If we don't dup, and close the original fd later in PresentationWidget::allowPowerManagement, bad things may happen.
Besides that, what we get from systemd is really a file descriptor, not a "cookie". So I renamed the m_sleepInhibitCookie to m_sleepInhibitFd and changed initial state to -1 accordingly.
BUG 393478
BUG 398720
Test Plan:
- bugs don't occur any longer
- inhibiting sleep during presentation mode still works
Reviewers: aacid
Reviewed By: aacid
Subscribers: ngraham, anthonyfieroni, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15574
- Use a QPixmap object instead of a QPixmap*
Quote from the QPixmap documentation:
"QPixmap objects can be passed around by value
since the QPixmap class uses implicit data sharing."
- Replace another pointer by std::unique_ptr
Differential Revision: https://phabricator.kde.org/D15301
Summary:
First check in RegularArea::isNull sais this: "I'm a QList. If I'm empty, I'm not null". That doesn't make sense, invert it.
The next check says: "If I contain at least one shape which is not null, I'm not null.". That makes sense, keep it.
Test Plan: - check for regression in callers (TextPage::findText, TextPage::text, TextPage::words)
Reviewers: aacid
Reviewed By: aacid
Subscribers: okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15344
Summary:
This is mainly preparation for D15204 (typewriter), where storing RGB won't be sufficient any longer.
Typewriter will need transparent background (alpha=0x00), which can only be expressed as ARGB string.
Current code handles name format identical for all annotations. It doesn't hurt to store all annotations in ARGB format, so instead of introducing special handling for typewriter, let's store all annotation color attributes as ARGB string.
Note: In case of previously existing okularpartrc, configuration will be reused without conversion. New color format will be written when new settings are saved. This has no bad effect.
Test Plan:
- when [Reviews] section in okularpartrc is initially generated, all annotation color attributes are in #AARRGGBB format
- saving into archive stores color with alpha channel (#AARRGGBB), for all kind of annotations
Reviewers: sander
Reviewed By: sander
Subscribers: dileepsankhla, sander, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15279
Summary:
With specially crafted .okular files you can trick okular to create temporary files outside the temporary folder
We fix that by making sure the file doesn't have folders since the ones we create don't
BUGS: 398096
Subscribers: okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D15192
Previously, these tooltips were only shown in "Browse mode".
This patch adds them for "Selection", "Text selection", and
"Trim selection" as well. These are the modes where the cursor
changes to a hand when hovering over a link.
BUG: 397783
Differential Revision: https://phabricator.kde.org/D15123
Summary:
We need to regenerate the links when switching the file
since we won't re-render the pages since we already have
them and link generation is on page render
BUG: 397373
Reviewers: tobiasdeiminger
Reviewed By: tobiasdeiminger
Subscribers: tobiasdeiminger, sander, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D14752
Large specifications with many (nested) sections are painful to navigate
through when the TOC is expanded by default. Introduce four new options,
"Expand/Collapse whole section" is based on Kate's document view while
"Expand/Collapse all" was added to handle the top-level sections.
As for other viewers, PDF.js uses shift-click to handle the former while
using double-click on a the TOC icon to handle the latter. That is not
very obvious, so extending the context menu seems the next best option.
BUG: 216870
Differential Revision: https://phabricator.kde.org/D14904
Summary:
libepub can't handle whitespace url encodings. This is why epub documents containing whitespaces urls aren't
displayed correctly. Since libepub doesn't seem to be maintained anymore, it might be better to fix this issue here.
BUG: 334711
Test Plan: Example epubs are in the ticket.
Reviewers: #okular, aacid
Reviewed By: #okular, aacid
Subscribers: ngraham, aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D14310
Summary:
When save/save as functions are called they internally call the openFile() function, in the open file function the side bar item is set to Table of Contents (ToC) item
```
if ( m_document->metaData( QStringLiteral("OpenTOC") ).toBool() && m_sidebar->isItemEnabled( m_toc ) && !m_sidebar->isCollapsed() && m_sidebar->currentItem() != m_toc )
{
m_sidebar->setCurrentItem( m_toc, Sidebar::DoNotUncollapseIfCollapsed );
}
```
so I just store the sidebar's item before saving and then set this item back if changed.
BUG: 389668
Reviewers: #okular
Subscribers: aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D14740
CCBUG: 391625
Test Plan: I tested the file mentioned in the bug report. Pictures look less blurry
Reviewers: #okular
Subscribers: ngraham, aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D13766
This fixes the same crash as bug 393334 but in a better way
the old way was setting a variable on destruction and then trying
to use that variable in a slot, but that's obviously wrong since
we were already mid destructing the object.
BUG: 396807