From 847b423e2abb3bea67b95ce235aba7dbf3e363c4 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Mon, 7 Oct 2019 09:50:43 +0200 Subject: [PATCH] Add better diagnostics --- core/document.cpp | 12 +++++++----- part/pageviewannotator.cpp | 10 ++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/core/document.cpp b/core/document.cpp index eb8973f6c..e6f4f4642 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -2722,12 +2722,14 @@ void Document::sign( const Okular::Annotation* pWhichAnnotation ) // Sign it! if (!d->m_generator->sign( pWhichAnnotation, currentDocument().path() )) { - KMessageBox::error( nullptr, i18n("Could not sign '%1'. Invalid password or cannot write", - currentDocument().fileName() ) ); + KMessageBox::error( d->m_widget, + i18nc("%1 is a filename", + "Could not sign '%1'. Invalid password or cannot write", + currentDocument().fileName() ) ); } - // no need to - slotAttemptReload() gets called via - //dirty handler anyway: - //swapBackingFile(currentDocument().path(), currentDocument()); + // no need to - slotAttemptReload() gets called via + //dirty handler anyway: + //swapBackingFile(currentDocument().path(), currentDocument()); } } } diff --git a/part/pageviewannotator.cpp b/part/pageviewannotator.cpp index b6f425902..968912c82 100644 --- a/part/pageviewannotator.cpp +++ b/part/pageviewannotator.cpp @@ -340,8 +340,14 @@ public: if (resok) { 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); + QString title = i18n("Enter password to unlock certificate %1", + cert); + QString pass = QInputDialog::getText(nullptr, + i18n( "Enter password" ), + title, + QLineEdit::Password, + QString(), + &passok); if (passok) {