Commit 19355a42 authored by Albert Astals Cid's avatar Albert Astals Cid Committed by Albert Astals Cid
Browse files

Slight improvement to signature look&feel

Use black for text color and border (instead of default red)
Also force the date to have timezone info, i.e.
instead of
parent 05846601
Pipeline #57895 passed with stage
in 26 minutes and 18 seconds
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <QStack> #include <QStack>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QTextStream> #include <QTextStream>
#include <QTimeZone>
#include <QTimer> #include <QTimer>
#include <KAboutData> #include <KAboutData>
...@@ -1893,9 +1894,14 @@ bool PDFGenerator::sign(const Okular::NewSignatureData &oData, const QString &rF ...@@ -1893,9 +1894,14 @@ bool PDFGenerator::sign(const Okular::NewSignatureData &oData, const QString &rF
pData.setCertNickname(oData.certNickname()); pData.setCertNickname(oData.certNickname());
pData.setPassword(oData.password()); pData.setPassword(oData.password());
pData.setPage(; pData.setPage(;
pData.setSignatureText(i18n("Signed by: %1\n\nDate: %2", oData.certSubjectCommonName(), QDateTime::currentDateTime().toString(Qt::ISODate))); const QDateTime t = QDateTime::currentDateTime();
// This way we force the timezone info to be included in the string
const QString datetime = t.toTimeZone(t.timeZone()).toString(Qt::ISODate);
pData.setSignatureText(i18n("Signed by: %1\n\nDate: %2", oData.certSubjectCommonName(), datetime));
const Okular::NormalizedRect bRect = oData.boundingRectangle(); const Okular::NormalizedRect bRect = oData.boundingRectangle();
pData.setBoundingRectangle({bRect.left,, bRect.width(), bRect.height()}); pData.setBoundingRectangle({bRect.left,, bRect.width(), bRect.height()});
if (!converter->sign(pData)) if (!converter->sign(pData))
return false; return false;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment