Commit graph

129 commits

Author SHA1 Message Date
Albert Astals Cid
d7e9be4f8c Fix PartTest::testAnnotWindow
By waiting for the delayResizeEventTimer to trigger
2020-01-11 19:49:16 +01:00
Albert Astals Cid
45303be62c "Fix" PartTest::testAdditionalActionTriggers
By waiting for the delayResizeEventTimer to trigger before starting the
test.

The test "randomly" failed before, which shows there's an actual bug in
the code, but the actual bug is "if you are moving the mouse over a
field that has a on focus action and at that very same time the
delayResizeEventTimer triggers, the action won't be executed".

That's almost impossible to reproduce in real life so i'm going to
pretend the bug is not there for all purposes
2020-01-07 23:27:32 +01:00
Tobias Deiminger
1965f3d3fd Add typewriter autotests
Add tests for the typewriter annotation tool

Differential Revision: https://phabricator.kde.org/D15348

(cherry picked from commit 2a8721c221)
2019-11-03 07:44:53 +13:00
Thorsten Behrens
41cab4a30b Fixup kjsfunctionstest.cpp build for Qt 5.9
QScopedPointer::get() is only available from Qt 5.11 on.
2019-10-07 09:52:42 +02:00
Albert Astals Cid
da21543a50 Small performance improvements 2019-10-05 22:16:43 +02:00
Oliver Sander
2bd6f736c4 Test whether 'continuous' view mode is saved per file 2019-10-02 13:00:57 +00:00
João Netto
17814fc304 Implemented validate actions and made formwidgets leave these actions to QLineEdit::Event 2019-08-22 22:38:10 +00:00
João Netto
3081358836 Added support for Form Focus Events 2019-08-22 22:38:10 +00:00
João Netto
3eb6a91e25 Changed util.printd to use the default locale on case 2. Also made kjsfunctionstest to be in a consistent locale 2019-08-15 13:21:04 -03:00
Adriaan de Groot
1c1a073c34 Improve testPrintD
Summary:
 - swap out manual management for a PrintDHelper class that allocates
   an action and MessageBoxHelper, runs the script, and checks the
   result.
 - use _data() to run the helper with different data; this improves
   observability as well.

Test Plan:  - Run tests, see same results as before

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D23164
2019-08-15 17:08:47 +02:00
João Netto
a7845890b3 Changed tests to use QTest interface, with QTest::newRow and column 2019-08-15 10:50:34 -03:00
Albert Astals Cid
280e87ccdf test: Switch another QCOMPARE to the right order 2019-08-15 00:23:07 +02:00
Albert Astals Cid
f74dacd0bd More QCOMPARE -> QVERIFY 2019-08-15 00:21:16 +02:00
Albert Astals Cid
966b6b479b QCOMPARE -> QVERIFY 2019-08-15 00:15:27 +02:00
Albert Astals Cid
874c1fd5e4 Switch QCOMPARE to the proper order 2019-08-15 00:15:27 +02:00
João Netto
f54d65ca86 Changed util.printd to work with the default locale set on QLocale::setDefault to allow consistent results in tests 2019-08-14 21:49:04 +00:00
João Netto
c7432cdae6 Implemented support for AFSpecial_Format and AFSpecial_Keystroke 2019-08-12 12:47:56 -03:00
João Netto
052662d78d Implemented support for AFTime_Format and AFTime_Keystroke 2019-08-12 11:13:03 -03:00
João Netto
f9e6b3e6e6 Extended util.printd support to cover new formats 2019-08-08 21:31:12 +00:00
João Netto
7c361d058d Implemented tests for app.alert and util.printd 2019-08-08 21:31:12 +00:00
Albert Astals Cid
0dd5419621 Hide the cursor with tricks so then hidden delay mode keeps working fine 2019-08-01 21:57:48 +00:00
Oliver Sander
b1b2f93e58 Test whether tablet proximity properly controls the cursor shape
... in presentation mode.

Thanks to Tobias Deiminger for his help.
2019-08-01 21:57:48 +00:00
Albert Astals Cid
d84f781e81 Stop using QRegion:: rects and just iterate over the region
QRegion::rects is deprecated
2019-07-27 20:48:29 +00:00
João Netto
ad858267d1 Implemented display support and updated dependencies to Poppler > 0.79
Moved executeScript to document private and support to display options for JavaScript
2019-07-20 12:06:12 +02:00
João Netto
f3c8bb9299 Changed button code to be transparent when there's no text. 2019-07-20 12:04:59 +02:00
João Netto
7555212d29 Implemented the getOCGs and OCGs methods to support layer changing by JavaScript.
Implemented more unit tests to cover the OCGs
2019-07-20 12:04:59 +02:00
João Netto
cc10164d34 Implemented initial support for animatedPDF
When refreshing, widgets must check if they should be visible

Implemented unit tests to the JavaScript functions.
2019-07-20 12:04:45 +02:00
Albert Astals Cid
a797d2aeb9 parttest: Move calculating the width/height to a bit later
Seems to make tests more stable
2019-07-17 22:35:28 +02:00
Laurent Montel
398dd7e250 Use QString::fromUtf8 as asked by Albert
"QStringliteral is broken on windows with non ascii chars"
2019-05-27 08:04:57 +02:00
Laurent Montel
cb691f70dc Fix some clazy warning
Summary: fix clazy warning

Reviewers: aacid

Reviewed By: aacid

Subscribers: nicolasfella, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20832
2019-05-27 08:02:57 +02:00
Albert Astals Cid
a16c0be349 testShell: Check that the test on the find bar is the text we want to be there 2019-02-14 00:00:16 +01:00
Joao Netto
716b234100 Implemented find function from console
Summary:
Implemented feature request to find from console.

BUG: 362038

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: ngraham, aacid, yurchor, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D18144
2019-02-13 23:59:52 +01:00
Chinmoy Ranjan Pradhan
a234a902dc Implement digital signature support for PDF
This is a squash of the original branch

It also contains fixes/rework from Albert Astals Cid

If you're interested in its history have a look at the
gsoc2018_digitalsignature branch

The poppler dependency situation is:
 * With 0.51 you get most signature information
 * With 0.68 you also get signature location/reason information
 * With 0.73 you also get signature certificate information
2019-01-10 23:13:54 +01:00
Tobias Deiminger
09a2d6ed67 Merge remote-tracking branch 'origin/Applications/18.12' 2018-11-29 21:42:35 +01:00
Tobias Deiminger
a29e4eaff5 Fix inconsistent viewport positioning in PageView
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
2018-11-29 21:41:43 +01:00
Yuri Chornoivan
5478b2ec92 Fix minor typos 2018-11-14 21:12:15 +02:00
Albert Astals Cid
ec692e459b Remove unused variables 2018-11-02 18:03:26 +01:00
Albert Astals Cid
e88607afec Merge remote-tracking branch 'origin/Applications/18.08' 2018-10-24 00:32:18 +02:00
Albert Astals Cid
05462e2670 Add three autotests for part saving
* 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
2018-10-24 00:31:48 +02:00
Yuri Chornoivan
c04ca1fa96 Fix minor EBN issues 2018-08-31 12:23:45 +03: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
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
Andre Heinecke
5103e8db6f Add test for additional form actions
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
2018-05-30 10:05:21 +02:00
Simone Gaiarin
48b9ca66a6 Raise annotation window when clicking on annotation
Summary:
Raise annotation window when clicking on the window title, window text edit, or the associated annotation.

BUG: 388532

Reviewers: #okular, aacid

Subscribers: okular-devel, ngraham, #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10792
2018-05-18 15:17:58 +02:00
Andre Heinecke
1de0f5465b Add support for chained / next actions
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
2018-04-30 14:02:49 +02:00
Albert Astals Cid
1ab8dd7c62 Fix autotest build if poppler is not installed 2018-04-24 11:59:07 +02:00
Andre Heinecke
7eb72911f8 Add test for visibility changes
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
2018-04-23 23:58:11 +02:00
Albert Astals Cid
33a2eaf3c4 Merge remote-tracking branch 'origin/Applications/18.04' 2018-04-22 19:46:41 +02:00
Albert Astals Cid
3cea7c9927 Fix crash on exit when having edited a text area
For some reason Q/KTextEdit is sending textChanged inside the
destructor, so protect us from that.

BUG: 393334
2018-04-22 19:46:04 +02:00
Aleix Pol
c325b342f3 Make some frameworks optional so okular can be built on Android
Summary:
Disables KWallet integration if there's no KWallet, KJS if there's no
KJS and KDocTools.
Here's a list of frameworks that don't work on Android:
https://cgit.kde.org/sysadmin/ci-tooling.git/tree/local-metadata/project-ignore-rules.yaml

Test Plan: Still works locally, ran Okular and Okular Mobile on Android.

Reviewers: #okular, aacid

Subscribers: aacid

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12177
2018-04-16 22:41:19 +02:00