Commit graph

8181 commits

Author SHA1 Message Date
Albert Astals Cid a482c56ba2 Select current format on the configure backend dialog
Subscribers: sander, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D14820
2018-10-08 22:54:03 +02:00
Dileep Sankhla e44ff38706 Support setting text color for typewriter annotations
Summary:
Changing typewriter text color can be done in the typewriter properties dialog, or programmatically via new okular API methods TextAnnotation::textColor and TextAnnotation::setTextColor.

poppler >= 0.69 is required to store text color natively inside PDF documents. For other document types, text color is stored as metadata inside the document archive.

This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.

Test Plan:
- properties dialog of typewriter annotation has "Font Color" picker
- saving to PDF results in <r> <g> <b> rg operation in /DA
- saving to archive results in fontColor="rrggbb" attribute in metadata.xml

Reviewers: sander

Reviewed By: sander

Subscribers: kde-doc-english, sander, okular-devel

Tags: #okular, #documentation

Differential Revision: https://phabricator.kde.org/D15205
2018-10-04 20:02:55 +02:00
Albert Astals Cid 3cdb348d1e Merge remote-tracking branch 'origin/Applications/18.08' 2018-10-02 21:30:37 +02:00
Albert Astals Cid ee5b830ced Fine tune opening of archives after last change
Since openDocument will do MatchContent if the mime passed fails, we
need to do matchExtension here
2018-10-02 21:29:48 +02:00
Albert Astals Cid 3a1a037dd3 Merge remote-tracking branch 'origin/Applications/18.08' 2018-10-02 01:35:14 +02:00
Albert Astals Cid caf52d0ed9 Fine tune opening files
If we're going to set triedMimeFromFileContent to true we need to
actually try the contents and not the extension.

This is a KF5 porting mistake
2018-10-02 00:33:58 +02:00
l10n daemon script ccb19c681d GIT_SILENT made messages (after extraction) 2018-09-28 06:39:36 +02:00
l10n daemon script b632b36cb2 GIT_SILENT made messages (after extraction) 2018-09-28 03:48:01 +02:00
Yuri Chornoivan aba8dbb680 Add typewriter tool to the docs 2018-09-26 09:53:13 +03:00
Dileep Sankhla 6dd7cf662d Add typewriter annotation tool
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
2018-09-25 22:47:01 +02:00
Tobias Deiminger 61e8b1d79d Merge remote-tracking branch 'origin/Applications/18.08' 2018-09-18 21:34:58 +02:00
Tobias Deiminger fa7a1b3d06 Avoid undefined behavior due to dangling file descriptor
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
2018-09-18 21:33:55 +02:00
Oliver Sander b763bdba7a Simplify memory management of two private data members
- 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
2018-09-12 14:17:30 +02:00
Tobias Deiminger 0128f33f43 Fix isNull check for RegularArea
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
2018-09-08 22:30:26 +02:00
Dileep Sankhla d61cef693d Store all annotation color attributes as ARGB string
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
2018-09-07 18:33:16 +02:00
l10n daemon script 736f801dac GIT_SILENT made messages (after extraction) 2018-09-04 03:54:09 +02:00
Albert Astals Cid 21836ba072 Merge remote-tracking branch 'origin/Applications/18.08' 2018-09-03 21:15:52 +02:00
Albert Astals Cid 8ff7abc14d Fix path traversal issue when extracting an .okular file
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
2018-09-03 21:14:50 +02:00
l10n daemon script 86858e6cb0 GIT_SILENT made messages (after extraction) 2018-09-03 06:39:54 +02:00
Yuri Chornoivan 39b6e8147d Fix minor EBN issues 2018-09-01 11:25:57 +03:00
Christoph Feck 5ff0ef1e97 GIT_SILENT Upgrade KDE Applications version to 18.08.1. 2018-08-31 18:40:53 +02:00
Yuri Chornoivan c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03:00
Oliver Sander 81ac73fcf5 Show tooltips when hovering over links in mouse selection modes as well.
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
2018-08-29 13:32:05 +02:00
Albert Astals Cid 6a37055351 Merge remote-tracking branch 'origin/Applications/18.08' 2018-08-27 01:09:44 +02:00
Albert Astals Cid 0a8d2f7f85 Fix links being "lost" on save
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
2018-08-27 01:09:11 +02:00
Peter Wu 61c2c2cedd TOC: Add collapse/expand options
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
2018-08-26 14:05:26 +02:00
Yuri Chornoivan c7722c4078 Fix minor EBN issues 2018-08-17 21:05:01 +03:00
Yuri Chornoivan 2d138da190 Update screenshot to display Markdown backend in the list 2018-08-17 20:05:08 +03:00
Gilbert Assaf fcf148b75b Fixes url whitespaces in epub documents
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
2018-08-15 19:14:39 +02:00
l10n daemon script 0d3e4a5853 GIT_SILENT made messages (after extraction) 2018-08-15 06:32:08 +02:00
l10n daemon script a7aa8a46e1 GIT_SILENT made messages (after extraction) 2018-08-15 03:45:09 +02:00
Albert Astals Cid 9ba8dd2cd7 Make sure sorting in the configure backends is always the same
The sorting is not the best, but at least it's always the same now :D
2018-08-14 10:37:30 +02:00
Oliver Sander 59b8770545 Remove unused file
BUGS: 397429
2018-08-14 10:18:39 +02:00
Albert Astals Cid 918914dc99 Merge remote-tracking branch 'origin/Applications/18.08' 2018-08-13 11:14:41 +02:00
Ahmad Osama 5e622484c8 Fix problem of saving pdf switches from thumbnail view in sidebar to contents view
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
2018-08-13 11:13:00 +02:00
Albert Astals Cid 78e113f508 Merge remote-tracking branch 'origin/Applications/18.08' 2018-08-09 00:29:45 +02:00
Albert Astals Cid 4f06f742f9 Fix properties dialog path not being correct on Save As
We need to clear DocumentInfo because otherwise it is cached and refers
to the old file

BUGS: 397039
2018-08-09 00:27:42 +02:00
Albert Astals Cid c85650a16f Merge remote-tracking branch 'origin/Applications/18.08' 2018-08-07 01:50:57 +02:00
Albert Astals Cid e0907726d6 Increase version
GIT_SILENT
2018-08-07 01:50:22 +02:00
Christoph Feck 5431114b30 GIT_SILENT Upgrade KDE Applications version to 18.08.0. 2018-08-06 22:43:20 +02:00
l10n daemon script d85fe1df64 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"
2018-08-04 07:49:58 +02:00
l10n daemon script bae0e13719 GIT_SILENT made messages (after extraction) 2018-08-04 06:27:24 +02:00
l10n daemon script f1d3c68115 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"
2018-08-04 05:43:46 +02:00
l10n daemon script 5f93a0b90e GIT_SILENT made messages (after extraction) 2018-08-04 03:45:00 +02:00
l10n daemon script 55c1cd433e 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"
2018-08-01 07:46:16 +02:00
l10n daemon script f670a18bd9 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"
2018-08-01 05:52:53 +02:00
Christoph Feck 5da85a88f1 GIT_SILENT Upgrade KDE Applications version to 18.07.90. 2018-07-30 23:46:16 +02:00
Albert Astals Cid 345c211674 Merge remote-tracking branch 'origin/Applications/18.08' 2018-07-28 23:14:44 +02:00
Gilbert Assaf 57be655c15 Improve picture scaling issues in epub generator
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
2018-07-28 23:13:53 +02:00
Albert Astals Cid 7c87174dde Merge remote-tracking branch 'origin/Applications/18.08' 2018-07-28 22:41:21 +02:00