Commit graph

320 commits

Author SHA1 Message Date
Jeremy Whiting 4ae7d68857 Fix more Qt deprecations.
Mostly QPrinter::Orientation -> QPageLayout::Orientation and
a few things about sizes.
2023-08-10 23:12:39 +00:00
Sune Vuorela 88fc4032ac Random collection of cppcheck fixes
- missing consts
 - shadowing of variable names
 - superflous code
 - tighter scoping of some variables
 and other such bits
2023-08-10 22:47:57 +00:00
Sune Vuorela c5909d0a6d Better suggested signed name
When signing a "filename versioned" pdf, e.g. foo-1.2.3.pdf, the
current suggestion for signed name is weird. the "_signed"
gets misplaced in the middle of the version.

Also, compressed pdf's (pdf.gz) gets up with weird suggestions.

Fix both of these cases and document (by tests) the current behavior.
2023-08-07 22:08:20 +00:00
Albert Astals Cid 532cb0cdcd Initial implementation of app.popUpMenuEx
It is defenitely not a full implementation but it's enough for the one
file we have that needs it for now

BUGS: 472764
2023-08-05 18:20:54 +00:00
Albert Astals Cid f940ca1e2e Forms: Don't run focusin action when gaining focus because of window management
Adobe Reader doesn't do it, and with reason, because otherwise we end up
with:
 * Run focus in script
 * script shows alert()
 * form loses focus and gains it again once the alert() is closed
 * infinite loop

The same fix we did in e457ceb731 but for
the rest of the widgets

BUGS: 472756
2023-08-01 22:07:14 +00:00
Jeremy Whiting cc80b3d0e3 Convert okular_part.desktop to okular_part.json and use it.
Also fixed the deprecation warning in the generator plugins.
Thanks to Alexander Lohnau
2023-07-23 17:16:07 +00:00
Emir SARI ad97329acd Apply i18n to percent values
This commit allows localizing the percent values for the languages,
that use a different percent format.
2023-07-23 16:16:24 +00:00
Sune Vuorela 720e08220d Allow dbus to be disabled
In certain usecases, especially for non-linux desktop builds, the
advantage of of dbus is often limited. Provide a way to disable
building with dbus.

Note that this also disables the related functionalities of having a
second okular launch open the document in the first okular.

This also disables the unit tests that tests those features.
2023-07-18 07:53:42 +00:00
Nicolas Fella db68662372 Avoid accidental scrolling when performing pinch gesture
When starting a pinch the user first touches with one finger. That causes the QScroller to enter the pressed state.
Then when the second finger touches and moves this causes the QScroller to interpret it as a scroll. This causes
the view position of the document to move

To avoid this send InputRelease to the scroller when a pinch starts to make sure it is no longer in pressed state.
Also don't send any input to the scroller while the pinch is ongoing to avoid it entering the pressed state again.

BUG: 421755
2023-07-08 12:04:08 +00:00
Sune Vuorela d1133be5fc Allow open certificate with kleopatra
If the active backend is gnupg (e.g. if only compiled-in backend, or later when configurabitily thru okular has been merged), we can offer to view and edit certificates with Kleopatra (KDE's certificate manager)
2023-06-25 22:41:22 +00:00
Sune Vuorela 03368e06f4 Make phonon optional
In certain configurations not lugging around a multimedia framework could be preferred.
2023-06-21 15:50:58 +00:00
Sune Vuorela 0c383d8cfc Random minor/pedantic fixes 2023-06-17 11:04:41 +00:00
Nate Graham c1165fba5d Surface Digitally Sign action more obviously in hamburger menu
This is an important feature of Okular, but when using the
KHamburgerMenu UX, it's quite buried in the More... section. Let's
move it up to the top level of the menu.

BUG: 470752
FIXED-IN: 23.08
2023-06-15 05:12:56 +00:00
Sune Vuorela 3768e242b5 Signature dialog: put a spacer in bottom
This prevents too much items dancing around if no images and just one
certificate
2023-06-14 17:47:41 +00:00
Sune Vuorela 91b03f860a Show recent images when it gains content 2023-06-14 17:47:41 +00:00
Sune Vuorela 3c6ebac826 Provide a way to remove images from signature dialog 2023-06-14 17:47:41 +00:00
Sune Vuorela c27539fbbb Make certificate list fit if only 1 or 2 certificates 2023-06-14 17:47:41 +00:00
Sune Vuorela 9f498c7f55 Allow new signatures to have image backgrounds 2023-06-14 17:47:41 +00:00
Sune Vuorela da7ca71291 Add location and reason to signing info 2023-06-14 17:47:41 +00:00
Sune Vuorela 47b8fb2729 Switch SelectCertificateDialog to ui file
No other changes is in here.
2023-06-14 17:47:41 +00:00
Nate Graham 99600667d4 Don't stop or warn if the edited file was deleted on disk
If an open  file with unsaved changes was deleted on disk, Okular
currently warns the user about it (in master) or prevents them from
saving it (in 23.04). But in both cases this is unnecessary; if the
open file was deleted on disk when the user tries to save changes,
Okular can simply save to its file path and re-create it, with no
risk of data loss or stomping on anyone else's work. So it should do
that.

CCBUG: 402017
2023-06-08 15:21:41 +00:00
Friedrich W. H. Kossebau 725155b29d Include only needed headers instead of QtDBus module header
GIT_SILENT
2023-06-07 22:41:22 +00:00
Friedrich W. H. Kossebau de03d64855 Include only needed headers instead of QtTextToSpeech module header
GIT_SILENT
2023-06-07 22:41:22 +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
Kai Uwe Broulik a6eeddf892 PageView: Set InstantPopup mode for View Mode menu
Fixes typo.
2023-05-16 17:35:53 +02:00
Sune Vuorela 0a7199fab6 Simple deprecation. ReturnKeyPressed 2023-05-12 18:09:44 +00:00
Sune Vuorela 5c9e0e2585 Rename setViewportWithHistory to setViewport and remove the old setViewport 2023-05-12 10:39:41 +00:00
Sune Vuorela 763328a6ba Better dialog for selecting certificates
Instead of just a simple list of "nickname"'s which is kind of like the
signing backend's internal ID for a given certificate, provide some more
context to each key.

This is a slight improvement, not a complete overhaul.
2023-05-03 13:41:14 +00:00
Sune Vuorela d3e1c32ff7 Simple deprecation: returnPressed 2023-05-03 09:58:52 +00:00
Sune Vuorela 9876bef3bb Simple deprecation: DefaultLocaleLongDate 2023-05-03 09:42:45 +00:00
Sune Vuorela b32ae775b4 Remove virtual methods from signature and certificate info
This is an abi break, but it menas we can extend signature and
certificate info in the future without breaking the abi again.

While we are at it, there is no need to hand around pointers to
certificate/signature info any longer, so clean up that. Fix memleaks as
side effect.
2023-05-03 09:15:42 +00:00
Nate Graham 89f17155bf Offer options when trying to overwrite externally-modified file
When the user tries to do a "Save" operation on an open file that was
since modified externally, currently Okular prohibits it. We can make
this a bit more user-friendly by instead explaining the situation
clearly and offering the user some options:
- Yes, really overwrite the changes made in the other program
- Instead save the unsaved changes as a new file elsewhere
- Abort

CCBUG: 402017
2023-05-02 20:57:48 +00:00
Nate Graham b5191a2c1f Let user "Save As..." when document has been externally modified
Currently Okular stops the user from saving their document if it has
unsaved changes and was modified externally. This makes some sense
because there are now two sources of truth, and Okular cannot reconcile
them itself. However as a consequence, it causes data loss since the
user's unsaved changes in Okular become un-save-able. This is quite
frustrating when it happens.

But this prohibiton on saving over an externally-modified document only
really makes sense for a "Save" operation that overwrites the original
document. If instead, the user does a "Save As...", then they can save
their local changes to another file and avoid losing unsaved changes.
Then if needed, they can manually compare the original
externally-modified document with their newly-saved document and
reconcile the changes by hand.

Accordingly, this commit avoids showing the error message box and
blocking saving if the user is doing a "Save As..." to a new location,
rather than overwriting the open file.

BUG: 402017
FIXED-IN: 23.04.1
2023-05-02 20:57:48 +00:00
Kai Uwe Broulik 7d53ef7c74 Allow copying annotation text to clipboard
Adds a "Copy Text to Clipboard" context menu which copies the
annotation text to the clipboard as plain text.

When an annotation is selected in "Browse" mode, its text is copied.
2023-04-30 08:11:16 +00:00
Sune Vuorela b932f4289e Simple deprecation. Qt::MidButton 2023-04-27 10:36:01 +00:00
Sune Vuorela 1826ec6daa Simple deprecation. Date long formatting 2023-04-27 11:56:24 +02:00
Sune Vuorela 5d8eac0e2a Return a structure instead of using output arguments
This is preparation to extending the function to also query for possible
background images, reason and location
2023-04-27 09:34:58 +02:00
Sune Vuorela 222d778c33 Deprecation fix; returnPressed 2023-04-22 15:02:09 +00:00
Sune Vuorela 87b2831232 Deprecation fix. popupMode 2023-04-19 20:30:27 +00:00
Sune Vuorela 63053419b9 setDelayed deprecation 2023-04-19 14:57:55 +00:00
Sune Vuorela b238acae92 deprecation fix. krandom 2023-04-16 10:15:01 +00:00
Nate Graham 8c8744f2e3 Re-arrange toolbar buttons by usage frequency
When using an LTR language, people scan user interfaces left-to right
and top to bottom. This means that the most frequently-used controls
should be located at the top left, so people see them first.

This commit uses that principle to re-arrange the toolbar a bit, so that
after the "show/hide sidebar button" (which needs to be the left-most
item to connect it with the left sidebar), the left-most items in the
default toolbar are the zoom and view mode controls. These are
viewing-related controls, and Okular is first and foremost a viewer app.
The controls that let you interact with the document (select stuff,
annotate) are moved over to the right side of the toolbar because they
are used for secondary workflows.

The zoom buttons are also grouped together to connect them in the user's
mind.

Finally, the separator lines are re-added to disconnect the "show/hide
sidebar" button from the now-icons-only zoom buttons.
2023-03-15 18:11:52 +00:00
Friedrich W. H. Kossebau 9de70e2499 Port away from deprecated PurposeWidgets include
GIT_SILENT
2023-03-03 02:39:25 +01:00
Nate Graham b6c6d906ba Tweak default toolbar to fit View Mode combobox
This is a useful UI element that I find myself using a lot, so quick
access is helpful. Another person just submitted a similar change (see
!689) so it would seem there is some demand for this.

In its current form, the toolbar contents would be too long if we added
it, and items would get pushed into the overflow menu. To prevent this,
let's also drop the separator lines and text from the zoom buttons.
2023-02-23 16:21:27 +00:00
Friso Smit 0b25a83cd5 Do continous scrolling when there is high resolution scroll 2023-02-20 01:07:11 +00:00
Friso Smit 30969b490c Move continuous zoom to a function 2023-02-20 01:07:11 +00:00
Cimbali a33e499b40 Fix wrong interpretation of autoplay flag
BUGS: 436709
2023-02-15 23:32:49 +00:00
shenleban tongying 2ba2ee5d87 Reduce sidebar title size
This slightly increases the amount of vertical space available for content.

BUG: 462321
FIXED-IN: 23.04
2023-01-05 23:45:52 +00:00