Commit graph

480 commits

Author SHA1 Message Date
Sune Vuorela 370ace64e0 Switch optional kjs to use config.h 2023-05-25 21:43:43 +00:00
Sune Vuorela 3ff2ab5081 Switch optional kwallet to use config.h 2023-05-25 21:43:43 +00:00
Sune Vuorela 62767b7c8c Convert QtSpeech to config.h 2023-05-25 21:43:43 +00:00
Sune Vuorela d597da0204 Rename Purpose defines to match others 2023-05-25 21:43:43 +00:00
Sune Vuorela 7235cd2b9d Only ask for QtQuick for mobile build 2023-05-03 08:39:24 +00:00
Sune Vuorela bb1d6c7c9f Bump c++ standard version. Poppler is about to use c++17 types in the api, so better be prepared 2023-04-17 15:38:19 +02:00
Albert Astals Cid 7476e3dd28 GIT_SILENT Upgrade release service version to 23.07.70. 2023-03-10 21:27:02 +01:00
Nicolas Fella 0501c5d8c4 Fix raising window when attaching to an existing instance on Wayland
When the second instance is launched it receives an activation token per environment variable

We need to pass that token to the first instance so that it can use it to raise itself

Also properly use startup ids for this on X11 instead of relying on forceActiveWindow, which is a hack
2023-02-09 12:26:52 +00:00
Albert Astals Cid 91afa74342 Set minimum requirement to Ubuntu 22.04 2022-11-19 09:48:15 +00:00
Albert Astals Cid 77d2c6c703 GIT_SILENT Upgrade release service version to 23.03.70. 2022-11-05 21:32:00 +01:00
Jonathan Esk-Riddell d25eaebc80 remove ecm_version check which breaks on 5.100, we already depend on ecm 5.68 anyway so it serves no purpose 2022-10-21 11:47:53 +01:00
Nicolas Fella 80afe26873 Implement event.change
This represents the newly entered data for each keystroke. This is often a single added character, but for cases like pasting text it can be more complex.

The PDF API reference doesn't specify any algorithm to use.

The algorithm used here works by iterating through both strings from the start until the first different character is encountered. Then the rest of the new text is considered the difference.

This doesn't produce the theoretically optimal/minimal diff, but seems to work well enough for practical application.

When text is removed the diff is empty
2022-09-13 21:51:15 +00:00
Nicolas Fella 986c2e6db5 Don't use KActivities on macOS
Activities are a Plasma concept, they don't make sense on macOS
2022-08-24 16:49:33 +02:00
Albert Astals Cid cb3fefb22c GIT_SILENT Upgrade release service version to 22.11.70. 2022-07-12 23:48:30 +02:00
Albert Astals Cid 26bb7b6a03 Add ki18n_install and kdoctools_install 2022-05-22 12:00:39 +02:00
Albert Astals Cid 913d437822 Make all optional dependencies REQUIRED by default
You can opt-out using the FORCE_NOT_REQUIRED_DEPENDENCIES option

We want people to always build as much of the optional dependencies as
possible, so force them to spell out what they don't want

And except on Android because two reasons:
 * The gitlab CI doesn't have some dependencies we actually have available
 * Some dependencies are not really available
2022-05-03 22:39:36 +00:00
Albert Astals Cid 0d40301d50 Add a few definitions that will come with ECM 5.85
Better enforce them now, so that the work to port doesn't increase over
time

Not a super fan of this for regular applications, but oh well the ship
has sailed
2022-04-07 23:02:12 +00:00
Nicolas Fella 9eb404c337 Don't find ktextwidgets for mobile
It's only used for the KPart
2022-04-05 22:43:58 +00:00
Albert Astals Cid ce8401e917 Don't require KF5::IconThemes for Mobile
It just gives us a 48px = Large, so not worth to have that extra dependency for
that in my opinion
2022-03-29 12:56:04 +00:00
Albert Astals Cid d8f0baa2b9 KCrash is only used on the desktop 2022-03-28 23:18:27 +02:00
Albert Astals Cid 5944ce059f Android: improve a bit the "androiddeployqt is not smart and needs help" code
We do that by:
 * Remembering all the generators we're building
 * Linking the dependencies of all those generators against the app

For that to work we do three things:
 * Move the creation of the app target to after the generator targets
   have been created
 * Have a global variable that lists all the created generators
 * Move the find_package of the generator dependencies to the top level
   so it can be used from the mobile app target
2022-03-28 20:25:04 +00:00
Albert Astals Cid 36ee0a1aa7 Add DQT_NO_KEYWORDS
A future ECM is going to force it on us, so add it now
2022-03-19 10:58:47 +00:00
Albert Astals Cid ad6426be52 GIT_SILENT Upgrade release service version to 22.07.70. 2022-03-12 13:03:14 +01:00
Andreas Naumann 293337d994 Set QT_PLUGIN_PATH
The MR
  1. adds a note, that the tests in the build tree depend on the install tree.
  2. extends the QT_PLUGIN_PATH with KDE_INSTALL_FULL_QTPLUGINDIR in cmake before creating the tests. That removes the need to source prefix.sh before calling cmake.
2022-03-07 23:09:02 +00:00
Albert Astals Cid 2c2acbb8e0 Increase Okular5Core soversion for the 22.04 release
We have changed lots of ABI things since 21.12
2022-03-01 16:21:29 +01:00
Albert Astals Cid 4cd6bfd30e mobile: Add Signature Viewing UI
Move a few files from part/ to gui/ since they are also used by the
mobile/ frontend
2022-02-18 08:32:13 +00:00
Carl Schwan c9e09be0a9 Improve mobile drawer
Before:

![image](/uploads/cd0af949c3929eae5fbe68c6916e565b/image.png)

![image](/uploads/e121ddfc21aa6fb01e81f80cde7270d8/image.png)

After:

![image](/uploads/93ef9afc24d1712a20fa64bd06ad09fb/image.png)

![image](/uploads/721cca28cce0a9ab2e409774070a439b/image.png)

@mart
2022-01-19 22:33:21 +00:00
Albert Astals Cid 8681bc0223 Okular Mobile: Require Qt 5.15.2
Removes the smooth property of PageItem since it was never set and clazy
was complaining about it not having a NOTIFY signal

Remove two signals that already exist in parent class

Fix C++11 detach in range-loop
2021-12-28 09:06:01 +00:00
Albert Astals Cid 3792d8d560 Tweak default UI
It's desktop unless you're building for Android where the default it's
mobile.

You can still manually specify which UI you want and you'll get that
regardless of the platform

Only require KParts if we're building the desktop UI

Two small changes in CI:
 * Stop pretending we have a macOS CI
 * Add Android CI
    - libkexiv2, khtml and kjs would be nice but we don't have Android builds
      yet
2021-12-17 22:03:35 +00:00
Albert Astals Cid 29911062e3 Merge remote-tracking branch 'origin/release/21.12' 2021-11-21 23:12:31 +01:00
Albert Astals Cid 2de5c96e52 okularcore doesn't need dbus 2021-11-21 17:50:40 +00:00
Heiko Becker 86cdd29a86 GIT_SILENT Upgrade release service version to 22.03.70. 2021-11-08 20:40:45 +01:00
Heiko Becker 33fa8b542d GIT_SILENT Upgrade release service version to 21.11.80. 2021-11-08 20:03:08 +01:00
Mahmoud Khalil 8b3dfcb3f4 PDF: Add Stamps to the file properly
By using Poppler 20.10 new custom image stamps APIs

Instead of the incompatible hack we used before that only worked for Okular.

This is done by modifying the update function used by PopplerAnnotationProxy in order to load the image in
the correct dimensions and send it to the poppler-Qt5 frontend.

We temporarily store the stamp annotation appearance when deleting it so that we can set it again when doing an undo undo.
2021-10-01 16:04:50 +00:00
Volker Krause 2a7e4416b5 Don't require D-Bus on Android
Also, actually fully disable the build of okularpart, which isn't needed
on Android.

With this Okular can be built for Android without the D-Bus stub, at least
once KIO doesn't pull in D-Bus anymore.
2021-08-20 18:46:50 +00:00
Simone Gaiarin 8837a1138f Add quick annotation minibar action
BUG: 425438
BUG: 425598

Fix #20
2021-08-13 21:28:39 +00:00
Albert Astals Cid 7876ccac65 GIT_SILENT Upgrade release service version to 21.11.70. 2021-07-10 20:05:41 +02:00
David Hurka 195bbe3636 Create color mode menu.
Implemented using a ColorModeMenu class,
derived from ToggleActionMenu (derived from KActionMenu),
as a child object of PageView.

* KToggleAction for every color mode, allows to set shortcuts for every mode.
  Color mode actions have icons.
* KToggleAction for normal colors mode.
* ToggleActionMenu containing all color mode actions.
  If triggered, toggles color mode between normal colors and last change colors mode.

"Toggle Change Colors" is replaced by "Change Colors", which is actually a toggle action.

BUG: 407217
BUG: 437755
2021-05-29 23:08:56 +00:00
Nicolas Fella c4e33d0e79 Make dependency on KI18n and KTextWidgets explicit
They are already pulled in by KParts, but we better not rely on that
2021-04-26 13:49:43 +02:00
David Hurka 67325270ec Fix viewport jumps when drag-scrolling beyond screen edges
This creates CursorWrapHelper, which wraps the cursor
from e. g. top screen edge to bottom screen edge,
and calculates the drag offset from the actual cursor movement.
2021-03-25 12:22:19 +00:00
Albert Astals Cid 889e744f91 GIT_SILENT Upgrade release service version to 21.07.70. 2021-03-13 22:06:29 +01:00
David Hurka 134cbc30d5 Port config dialogs from .ui to QFormLayout
* C++ instead of .ui files.
* Put every control in a QFormLayout row.
* Where possible, use only a single layout, i. e. no nesting.
* Use rows with an empty QLabel as horizontal spacer.
  Content grouping by whitespace instead of group boxes.
* Where group boxes were used for labeling tool managers,
  use a <h3> QLabel instead.
* Where group boxes were used for labeling control groups,
  drop the label or label only the first control (like in Dolphin).
* Use combo boxes instead of radio button groups.
  (I don’t know how to connect radio buttons to KConfigWidgets...)
* Don’t use checkboxes as label, that doesn’t lay out correctly.
  Instead, put the checkbox in an own row, although it controls the same feature.

Some of the changes are not perfect yet, so I opened
https://invent.kde.org/graphics/okular/-/issues/45 to outline further improvements.
2021-01-01 01:09:10 +00:00
Thorsten Behrens f7d6045b92 Add poppler NSS support
Move certificate config down into generator code
Read available signing certificates from poppler NSS
2020-12-13 21:31:14 +00:00
Katarina Behrens 242710cae7 Recycle WidgetConfigurationToolsBase for certificate management dlg 2020-12-13 21:31:14 +00:00
Katarina Behrens 69ddb957f1 Add config page to configure signing identities/certificates 2020-12-13 21:31:14 +00:00
Albert Astals Cid 3cc7bdd1d7 cmake: Modern way to link to zlib 2020-12-02 18:57:49 +01:00
David Hurka a83261db92 Merge branch 'release/20.12' into master 2020-11-18 20:35:53 +01:00
David Hurka 19d5dd8ec7 New part/ directory for okularpart sources from /, ui/, conf/
Source files are no longer separated by UI and non-UI and similar,
but only by their build target.

* ui/ -> part/
* Move all source files from conf/ to part/
* Keep config skeleton definitions in conf/, needed for the mobile target too
* Move editdrawingtooldialogtest.h from conf/autotests/ to autotests/
* ui/data/icons/ -> icons/
* Move /part.cpp, /part.rc and similar files to part/
* Adapt include paths in source files
* Adapt CMakeLists.txt files (in / and in subdirectories)
* Adapt /Messages.sh
2020-11-18 19:32:56 +00:00
Albert Astals Cid becdc7c483 Revert the two last commits
f9841b0f8a and e0f45add55

They break the windows build, which shows there's something defenitely
fishy going on with the current code, but oh well, someone with more
time needs to figure out a proper solution
2020-11-11 01:31:47 +01:00
Albert Astals Cid e0f45add55 Enable -Wweak-vtables in clang
Read https://stackoverflow.com/a/23749273/11956287 for a full
explanation, but basically this is important for headers like the
interfaces/ and kdocumentviewer.h that are supposed to be used by third
partyies where it may happen that wrong things happen because the whole
class is inline in a header

For the classes that are defined in the .cpp or are not installed
headers this would not be necessary but it's not so hard to add a few
default defined destructors, so do that :)
2020-11-08 21:21:06 +00:00
Albert Astals Cid f44eceba76 GIT_SILENT Upgrade release service version to 21.03.70. 2020-11-08 18:40:16 +01:00
Albert Astals Cid 1327fdd830 GIT_SILENT Upgrade release service version to 20.11.80. 2020-11-08 17:53:23 +01:00
Simone Gaiarin 580cbce837 Selectively reparse builtin and quick annotation tool configuration 2020-10-28 05:32:07 +00:00
Laurent Montel f7cc59b7dc Drop outdated QT_USE_FAST_OPERATOR_PLUS 2020-09-17 07:14:54 +02:00
Friedrich W. H. Kossebau 37bf29d57d Use ecm_setup_qtplugin_macro_names
Avoids all the explicit boilerplate needed, ensures the dependency on
the JSON file ia also set and allows simple export of the setup
in the installed CMake config file, so other projects importing
the config file have the respective CMake macros set as recommended.

Test Plan:
Still builds as before. Touch a plugin metadata JSON file now triggers a moc
rerun. CMake config file contains setup of variables.
2020-09-13 11:20:50 +02:00
Albert Astals Cid c17127b018 cmake: suggest-override is provided by ECM since 5.55 2020-09-13 01:04:16 +02:00
Albert Astals Cid e989200dcf Increase minimum supported versions to those provided by Ubuntu 20.04 2020-09-13 01:03:53 +02:00
Albert Astals Cid d5210db504 Change the version to be date based
As discussed on the Akademy meeting, it's just simpler to do this than
keep pretending 1.10 vs 1.9 have some kind of meaning :)
2020-09-11 16:27:26 +00:00
Albert Astals Cid 2697105462 Revert cbddcd3273
KJS and KWallet are indeed optional, that's what the ${optionalComponents} variable does
2020-09-09 14:13:09 +02:00
Albert Astals Cid cbddcd3273 kwallet and kjs are mandatory in cmake anyway, remove ifdefs 2020-09-05 23:50:45 +00:00
Albert Astals Cid ee2ef4b0f2 Merge remote-tracking branch 'origin/release/20.08' 2020-07-13 01:16:38 +02:00
Albert Astals Cid a73012a91c Cleanup part.rc files older than version 47
Otherwise we crash because we introduced a mandatory new toolbar and
kxmlgui doesn't seem to merge them properly

BUGS: 422827
2020-07-12 23:52:08 +02:00
Albert Astals Cid 4f3d1db584 increase version 2020-07-11 12:29:01 +02:00
Albert Astals Cid 8fef6098a1 GIT_SILENT Upgrade release service version to 20.11.70. 2020-07-11 12:27:08 +02:00
Albert Astals Cid 7044b0ddf3 GIT_SILENT Upgrade release service version to 20.07.80. 2020-07-11 11:54:57 +02:00
Albert Astals Cid a3c7d81000 Merge remote-tracking branch 'origin/release/20.04' 2020-06-30 19:37:33 +02:00
Albert Astals Cid 795c7cb01f Increase kjs requirement for using the timeout check
Unfortunately with the new timeout code but older than 5.72 will crash on appAlert

So increase the requirement to > 5.71
2020-06-24 12:06:32 +02:00
Christoph Feck 1d80b278ff GIT_SILENT Upgrade release service version to 20.04.2. 2020-06-08 19:29:41 +02:00
Simone Gaiarin 0b05d7ce99 Overhaul annotations UX
Create a new new annotation toolbar to replace the current one as discussed in the task T8076.
Fixes:
BUG: 386578
BUG: 374728
BUG: 352310
BUG: 330518
BUG: 341914
BUG: 157289
BUG: 358057
BUG: 412767
BUG: 413595
BUG: 420462
FIXED-IN: 1.11.0

Test Plan
Before testing this revision
Delete or Temporary move aside the following files:

~/.config/okularpartrc
~/.config/okularrc
~/.local/share/kxmlgui5/okular/part.rc
~/.local/share/kxmlgui5/okular/shell.rc

Nomenclature
Actions in the main toolbar:

Quick annotations
Actions in the annotation toolbar:

Annotation actions Highlighter, Underline, Squiggle, Strike out, Typewriter,
Inline note, Popup note, Freehand line, Arrow, Straight line, Rectangle, Ellipse,
Polygon, Stamp

Annotation config actions Line width, Color, Inner color, Opacity, Font, Annotation settings

Other actions Add to Quick Annotations, Pin

Autotests

 First run: annotation toolbar is not visible

 Selecting Tools > Annotations shows the annotation toolbar (below the main toolbar by default)

 Select an annotation > toolbar is shown

 Select a quick annotation > toolbar is shown

 Hide action (red cross) on the toolbar hides the toolbar

 Keys 1-9,0 select the (builtin) Annotation actions (one case tested)

 Keys Alt+1-9,0 select the quick annotation actions (one case tested)

 No annotation action selected: Quick Annotations is enabled, Add to quick annotations is disabled, Annotation config actions are disabled, Pin is enabled

 The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled (also in Quick annotations)

 The current document is protected: All actions are disabled

 Select annotation: the  Annotation config actions are enabled and their values set to the ones for the current annotation (taken from okularpartrc)

 Click an annotation action when none selected: browse mode is selected

 Click the currently selected annotation action: the action is unchecked and the tool disabled (back to browse mode)

 Click ESC: the currently selected annotation action is unchecked

 If Pin unchecked the selected annotation is unchecked after it has be used once and we are back to Browse mode

 The annotation systems works when multiple Okular tabs are open (the selected annotation is per-tab)

Manual tests

(TODO) Check that kconf_update updates the key AnnotationTools to QuickAnnotationTools in ~/.config/okularpartrc

Color icon is a format-text-color (if inline note or typewriter) or format-stroke-color for all other annotations
All actions have tooltips (some change based on the fact that the icon is enabled or not)
If a custom Line Width or Opacity is set through the Annotation Settings dialog, its value appears as a new checked action in the Line width or Opacity menu
If a custom stamp is selected through the Annotation Settings dialog, its name or filename (without path) appears as a new checked action in the Stamp menu
In Configure Okular > Annotations it is only possible to configure the quick annotations. Modifying them here updates the Quick annotations list after clicking Apply

The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled in Quick annotations
The state of Pin action is remembered across Okular launches
Selecting a quick action selects the corresponding action and loads its config values (color, line width, ...)
Setting the color and fill color works for all annotations (to be tested carefully, can be problematic for typewriter and inline note given the different internal mechanism to store the color in the settings)
Test stamp annotation (handled differently from the rest of the annotations)

Merge Request: https://invent.kde.org/graphics/okular/-/merge_requests/105
2020-06-04 13:01:31 +00:00
Albert Astals Cid daad6c9fa1 Silence some deprecation warnings we can't fix 2020-06-03 21:37:32 +00:00
Christoph Feck d3dcf7a394 GIT_SILENT Upgrade release service version to 20.04.1. 2020-05-11 22:23:16 +02:00
Albert Astals Cid 26f8bb3279 GIT_SILENT increase version 2020-04-15 23:15:50 +02:00
Christoph Feck 5f9a2d85d4 GIT_SILENT Upgrade release service version to 20.04.0. 2020-04-15 10:38:01 +02:00
Albert Astals Cid 25b6775468 Use ${KF5_REQUIRED_VERSION} also for ECM 2020-04-08 21:56:29 +02:00
Friedrich W. H. Kossebau 2fa8080447 Ensure build dependency on JSON files using CMAKE_AUTOMOC_DEPEND_FILTERS
Also do needed setup for automoc in installed CMake config file.
2020-04-08 00:46:27 +02:00
Christoph Feck aa1af3cf4f GIT_SILENT Upgrade release service version to 20.03.90. 2020-03-28 23:33:51 +01:00
Albert Astals Cid c06f3c1557 GIT_SILENT Upgrade release service version to 20.03.80. 2020-03-15 19:58:44 +01:00
Albert Astals Cid c1852b8ddb GIT_SILENT Increase version 2020-03-15 19:48:43 +01:00
Albert Astals Cid 61e155045b GIT_SILENT Upgrade release service version to 20.07.70. 2020-03-15 19:36:50 +01:00
Simone Gaiarin 31e2c29ef0 Set C++ minimum version to 14
Also set CXX_EXTENSIONS to OFF
2020-02-29 09:26:34 +01:00
Yuri Chornoivan 5c6a297feb Fix minor EBN issues 2020-02-13 11:47:51 +02:00
Harri Porten c1afa356c0 Restrict time given for JavaScript evaluation to max. 2 seconds.
Possible improvement: alert the user of the timeout and offer
the option to continue or abort execution.
2020-02-11 22:34:46 +00:00
Albert Astals Cid a96c082d69 Build desktop User Interface by default
Can choose to only build mobile interface or both
2020-02-06 22:26:00 +01:00
David Hurka c6d937ab0d Replace ToolAction by ToggleActionMenu
Summary:
This replaces ToolAction by a near-drop-in replacement named ToggleActionMenu. The new annotation toolbar already uses this (D15580).

Unlike ToolAction, ToggleActionMenu inherits from KActionMenu to be more flexible.
* Menu can be set from outside, not hard coded.
* Default action for toolbar button is controllable from outside. (Theoretically, the button could trigger //anything// now.)
* KActionMenu instead of KSelectAction:
  - Pluggable in other menus, thus called “Menu”.
  - Doesn’t make the actions exclusive, so //any// actions can be added to the menu.
* ImplicitDefaultAction mode can choose the default action of the toolbar buttons automatically, by looking for the first checked action in the menu.

Toolbar buttons use the default action //of// this menu, not this menu itself as action.

Because the default action is configurable now, D21622 and D21635 (where we tried to fine-tune ToolAction) become obsolete.

Screenshot:
Everything like before, here with mouse_selecttool added to Tools menu to show submenu capability.
{F6884228}

Test Plan:
ToolAction replacement and ImplicitDefaultAction mode:
 * Open Okular and look at toolbar button -> has correct tool selected.
 * Open a document.
 * Look at toolbar button menu -> Correct menu entries (like before, with ToolAction).
 * Select some selection tools through shortcuts and toolbar button -> behaves correctly.
Usage as submenu:
 * Add ToggleActionMenu ("mouse_selecttool") to menubar (..../kxmlgui5/okular/part.rc) -> Submenu looks correctly, has no checkbox attached and so on...
Toolbar buttons:
 * Add diverse other actions to the menu -> still works as before.
 * Add actions when toolbar buttons are already created -> actions are added to existing buttons.
 * setDefaultAction() to some completely unrelated action. -> ToggleActionMenu does not get confused.

Reviewers: simgunz

Reviewed By: simgunz

Subscribers: aacid, ngraham, simgunz, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D21971
2020-02-02 01:33:33 +01:00
Albert Astals Cid be8e5710d4 Require poppler >= 0.62
It's the one that comes with our "minimum" requirement Ubuntu 16.04

Cleans up the code a bit
2020-01-09 00:01:43 +00:00
Jonathan Riddell 3403a16f42 Change KDE_APPLICATIONS_VERSION to RELEASE_SERVICE_VERSION https://phabricator.kde.org/T11933
GIT_SILENT
2019-12-10 16:56:25 +00:00
Albert Astals Cid b8ff7608f2 increase version
GIT_SILENT
2019-11-10 01:18:11 +01:00
Albert Astals Cid 10f602762b GIT_SILENT Upgrade KDE Applications version to 20.03.70. 2019-11-10 01:15:59 +01:00
Nicolas Fella 0110d2f584 [android] Use filedialog from Qt
(cherry picked from commit 187c474024)
2019-11-03 07:44:38 +13:00
Albert Astals Cid 2555954228 Merge remote-tracking branch 'origin/Applications/19.08' 2019-08-08 19:13:28 +02:00
Albert Astals Cid fe5e467d71 GIT_SILENT Increase version number 2019-08-08 19:12:03 +02:00
Christoph Feck ccbd797580 GIT_SILENT Upgrade KDE Applications version to 19.07.90. 2019-07-29 15:48:05 +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 aec76a6752 GIT_SILENT Upgrade KDE Applications version to 19.11.70. 2019-07-15 21:43:08 +02:00
Albert Astals Cid 24e66a250b GIT_SILENT Upgrade KDE Applications version to 19.07.80. 2019-07-15 21:21:18 +02:00
Albert Astals Cid 10cfe6c23e Increase cmake requirement to 3.5
It's what KF5 uses since a while and we kind of agreed it was old-enough
looking at https://repology.org/metapackage/cmake/badges
2019-07-04 19:45:51 +02:00
Albert Astals Cid 5e6649c3b1 Increase Qt deendency to Qt 5.9
It's LTS and reading https://repology.org/project/qt5/badges it's not
like many distros ship Qt 5.8 anyway
2019-07-04 00:40:56 +02:00
Laurent Montel a262fa194d Install in new logging directory when we use kf5 5.59.0 2019-06-12 06:58:00 +02:00
Michael Weghorn 8bf1a91175 Add option to ignore print margins for non-PDF generators
Summary:
This adds a combobox in the print dialog of the non-PDF
generators to allow selecting whether or not to take
print margins into account.

For the PDF case and rasterized printing, new print otions have
been implemented in commit 2e97d58750
already, which adds an additional option to do no scaling at all.

For consistency reasons, the same terms also used for the PDF
case are used in the combobox (i.e. the two of the three that
apply).

This adds a new abstract class 'PrintOptionsWidget' with a
'ignorePrintMargins()' method to indicate whether print margins
should be ignored or not, and a default implementation.
The existing widget for the PDF generator now derives from this
class.

In order to avoid an ABI breakage, the return value of
'Document::printConfigurationWidget' is left as a 'QWidget *'
and a dynamic_cast is done on use.

FilePrinter is adapted to take into account the value set by
'QPrinter::setFullPage()' and the margin options
are now passed accordingly (either the values set in the dialog or '0').

A big thanks to Albert Astals Cid <aacid@kde.org> for showing how
to extend the initial implementation to cover more generators.

Test Plan:
1) Open a PostScript file in Okular (using a document size that matches
  a paper size available on the printer used later makes it easier
  to see things behave as expected)

2) open print dialog, go to "Print options" and notice that there is a new
  "Scale mode" combobox whose value is set to "Fit to printable area"
   by default.

3) don't change any options, print to a printer that has hardware margins

Expected result: the document is scaled to the printable area (e.g.
scaled down so that the printer's hardware margins remain empty) as it
has been without this change.

4) Set the value of the "Print Options" -> "Scale mode" combobox to
   "Fit to full page" and print again

Expected result: The document is scaled to the full page size, i.e. ignoring
the printer's hardware margins.

5) Try steps 1-4 with other document formats supported by Okular and
   observe that they behave the same (except for the PDF case, where
   there's a combobox with three options that has been implemented
   independent of this change).

Reviewers: #okular, ngraham

Reviewed By: ngraham

Subscribers: fvogt, rkflx, arthurpeters, ltoscano, okular-devel, aacid, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D10974
2019-04-03 08:00:35 -06:00