mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-28 19:28:38 +00:00
Prompt for password and stick it to widget annotation
This commit is contained in:
parent
45fc7cd805
commit
b33a12d786
1 changed files with 14 additions and 4 deletions
|
@ -334,14 +334,24 @@ public:
|
|||
|
||||
Okular::Annotation * ann = nullptr;
|
||||
|
||||
bool resok;
|
||||
bool resok = false;
|
||||
QString cert = QInputDialog::getItem(nullptr, i18n( "Select certificate to sign with" ), i18n( "Certificates:" ), items, 0, false, &resok);
|
||||
|
||||
if (resok)
|
||||
{
|
||||
Okular::WidgetAnnotation * wa = new Okular::WidgetAnnotation();
|
||||
ann = wa;
|
||||
wa->setBoundingRectangle(rect);
|
||||
bool passok = false;
|
||||
QString title = i18n("Enter password to unlock certificate %1");
|
||||
QString pass = QInputDialog::getText(nullptr, i18n( "Enter password" ), title.replace("%1", cert),QLineEdit::Password ,QString(), &passok);
|
||||
|
||||
if (passok)
|
||||
{
|
||||
Okular::WidgetAnnotation * wa = new Okular::WidgetAnnotation();
|
||||
ann = wa;
|
||||
|
||||
wa->setBoundingRectangle(rect);
|
||||
wa->setCertificateCN( cert );
|
||||
wa->setPassword( pass );
|
||||
}
|
||||
}
|
||||
|
||||
m_creationCompleted = false;
|
||||
|
|
Loading…
Reference in a new issue