Summary:
This diff unifies the calculation of the viewport position from a given DocumentViewport. PageView::notifyViewportChanged and PageView::slotRelayoutPages used to handle it differntly, which resulted in viewport jumps for no reason.
It happened in various situations, e.g. when jumping to a page using the footer page navigation, or when reloading the document after presentation mode left, or when resizing the main window after presentation mode left.
The diff selects the notifyViewportChanged way (align viewport top border with page top margin) as golden behavior in case of rePos.enabled == false.
BUGS: 357958
CCBUG: 341939
CCBUG: 400890
341939 and 400890 are fixed partially. These two still suffer from a minor displacement that happens when finished signal arrives from pixmap generation thread.
Test Plan:
- When using the footer page navigation to jump to different pages, new page top is always algined with viewport top.
- After changing page with footer page navigation, press F5 to reload. Page top stays aligned with viewport top.
- When exiting presentation mode, and touching the file, page top stays aligned with viewport top.
- When exiting presentation mode, and changing main window size, page top stays aligned with viewport top.
Reviewers: #okular, sander
Reviewed By: sander
Subscribers: ngraham, sander, aacid, okular-devel
Tags: #okular
Differential Revision: https://phabricator.kde.org/D16941
* saving as on a non existing file works
* saving as on a symlink doesn't destroy the symlink
* saving on the symlink used to open the file doesn't destroy the
symlink
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
Summary: This tests the newly added additional widget actions.
Test Plan:
Passes for me. Is my first GUI test, maybe the timing
needs to be slower for slower machines?
Reviewers: aacid
Reviewed By: aacid
Subscribers: okular-devel
Tags: #okular
Maniphest Tasks: T8627
Differential Revision: https://phabricator.kde.org/D13170
Summary:
This adds support for multiple actions following each
other through the "Next" value of Action dictionaries.
Test Plan: Activates the corresponding part of the visibilitytest.
Reviewers: #okular
Subscribers: sander, aacid
Tags: #okular
Maniphest Tasks: T8278
Differential Revision: https://phabricator.kde.org/D11609
The test only tests what is currently supported so it does
not yet test radio buttons and action chains. But
the visibilitytest.pdf already provides these, too.
Differential Revision: https://phabricator.kde.org/D11597
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:
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
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:
`PartTest::testForwardPDF` tests whether the synctex integration works
and needs to create a PDF from latex sources via `pdflatex`.
If this is not installed the test fails, but the error message
`'started' returned FALSE` requires diving into the source code to debug
the problem.
By providing a more meaningful error message we make it easier for
developers and distributions to run all autotests sucessfully (short of
build-requiring a latex installation). Note that Albert does not want to
simply skip the tests in that case, so no optional build-time dependency
either.
Ref T7532
Test Plan:
Run `parttest testForwardPDF` w/ and w/o `pdflatex` executable
available.
Reviewers: aacid, #okular
Reviewed By: aacid, #okular
Subscribers: #okular
Tags: #okular
Maniphest Tasks: T7532
Differential Revision: https://phabricator.kde.org/D9578
Summary:
Okular allows to drop changes when saving to a file format not
supporting those. However, this is only sensible for {nav Save As},
while for {nav Save} the {nav Continue} button is not needed. When this
behaviour was introduced in 481676dced, the `jpg` test row failed
subsequently, because `closeDialogHelper` relies on the availability of
the {nav Continue} button. The `epub` test row is similar, but `returns`
early because it does not allow `canSwapBackingFile` and therefore does
not fail the test afterwards.
As the test progresses, the initial {nav Save As} (`potato.jpg` to
`/tmp/123.jpg`) is implicitly followed by {nav Save} (`/tmp/123.jpg` to
`/tmp/123.jpg`) for each subsequent `part.saveAs`. This causes the
{nav Continue} button to vanish, so eventually the test will fail.
Forcing {nav Save As} so the {nav Continue} button continues to exist
could be done in multiple ways, but just alternating between two
different files to save seems like the most efficient and most readable
approach.
Test Plan:
- `./autotests/parttest testSaveAsUndoStackAnnotations:jpg` now passes.
- Other test rows still pass.
- No changes to non-test code needed.
Reviewers: aacid, #okular
Reviewed By: aacid, #okular
Subscribers: #okular
Tags: #okular
Differential Revision: https://phabricator.kde.org/D9579
It was only used in tests as a way to "hide" warning dialogs, now we have a proper way to
close them, this way we make sure that dialogs are should when they should not not when they should not