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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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