Bug 511986

Summary: Improve workflow for signing document/PDFs
Product: [Applications] okular Reporter: Richard <rrosner5>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal CC: kde
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Richard 2025-11-12 09:57:05 UTC
SUMMARY
After setting up a certificate storage and when trying to sign a document, the first popup window (where you select a certificate, set reason, location etc) isn't as user-friendly as one may think. At the very top it says "select certificate to sign with". But when there is only one certificate to select, it's not quite clear that it still needs to be selected. Furthermore, when neglecting to select the certificate, instead of giving an error message stating that a certificate needs to be selected, a password entry field pops up. It is absolutely not intuitive that you messed up something in the previous dialog. My guess is that this password field is for the case that the user password protected e.g. the Thunderbird certificate storage.

So what I'm proposing is that the first dialog is being revamped in a way that makes it more intuitive that something needs to be selected, even when there is only one certificate to choose from. I think a tick box in front of the certificate should make that more clear. Also, if my guess concerning the password field is right, there should be a button in the first dialog with something like "unlock certificate storage" on it.

STEPS TO REPRODUCE
1. set up a certificate storage in Okular
2. select tools -> digitally sign...


OBSERVED RESULT
The dialog popping up is everything but intuitive and there is no good guide (with images) explaining how to handle it.

EXPECTED RESULT
An intuitive workflow to sign a document.

SOFTWARE/OS VERSIONS
Windows: -
macOS: - 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Okular: 25.04.2
KDE Frameworks: 6.18.0
Qt: Using 6.9.2 and built against 6.9.2
Debian GNU/Linux forky/sid (Wayland)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.12.48+deb13-amd64


ADDITIONAL INFORMATION
-
Comment 1 Sune Vuorela 2025-11-12 10:03:26 UTC
I think it should be selected, the single one. If that's not the case, then we have a bug under certain setups that I haven't noticed.
Comment 2 Richard 2025-11-12 10:05:38 UTC
Nope, it's not preselected.
Comment 3 Sune Vuorela 2025-11-12 10:13:21 UTC
(In reply to Richard from comment #2)
> Nope, it's not preselected.

Ah. there is a first-time-run bug here. Once it has been selected once, it will remember the last used one.
Comment 4 Richard 2025-11-12 10:15:02 UTC
Indeed. I just checked, why trying to do it again, it's preselected.
Comment 5 Bug Janitor Service 2025-11-12 10:23:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/1271
Comment 6 Sune Vuorela 2025-11-13 15:08:14 UTC
Git commit 9d8b8564c5c7d452253dd9aa2161e156a7930e7d by Sune Vuorela.
Committed on 13/11/2025 at 08:00.
Pushed by aacid into branch 'master'.

Select first certificate if previous not found

Also fixes for the first time run where a previous one wasn't selected
Related: bug 504853

M  +6    -1    part/signaturepartutils.cpp

https://invent.kde.org/graphics/okular/-/commit/9d8b8564c5c7d452253dd9aa2161e156a7930e7d
Comment 7 Albert Astals Cid 2025-11-13 23:47:31 UTC
Git commit 442abe7c8e8242d961a8f0f3c3a0f69cb6ab993b by Albert Astals Cid, on behalf of Sune Vuorela.
Committed on 13/11/2025 at 23:47.
Pushed by aacid into branch 'release/25.12'.

Select first certificate if previous not found

Also fixes for the first time run where a previous one wasn't selected
Related: bug 504853
(cherry picked from commit 9d8b8564c5c7d452253dd9aa2161e156a7930e7d)

M  +6    -1    part/signaturepartutils.cpp

https://invent.kde.org/graphics/okular/-/commit/442abe7c8e8242d961a8f0f3c3a0f69cb6ab993b