Commit graph

75 commits

Author SHA1 Message Date
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
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
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
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
Friedrich W. H. Kossebau
9de70e2499 Port away from deprecated PurposeWidgets include
GIT_SILENT
2023-03-03 02:39:25 +01:00
Eugene Popov
2fbab13e1f Port sidebar to QDockWidget
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
2022-12-22 22:50:55 +00:00
Albert Astals Cid
fc8059575e Two more version checks that are not needed now 2022-11-19 11:10:16 +01:00
Albert Astals Cid
91afa74342 Set minimum requirement to Ubuntu 22.04 2022-11-19 09:48:15 +00:00
Albert Astals Cid
d0359e6342 Merge remote-tracking branch 'origin/release/22.08' 2022-09-04 22:41:24 +02:00
Albert Astals Cid
8e93995e3c Fix saving files on Windows
turn a move into a copy and remove

Seems to work better with windows way of working with open files being
overwritten and stuff

BUGS: 458574
2022-09-04 22:26:23 +02:00
Albert Astals Cid
b2c56a0a71 Merge remote-tracking branch 'origin/release/22.08' 2022-08-31 22:09:06 +02:00
Albert Astals Cid
01871fdfff Even more tweaks to opening "text" files
BUGS: 430538
BUGS: 456434
2022-08-31 16:55:30 +00:00
Friedrich W. H. Kossebau
b96902b40c Port away from deprecated KMessageBox::sorry 2022-07-23 15:01:11 +02:00
Friedrich W. H. Kossebau
3efcce3344 Save warning confirm dialogs: avoid Yes/No buttons
Yes/No buttons in dialogs are discouraged (not only) by KDE HIG in favour
of actions terms.
2022-07-13 11:10:54 +00:00
Friedrich W. H. Kossebau
dd8682ae8e Unsupported archive extension dialog: avoid Yes/No buttons
Yes/No buttons in dialogs are discouraged (not only) by KDE HIG in favour
of actions terms.
2022-07-13 12:07:21 +02:00
Albert Astals Cid
12ac32d414 Merge remote-tracking branch 'origin/release/22.04' 2022-07-04 19:44:28 +02:00
Albert Astals Cid
e7db8c92ae Don't leave temp files around when saving
BUGS: 453421
2022-07-04 01:05:31 +02:00
George Florea Bănuș
327d547024 Add app-wide color scheme chooser
BUG: 432088
FIXED-IN: 22.08
2022-05-24 20:37:11 +00:00
Luis Kao
5001962112 Fix color mode actions in ViewerWidgetMode
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.
2022-04-29 08:01:33 +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
Albert Astals Cid
252236d413 Port a few more QLinkedList to QList
We don't need the special properties of QLinkedList in any of those and
QLinkedList is deprecated, so move away from it
2022-03-31 17:08:01 +02:00
Albert Astals Cid
ba35bbd9e6 emit -> Q_EMIT
A future ECM is going to force that on us, so do it early
2022-03-19 10:58:47 +00:00
Volker Krause
50d0703ae0 Enable readability-braces-around-statements 2022-03-09 23:29:56 +01:00
Albert Astals Cid
1aa175cf3f Support SaveAs action
If a new enough (unreleases as of now) poppler is available

BUGS: 451010
2022-03-06 19:16:27 +00:00
Huu-Tinh Pham
57829d1d81 added fallback icon for thumbnail sync context menu
The sync icon was missing when using the Breeze Icon pack.
Now a sync icon and a refresh icon is used for this thumbnail sync action.
2022-02-23 15:31:12 +00:00
snooxx 💤
9432565ede Fix broken page MiniBar
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.
2022-02-22 23:16:34 +00:00
Albert Astals Cid
0197a78fb5 Part::queryClose: Don't ask the user if he wants to save file types we can't save
BUGS: 449976
2022-02-22 13:20:37 +00:00
Andreas Naumann
147a638619 Adds option editor-cmd to the commandline
Adds the option "editor-cmd" for the [feature request](https://bugs.kde.org/show_bug.cgi?id=263732) .

BUG: 263732
2022-02-18 13:33:28 +00:00
Huu-Tinh Pham
a3fde02232 Onetime sync thumbnail
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)
2022-02-18 12:12:41 +00: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
Albert Astals Cid
a3fbd52739 Tell the user if he tries to save an Okular Archive with the wrong extension 2022-02-10 22:26:31 +00:00
Nicolas Fella
a6c8d6dac3 Simplify printing code
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
2022-02-04 13:26:09 +01:00
Nate Graham
3c98dcdb0c Improve Bookmark action icons and text
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.
2022-02-01 19:58:42 +00:00
Nate Graham
01557c16c4 Put an "Add Bookmark" button on the Bookmarks sidebar
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
2022-02-01 19:58:42 +00:00
Albert Astals Cid
a8e5f6e9f7 PDF: Allow signing unsigned signature fields 2022-01-24 13:18:36 +01:00
Albert Astals Cid
d59967d8e1 Merge remote-tracking branch 'origin/release/21.12' 2022-01-24 12:53:23 +01:00
Albert Astals Cid
fa6743aa04 Support the PDF Print named action
Also stop casting directly from a poppler enum to an okular enum, it's
not cool

BUGS: 448791
2022-01-23 22:20:46 +00:00
Albert Astals Cid
3e919b4287 Fix saving to okular archive on Windows
BUGS: 431717
2022-01-23 22:20:13 +00:00
Albert Astals Cid
df4a7ef4e9 Merge remote-tracking branch 'origin/release/21.12' 2022-01-05 14:01:09 +01:00
Albert Astals Cid
44c86de7e4 Fix two Signature issues on multipage/multisignature documents
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
2022-01-03 23:38:23 +01:00
Albert Astals Cid
a2576dc746 Act on core/ TODOs that are not binary compatible
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
2021-12-29 09:35:25 +00:00
Marco Rebhan
583f5717fd m_share only exists when using purpose
(cherry picked from commit ea9e53311e)
2021-11-11 01:04:02 +01:00
Marco Rebhan
ea9e53311e
m_share only exists when using purpose 2021-11-10 14:49:32 +01:00
Felix Ernst
7bd0f8f399 Add KHamburgerMenu 2021-11-09 01:27:50 +00:00
Nate Graham
aceed15e84 Improve "can not overwrite" message some more
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.
2021-11-03 05:01:56 +00:00
Albert Astals Cid
3657958900 Merge remote-tracking branch 'origin/release/21.08' 2021-10-14 22:37:18 +02:00