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
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
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
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
With this MR, the sidebar can now be (if not locked):
* docked to the left or right side
* undocked and floated as an independent window
* closed with the close button in the header
BUG: 455013
Move "options_configure_color_modes" from Okular::Part::setupActions to
Okular::Part::setupViewerActions.
The color mode actions were not properly set in ViewerWidgetMode. Kile would
encounter "ASSERT failure" caused by the Q_ASSERT_X in ColorModeMenu class in
Debug mode.
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
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.
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.