Commit graph

9149 commits

Author SHA1 Message Date
Thorsten Behrens 62a4c63fd3 Conditionalize code to Poppler signing feature flag 2020-12-13 21:31:14 +00:00
Thorsten Behrens f37de4feb4 Set some signature reason - might want some UI later 2020-12-13 21:31:14 +00:00
Thorsten Behrens 71795917de Add configurable CertDB path 2020-12-13 21:31:14 +00:00
Thorsten Behrens e9577f5f7d Properly set signature annotation bounds after insertion 2020-12-13 21:31:14 +00:00
Thorsten Behrens 9bca008f9d Init m_signatureMode in ctor 2020-12-13 21:31:14 +00:00
Thorsten Behrens 3eedb21a83 Consistenly use CERT nick to refer to signing key 2020-12-13 21:31:14 +00:00
Thorsten Behrens 981c597376 Fix overwriting pdf after signing
- make explicit we're using static QFile func here
- QFile::rename doesn't work across filesystems, so instead
  create it alongside. Might fail if dir is not writeable
- can't use QSaveFile, since poppler sign() func wants a filename
2020-12-13 21:31:14 +00:00
Thorsten Behrens f7d6045b92 Add poppler NSS support
Move certificate config down into generator code
Read available signing certificates from poppler NSS
2020-12-13 21:31:14 +00:00
Thorsten Behrens ae2c6a55c2 Fix crash on invalid engine 2020-12-13 21:31:14 +00:00
Thorsten Behrens b96dac6df3 Add certificate store for access to NSS keys
WIP - add interfaces and methods to get access to NSS-via-poppler
sign certificates, and provide them for signing documents.
2020-12-13 21:31:14 +00:00
Thorsten Behrens 847b423e2a Add better diagnostics 2020-12-13 21:31:14 +00:00
Thorsten Behrens e031822744 Adapt to poppler sign api change
Now poppler offers signing via PDFConverter class. Add some error
handling, and store signature in temp file. Document gets reloaded
after replacing original file.
2020-12-13 21:31:14 +00:00
Thorsten Behrens e3e582ee5c Add feature flag for poppler signing API
Test and conditionally-compile pdf signing feature, depending
on poppler new-ness.
2020-12-13 21:31:14 +00:00
Katarina Behrens b33a12d786 Prompt for password and stick it to widget annotation 2020-12-13 21:31:14 +00:00
Katarina Behrens 45fc7cd805 Read the certificates from configuration 2020-12-13 21:31:14 +00:00
Katarina Behrens 38c5b614b4 Simplify adding certificates to config and implement edit slot 2020-12-13 21:31:14 +00:00
Katarina Behrens 5db7421851 Get certificate CN and password and pass it to poppler 2020-12-13 21:31:14 +00:00
Katarina Behrens cc908b9f92 Pass pointer to widget annotation just added down the chain 2020-12-13 21:31:14 +00:00
Katarina Behrens 03381667f6 Pass certificate CN and password down the chain 2020-12-13 21:31:14 +00:00
Katarina Behrens 66f2bff5ca Pass bounding rectangle down the chain 2020-12-13 21:31:14 +00:00
Katarina Behrens d320fa17ad Stub some iface for signing the document 2020-12-13 21:31:14 +00:00
Katarina Behrens c560a4a20e Eventually hide the message window 2020-12-13 21:31:14 +00:00
Katarina Behrens 48dc3779f7 Add empty widget annotation 2020-12-13 21:31:14 +00:00
Katarina Behrens b2c5aa61d7 Read/write certificate settings 2020-12-13 21:31:14 +00:00
Katarina Behrens dd0c06a82b Signature mode must eventually end 2020-12-13 21:31:14 +00:00
Katarina Behrens 6cff306bab Making 'Sign' button a toggle was a bad idea 2020-12-13 21:31:14 +00:00
Katarina Behrens 3330f8407a Open filepicker to select p12, pfx file to add to user identity 2020-12-13 21:31:14 +00:00
Katarina Behrens 242710cae7 Recycle WidgetConfigurationToolsBase for certificate management dlg 2020-12-13 21:31:14 +00:00
Katarina Behrens 060175735f Open certificate selection dialog on mouse release 2020-12-13 21:31:14 +00:00
Katarina Behrens 339ce239f5 Draw an initial rectangle where to place the signature 2020-12-13 21:31:14 +00:00
Katarina Behrens b5117aff6c Add slot for 'Sign' button, shows info overlay so far 2020-12-13 21:31:14 +00:00
Katarina Behrens 888d287f1f Add 'Sign' button to toolbar 2020-12-13 21:31:14 +00:00
Katarina Behrens 69ddb957f1 Add config page to configure signing identities/certificates 2020-12-13 21:31:14 +00:00
Katarina Behrens 2845db76fb Add 'Sign' menu entry 2020-12-13 21:31:14 +00:00
Albert Astals Cid 35590a273d Fix CI
Laurent please use MR like everyone else does, otherwise you break the
build for the rest of us.

CCMAIL: montel@kde.org
2020-12-13 21:59:08 +01:00
Laurent Montel dd1938755e Don't include QtTest as it includes all QtCore includes 2020-12-13 17:51:28 +01:00
Nicolas Fella 50e8c4f333 Port an occurence of KMimeTypeTrader
It is about to be deprecated

See https://phabricator.kde.org/T12177
2020-12-12 18:04:26 +00:00
Carl Schwan 88eb005c93 Fix regression introduced by previous QML commits
Now you can again swipe a pages and id is correct
2020-12-11 15:38:47 +01:00
Carl Schwan d7f90b74a3 Use placeholder message for initial loading of a document
This also now remove the auto appearing global drawer that is now a menu
on desktop. This also move the main page into the pagestack.

Bump the Kirigami dependency because PlaceHolderMessage doesn't exist in
old version of Kirigami.
2020-12-11 14:31:21 +00:00
Carl Schwan 6af6742067 Visual improvements to drawer
Now the drawer open automatically when the window is big enough. The
drawer handle are also only visible when a document is open. The
thumbnails page was also improved and some spacing issues were solved.
2020-12-10 23:45:21 +00:00
Albert Astals Cid 604a4e1db2 clang-tidy: Disable bugprone-suspicious-enum-usage
Unfortunately it's triggered by QKeySequence needing a
Qt::KeyboardModifier and a Qt::Key
2020-12-10 00:02:14 +01:00
Albert Astals Cid 8176613076 Merge remote-tracking branch 'origin/release/20.12' 2020-12-10 00:01:29 +01:00
Albert Astals Cid bc85160d7f clang-tidy: Disable performance-no-automatic-move
It's just too aggressive with Qt classes that are refcounted and fine to
copy
2020-12-09 21:37:32 +01:00
Albert Astals Cid 39846f8c16 Merge remote-tracking branch 'origin/release/20.12' 2020-12-09 21:15:36 +01:00
Albert Astals Cid d1c2eed1b6 Make the CI pass with new clang-tidy
Disable bugprone-suspicious-include since it's triggered by the moc
includes

Disable bugprone-reserved-identifier since it's triggered by all our
_OKULAR defines, and yes even if the spec says that underscore is
reserved, are we going to be that unlucky that the library decides to
start using _OKULAR ? not probably

Add two TODOs for the future to make NormalizedRect/Point faster

Silence a warning about a quick moving QString if we make it non const

Silence a uchar vs char warning that is in decades old code so
experience seems to suggest it's ok.
2020-12-09 19:53:50 +01:00
Laurent Montel 3f58639e06 operator+/- is disabled for QFlags in qt6 2020-12-09 08:34:49 +01:00
Carl Schwan 5c3da77dcd Add standard AboutPage to Okular Mobile 2020-12-09 04:53:52 +00:00
Carl Schwan f470c235ce Use correct window title on mobile
Before it just displayed "okularkirigami" when no document was loaded
2020-12-08 15:26:35 +00:00
Carl Schwan 3ac4c8a81b Use Kirigami.SearchField
Provides following advantages:

* More semantically correct
* Visually consistent with QWidgets and QML search fields
* Correct QAccessible fields
2020-12-08 12:07:33 +01:00
Carl Schwan 4a53680529 Use pageStack instead of anchor.fill 2020-12-08 10:04:57 +01:00