Make it more similar to how we handle the format event.
We pass the new value to processKeystrokeAction, that calls the script
and sets the new value for the form object according to the result. If
needed the widget is refreshed to reflect the new text
The `MiniBar` normally used to display page numbers and to provide
navigation buttons regressed since 01557c16c4 to only show an empty
non-functional button called "Page Number", along with multiple
warnings:
`QObject::connect(MiniBar, QAction): invalid nullptr parameter`
This is caused by moving `setupViewerActions()` to a place where
`m_miniBar` is not initialized yet, even though it has a runtime
`connect`-dependency on it.
By moving `setupViewerActions()` back, the `MiniBar` starts working
again. Now the `m_addBookmark` action, which is created in that
function, is not available anymore to be passed to the constructor of
`BookmarkList`. To avoid moving the setup of the latter away from the
rest of the sidebar code, only assigning the action to the bookmark
button contained in the `BookmarkList` is deferred to
`setupViewerActions()`.
As requested, any accidental future `nullptr`-access will be handled by
crashing, even in Release builds, by omitting any checks.
BUG: 450347
Test Plan:
Page numbers show up again in toolbar, no more `connect` warnings.
Added context menu entry to quick sync thumbnails with the current page. This is handy in case the user is not using "Link the thumbnails with the page" and wants quick sync thumbnails without changing settings or search for the page in the thumbnails view.
Before
![image](/uploads/389216ce4720f1891ddc4f2bf8ee14ea/image.png)
After
![image](/uploads/b4804d11992695d3a6be6642c9d7ac16/image.png)
Remove pointless null check, we know printDialog isn't null since we create it right before
Create PrintDialog on the stack
We create and destroy it all within one function
This way we get guaranteed cleanup for free
This commit updates the "remove bookmark" actions to use the more
specific "bookmark-remove" icon, rather than the more general
"list-remove" icon or the older "edit-delete-bookmarks" icon which does
not exist in the Breeze icon theme. For compatibility's sake, a fallback
is added to try "edit-delete-bookmarks" if "bookmark-remove" is not
found in the active icon theme.
It also uses a longer but clearer string for the "remove all bokmarks"
context menu item.
Currently there are two tiny icons-only buttons with very similar icons
(which may even be identical in some icon themes). One of them is
checkable, and the other one triggers an immediate action. And there is
lots of unused space to the right of them.
This commit overhauls them in the following way:
- The toggle button becomes a checkbox with visible text, and is
inverted; now when checked, it shows all bookmarks
- The checkbox moves above the view and search field, to communicate
that it affects everything below it
- The button to add a bookmark gets some visible text
This should make the UI much clearer, at the cost of one extra line of
vertical space from the bookmarks list.
Previously, the only ways to add a bookmark were with the menu item or
keyboard shortcut. This commit adds a button at the bottom of the
bookmarks sidebar to do the same thing, which seems like a logical place
for such functionality.
setupViewerActions() was moved to earlier in the setup process to ensure
that m_addBookmark is assigned by the time the bookmarks sidebar is
created, since it gets passed that action in its constructor.
BUG: 357625
FIXED-IN: 21.12
First issue:
- The "document is totally signed" was based on the last signature of
the last page (that had signatures) that is not correct and needs to
be based in the last signature by date
- The "Rev #" number was based on the signature on the page, so if we
had two pages with one signature each the model showed "Rev 1" for
both
It adds new API which is not awesome in a stable branch, but the first
issue is important enough that warrants this to go to the stable branch
I'm going to need to break binary compatibility to add a new feature
so may as well cleanup all the TODOs regarding that
Changes:
* Moving a few destructors to the header
* Removing a few unnecessary & in params
* Adding a few necessary & in params
* Making print return an enum instead of a bool and then having another
function that returns the enum
* Make Generator::requestFontData be a virtual
* Remove unused enum
* Remove a few filePrinter unneeded functions
* Remove unused TextDocumentGenerator::addMetaData signal
This commit uses KUIT formatting for the filename part of the string,
fixes a grammar error ("read only" used as an adjective) and adds a bit
more detail for the user to help them figure out what happened.
Only handle shortcuts to quick annotation actions
if the Okular part is focussed. Otherwise, Okular as
embedded plugin might involuntarily steal numeric input
from the main application (like in the Kate preview plugin).
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.
There used to be a Q_ASSERT_X that was triggered when a widget was requested
with something else than a QToolBar as parent widget.
However, when the ToggleActionMenu is added to a QMenu,
createWidget() is called with the QMenu as parent.
This case was missed to be tested, but occurs when the toolbar
is detached/moved by the user.
PageView::slotScrollUp/Down() queried the size of the scrollbar instead of the viewport,
which has no obvious reason and doesn’t work when scrollbars are not there.
Probably the scrollbar size was thought to be more robust
in times when PageView had overshoot enabled.
Also fixes code documentation for these methods,
and removes another spaghetti feature where Continuous mode was queried
in an `if` branch before the one where it is relevant.
BUG: 421822
According to https://bugs.kde.org/show_bug.cgi?id=437334
the cursor position is not necessarily known on Wayland.
That would trigger the Q_ASSERT_X, so this patch removes
it. This does not solve the problem that we can not wrap
the cursor, but it prevents crashing Okular if using the
debug build on Wayland. You’re reading rectangular text.
BUG: 437334
CCBUG: 439471
When the annotation is unchecked the previous mouse mode is restored.
The slot slotMouseNormalToggled is changed back to its original version
of slotSetMouseNormal given that we needed to pass the checked state
only to detach the annotations, and we do it in the lambda now.
BUG: 398108
BUG: 437377
FIXED-IN: 21.08
From a glimpse at the khelpcenter code, I think it indexes all the html
pages in a manual, then finds the requested page by searching for the filename
(I am not 100% sure, though), for example either of these two urls work:
help:/okular/index.html#adding_digital_signatures
help:/okular/signatures.html#adding_digital_signatures
but when falling back to opening the manual at docs.kde.org in a web browser
that indexing isn't available, so we have to be a bit more precise with the
urls, so use the second url.
(cherry picked from commit df02881611)
From a glimpse at the khelpcenter code, I think it indexes all the html
pages in a manual, then finds the requested page by searching for the filename
(I am not 100% sure, though), for example either of these two urls work:
help:/okular/index.html#adding_digital_signatures
help:/okular/signatures.html#adding_digital_signatures
but when falling back to opening the manual at docs.kde.org in a web browser
that indexing isn't available, so we have to be a bit more precise with the
urls, so use the second url.
Adobe Reader doesn't do it, and with reason, because otherwise we end up
with:
* Run focus in script
* script shows alert()
* field loses focus and gains it again once the alert() is closed
* infinite loop
BUGS: 436990