Commit graph

8181 commits

Author SHA1 Message Date
Andre Heinecke cead2bbef3 Add initial support for built-in javascript functs
Summary:
This starts by adding support for AFSimple_Calculate which
is the standard "calculate" function in Adobe Acrobat Pro.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10049
2018-02-22 00:12:44 +01:00
Andre Heinecke d50c06df25 Add refresh widgets if underlying field changes
Summary:
If a field is updated because of a calculate form action /
a script execution, not only refresh the rendered pixmap but
also the corresponding formWidget.

Test Plan: Unittest in separate revision. Tested it manually, too.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10048
2018-02-22 00:12:34 +01:00
Andre Heinecke d3a549ca25 Add JavaScript Event Object handling
Summary:
This adds a new data object "Event" that can be used
to carry information in and out of JavaScript execution
contexts. The Event Object is defined in the Adobe JavaScript
scripting reference.

The implementation now adds handling for the FieldCalculate
Event. It should be extensible enough so that in the future
more events could be supported.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10073
2018-02-22 00:11:20 +01:00
Albert Astals Cid 879f40e3a8 Increase minimum required KF5 version
All the distributions tracked in repology.org that ship Qt 5.8 at least ship KF 5.33 so increase it to that version
2018-02-21 21:31:28 +01:00
Abdel-Rahman Abdel-Rahman ce7fa7b9d8 Fictionbook: Add support for code, superscript, & subscript tags
Summary: BUG: 387426

Test Plan: Open a book with the code, superscript, & subscript tags. Verify that the code is visible in a mono-space font, & superscripts & subscripts are formatted appropriately.

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: aacid, cfeck, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10566
2018-02-18 23:29:02 +01:00
Albert Astals Cid 7014e86f68 tests: Use QTRY_COMPARE instead manual timer 2018-02-18 23:18:11 +01:00
Sergio Bragin 54c741844b Fix realDpi function for Mac
Summary:
Removes old Utils::realDpi function for Mac. The old code employs functions
CGDisplayCurrentMode and CGDisplayIOServicePort, which are deprecated as
of versions 10.6 and 10.9, respectively. Now Mac uses the same code, as
Linux does, since it works out of the box.

This commit automatically fixes the long-standing bug of having an
implementation of realDpiX() and realDpiY(), which are not declared in
the utils.h file.

Reviewers: #okular, rjvbb

Reviewed By: rjvbb

Subscribers: rjvbb, cullmann, aacid, kde-mac, ltoscano, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10415
2018-02-18 19:24:19 +01:00
Albert Astals Cid 739b591e25 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-15 10:14:45 +01:00
Albert Astals Cid e8d9feed70 Fix potential crash in document saving
Probably doesn't happen very often since most of the times people don't save while rendering is still happening
but if that is the case we need to wait for all the rendering to finish otherwise we remove the document
from under the render thread feet and bad things happen
2018-02-14 17:51:01 +01:00
Albert Astals Cid 83374b97df PDF: Fix potential crash
Probably doesn't happen often but pdfdoc usage also needs to be protected by the mutex
2018-02-14 17:51:01 +01:00
Albert Astals Cid 5efba743cc Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-14 01:42:32 +01:00
Albert Astals Cid 42d4710198 XPS: Fix crash opening some files
Yet another QUrl porting mistake, i think this time is the correct one,
at least i can open all the 6 xps files i have

BUGS: 390355
2018-02-14 01:40:42 +01:00
Andre Heinecke 9f458a54cf Fix regression in refreshPixmaps 2018-02-10 00:37:19 +01:00
l10n daemon script b9a392d6b8 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-02-08 07:00:06 +01:00
l10n daemon script d82ca473d5 GIT_SILENT made messages (after extraction) 2018-02-08 05:51:57 +01:00
l10n daemon script 0d38577b4a 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-02-08 05:11:36 +01:00
l10n daemon script 37a30f5851 GIT_SILENT made messages (after extraction) 2018-02-08 03:27:11 +01:00
Aleix Pol e06883d102 Fix annoying warning
Summary:
Warning for every plugin was:
The file includes the moc file "generator_tiff.moc", but does not contain a Q_OBJECT, Q_GADGET, Q_NAMESPACE, K_PLUGIN_FACTORY_WITH_JSON, K_PLUGIN_FACTORY, K_PLUGIN_FACTORY_WITH_JSON or K_PLUGIN_FACTORY macro.

Test Plan: Built

Reviewers: aacid

Reviewed By: aacid

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10022
2018-02-06 00:38:50 +01:00
Albert Astals Cid 7a182c2594 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-06 00:32:56 +01:00
Albert Astals Cid 4e678cdc33 Add pdf.gz file save test 2018-02-06 00:32:15 +01:00
Henrik Fehlauer ad1160be1b Fix saving annotations to gzipped files
Okular supports opening zipped files like document.pdf.gz by
transparently extracting them. However, since 559836c392 saving
annotations back was broken. This is because this commit tries to
prevent saving back changes to externally modified files to prevent data
loss. The way this is checked by comparing timestamps mistakenly
triggered for unchanged zipped files, too.

This can be solved by always comparing the before/after timestamps of
the actual file, instead of the timestamp of the temporary copy of the
extracted file. The change has to be done in two places so saving
repeatedly works too.

BUG: 338742

Test plan
    gzip autotests/data/file1.pdf && okular file1.pdf.gz
    Add annotation, saving works now instead of showing an error.
    touch normal.pdf still triggers modification warning.

Differential Revision: https://phabricator.kde.org/D9580
2018-02-06 00:31:36 +01:00
Albert Astals Cid defe26ff1c GIT_SILENT Upgrade KDE Applications version to 17.12.2. 2018-02-03 00:41:15 +01:00
Albert Astals Cid 2d8b2c7e95 Add support for cancellable image rendering and text extraction
Summary:
Only supported by the pdf backend if using poppler >= 0.63

Sadly had to change the generator API

Text cancellation is a bit wobbly still since poppler has large parts
of the code where doesn't check for the cancellation flag, but that
is something that will get automagically fixed for us if the poppler
side is improved

Test Plan: Needs https://bugs.freedesktop.org/show_bug.cgi?id=104263

Reviewers: ervin, rkflx

Reviewed By: ervin, rkflx

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9328
2018-02-01 22:53:28 +01:00
Albert Astals Cid c762b86b2b Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 23:27:19 +01:00
Albert Astals Cid f656f1b23f Fix crash on save when we had edited forms
We need to store the id locally since we need it to map
"old form" to "new form" after save and at that stage the "old form"
poppler side is gone so we're accessing invalid memory
2018-01-31 23:24:33 +01:00
Albert Astals Cid 8a0f70cb16 parttest: make the mouse selection be a few steps
Makes it more reliable for me here
2018-01-31 23:24:33 +01:00
Dileep Sankhla 1e80804c1b Use correct arrow cursor for Annotations' close buttons
Summary:
When hovering the mouse over the X symbol to close a note the cursor remains the same of the current shape (hand, selection cursor) based on the tool selected.
This patch morphe the cursor to the standard arrow over the X symbol to close a note by adding setCursor() call in the CloseButton constructor

 BUG: 384381

Test Plan:
1.  Open okular and select Tools -> Review or press F6 to create a new pop-up note
2. Hover the mouse cursor over the close button (X) of the pop-up note window
3. You will see the standard arrow instead of the current tool based cursor.

Screenshot below (the tooltip saying "Close this note" was not captured by Spectacle application)
{F5685539}

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10209
2018-01-31 11:02:17 -07:00
Dileep Sankhla de56b9c9c1 Use correct arrow cursor for Annotations' close buttons
Summary:
When hovering the mouse over the X symbol to close a note the cursor remains the same of the current shape (hand, selection cursor) based on the tool selected.
This patch morphe the cursor to the standard arrow over the X symbol to close a note by adding setCursor() call in the CloseButton constructor

 BUG: 384381

Test Plan:
1.  Open okular and select Tools -> Review or press F6 to create a new pop-up note
2. Hover the mouse cursor over the close button (X) of the pop-up note window
3. You will see the standard arrow instead of the current tool based cursor.

Screenshot below (the tooltip saying "Close this note" was not captured by Spectacle application)
{F5685539}

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10209
2018-01-31 10:58:07 -07:00
Albert Astals Cid 46a1eb66c4 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 12:13:56 +01:00
Albert Astals Cid 60daf5c2d8 Improve parttest a bit
add QVERIFY to qWaitForWindowExposed calls so that compiler shuts up
Add code to wait for the menus singleshot to have finished
2018-01-31 12:12:45 +01:00
Albert Astals Cid 5acb6d06f0 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-31 11:18:53 +01:00
Albert Astals Cid acd3c81e23 Fix regression due to more QTemporaryFile behaviour changes
Make sure we call fileName because otherwise things break
2018-01-31 11:18:09 +01:00
Laurent Montel 85a91c1bb7 Fix i18n usage 2018-01-29 13:19:45 +01:00
l10n daemon script 9c6494b353 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-01-29 06:49:13 +01:00
l10n daemon script 29b1dec92b 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-01-29 05:04:25 +01:00
Albert Astals Cid e043d517c5 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-23 00:40:05 +01:00
Albert Astals Cid 4a80d3f963 Fix crash when exporting
We had a off by one from when we removed the document archive option from the export menu.

BUGS: 389216
2018-01-23 00:37:44 +01:00
Michel Ludwig 6b259d7000 Use Windows ANSI versions of the PathFind... methods
Differential Revision: https://phabricator.kde.org/D9937
2018-01-19 21:23:02 +01:00
l10n daemon script 89caa09be9 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-01-15 06:15:40 +01:00
l10n daemon script daaa084476 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-01-15 04:46:05 +01:00
l10n daemon script 553d69dcef GIT_SILENT made messages (after extraction) 2018-01-15 03:10:59 +01:00
Albert Astals Cid 782a5fe298 Merge remote-tracking branch 'origin/Applications/17.12' 2018-01-11 20:51:49 +01:00
Albert Astals Cid dcf544f826 djvu: Fix printing
Seems this is a Qt regression? I had to move the tf.fileName() call earlier
because otherwise i was getting an empty string as name

BUGS: 388514
2018-01-11 20:50:53 +01:00
l10n daemon script 2daff2a344 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-01-11 06:26:36 +01:00
l10n daemon script f1e2ebbaed 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-01-11 04:50:21 +01:00
l10n daemon script 6ed35fcca3 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-01-08 06:05:50 +01:00
l10n daemon script 6ff1864dc2 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-01-08 04:48:31 +01:00
l10n daemon script a16d67e85a GIT_SILENT made messages (after extraction) 2018-01-08 03:09:23 +01:00
Nathaniel Graham e44d505583 Improve dialog when PDF wants to open in presentation mode
Summary:
BUG: 388511

- Describe what's actually going to happen if you answer in the affirmative
- Use expressive button text with standard ok/cancel style icons
- Remove tooltips, since they're not needed when the buttons clearly indicate what will happen when you press them

Test Plan:
New dialog:
{F5626016}

Both buttons still work to do what they say they'll do.

Reviewers: #okular, aacid, rkflx

Reviewed By: rkflx

Subscribers: rkflx

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9692
2018-01-07 11:49:32 -07:00
Albert Astals Cid e7f90332ea GIT_SILENT Upgrade KDE Applications version to 17.12.1. 2018-01-04 18:50:10 +01:00