Commit graph

8160 commits

Author SHA1 Message Date
Albert Astals Cid 33768c683f Merge remote-tracking branch 'origin/Applications/18.04' 2018-03-20 23:38:01 +01:00
Albert Astals Cid 098a886ff1 Increase OkularCore soversion
Since we broke ABI since last release
2018-03-20 23:37:30 +01:00
Albert Astals Cid 37a46fe17f Merge remote-tracking branch 'origin/Applications/18.04' 2018-03-20 23:30:43 +01:00
Andre Heinecke 7c41ba2c66 Add test for read only set and checkbox calculate
Summary:
It's a real world screnario to have checkboxes that toggle
the read only state for other fields.

The test is a parttest because we need to trigger activiation
action when changing the field, this is handled through the
formwidgetscontroller.

Reviewers: #okular

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10869
2018-03-20 23:19:29 +01:00
Andre Heinecke 8ed1d14f8d Fix CheckBox script usage
Summary:
This implements setting / getting the value of buttons,
which is important for checkboxes in scripts. It also moves
the checkbox activate action after the value is set so that
the correct value is used when the activation script is
executed.

Reviewers: #okular

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10868
2018-03-20 23:19:29 +01:00
Andre Heinecke 6897e042df Add support to set read only from scripts
Summary:
This makes it possible to set the read only state from
scripts. Requires Poppler master with the patch attached to the parent task.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10867
2018-03-20 23:19:29 +01:00
Albert Astals Cid adfb3cc2d6 Add detection for poppler 0.64 2018-03-20 23:19:26 +01:00
Andre Heinecke 5c04f0834d Implement generic version of Form Widgets refresh
Summary:
The FormWidgetInterface now has a generic slotRefresh that
refreshes what all widgets have in common. This is the read-only state for now.

Reviewers: #okular

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10866
2018-03-20 23:14:18 +01:00
Andre Heinecke 42717e1ae8 Access readOnly state of FormWidgets dynamically
Summary:
This is more of a cleanup patch that removes the obsolete m_canBeEnabled
member variable which was a leftover IMO from a time where readOnly fields were
shown as disabled. readOnly fields are invisible, not disabled, and the code no longer assumes that
readOnly does not change over time.

Test Plan: Tested manually and with a unittest which is part of the series.

Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T8097

Differential Revision: https://phabricator.kde.org/D10865
2018-03-20 23:14:12 +01:00
Albert Astals Cid 1b57c7557b GIT_SILENT Upgrade KDE Applications version to 18.07.70. 2018-03-19 23:52:08 +01:00
Albert Astals Cid e6860a1194 GIT_SILENT Upgrade KDE Applications version to 18.03.80. 2018-03-19 23:37:57 +01:00
Albert Astals Cid 1a093dc572 New version for master 2018-03-19 23:36:23 +01:00
Laurent Montel 43432f2aba Add Qt5::Network 2018-03-13 09:28:55 +01:00
Yuri Chornoivan 2a8e18f539 Add documentation on the new command line option --print-and-exit 2018-03-03 19:01:25 +02:00
Dileep Sankhla 09b7b079ac Option to exit after printing
Summary:
When running okular with the parameter --print to directly open the print mode, it doesn't exit after acknowledging the print dialog. Hence adding --print_and_exit option exits Okular after acknowledging the print dialog and thus is useful for the command line batch processing or a Dolphin service as the issue suggests.

FEATURE: 318998

Test Plan:
1. open a file in Okular using the parameter --print. It will open Okular in print mode with the print dialog
2. Either print the file or cancel the print dialog
3. You will find that Okular stays open
4. Now using this patch, see for available options with the --help parameter. You will find --print_and_exit option
5. Now open a file in Okular using the parameter --print_and_exit. It will open Okular in print mode with the print dialog
6. Either print the file or cancel the print dialog
7. You will find that Okular closes after acknowledging the dialog

Reviewers: aacid, #okular, ngraham

Subscribers: ltoscano, ngraham, aacid, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10249
2018-03-03 17:36:50 +01:00
l10n daemon script 13e719b300 GIT_SILENT made messages (after extraction) 2018-02-26 03:21:12 +01:00
Albert Astals Cid aecd77d4a9 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-25 19:17:56 +01:00
Albert Astals Cid c45e2170ab Add QVERIFY to QTest::qWaitForWindowExposed
removes compiling warning
2018-02-25 19:11:17 +01:00
Tobias Deiminger 3c4f16ea4b Fix crash due to dangling pointer in MouseAnnotation
Summary:
BUG: 388228

Diff applies to Applications/17.12, and should be easy to merge to master. It's kept quite minimal as suggested by Albert.

Albert also suggested to add a dedicated unit test and I'd agree, but am not yet sure how to do it. The original bug involves several classes, including UI: Document, Page, AddAnnotationCommand, PageView, PageViewAnnotator, MouseAnnotation - to name a few. So a test for the exact bug scenario would become a bigger integration test rather than an isolated unit test. The other approach would be to do a real unit test on MouseAnnotation. But again, MouseAnnotation has nasty dependencies (e.g., needs a parent PageView) which I'd have to mock. Any ideas? I'd be interested in a discussion on this topic.

Test Plan:
 # Load a document (e.g. [[ http://www.philipebert.info/resources/WhatMathematicalKnowledgeCouldNotBe.pdf | linked PDF from bug report ]]) and enable highlight toolbar (F6).
 # Create highlight annotation.
 # Move the view port so that the annotation position is right beside the highlight tool icon.
 # Move the mouse over the annotation, and then horizontally left until you reach the tool icon; it's important to stay over the highlight annotation as long as in viewport.
 # Press ctrl-z for undo.
 # Click on highlight tool, move right into the document, create new highlight annotation.
 # Okular doesn't crash.

Reviewers: #okular

Subscribers: aacid, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D9852
2018-02-25 19:11:17 +01:00
Albert Astals Cid 77ee07cef5 Build++ 2018-02-25 19:01:41 +01:00
Albert Astals Cid 5facb3514e Add test that produces bug 388288 crash 2018-02-25 18:54:27 +01:00
Albert Astals Cid 77793ff3a9 Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-25 12:27:37 +01:00
Albert Astals Cid cecbc8b68c Make it compile
Though for reason it does compile for me ^_^
2018-02-25 12:27:14 +01:00
Albert Astals Cid de14b2df0c Merge remote-tracking branch 'origin/Applications/17.12' 2018-02-25 11:47:23 +01:00
Julian Wolff d19834f231 Make Part::openUrl not discard OpenUrlArguments
Applications using Okular as a KPart might set a file's mime type in the OpenUrlArguments.
Okular currently clears the arguments while opening a document. This revision fixes this, allowing
applications to actually pass a file's mime type to Okular.

BUG: 386600
2018-02-25 11:46:52 +01:00
Yuri Chornoivan fbd0fd69af Add a note about LaTeX code in annotations
BUG: 391003
2018-02-24 15:01:22 +02:00
l10n daemon script b9bc49fb84 GIT_SILENT made messages (after extraction) 2018-02-22 06:00:37 +01:00
Andre Heinecke f0a80a675f Recalculate forms after command form changes
Summary:
notifyFormChanged is called by documentcommands when
Form fields are changed. E.g. by Undo / Redo.
We need to recalculate after such changes.

Test Plan:
Tested with simple_calculate example.

Run the unit test with the added line commented out and it failed, with the added line it passes.

Reviewers: #okular

Subscribers: aacid, ltoscano

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10547
2018-02-22 00:13:25 +01:00
Andre Heinecke 5f05e4a1fc Add autotest for AFSimple_Calculate script
Reviewers: #okular

Subscribers: aacid

Tags: #okular

Maniphest Tasks: T7805

Differential Revision: https://phabricator.kde.org/D10050
2018-02-22 00:13:12 +01:00
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