From 188282cd21fccce9f67a180d499e2cb875a5f938 Mon Sep 17 00:00:00 2001 From: nils Date: Mon, 8 Aug 2011 20:01:02 +0000 Subject: only show import key action in verificynotification-menu when theres missing key on verify git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@510 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gpgwin.cpp') diff --git a/gpgwin.cpp b/gpgwin.cpp index 494b622..c8ed8bd 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -747,6 +747,7 @@ void GpgWin::verify() case 1: verifyLabelText="Message is partially signed by: "; break; } + bool unknownKeyFound=false; while (sign) { if (gpg_err_code(sign->status) == 9) { verifyLabelText.append("Key with keyid "); @@ -755,6 +756,7 @@ void GpgWin::verify() verifyLabelText.append(" not present."); *vn->keysNotInList << sign->fpr; vn->setProperty("keyNotFound", true); + unknownKeyFound=true; } else { QString name = mKeyList->getKeyNameByFpr(sign->fpr); QString email = "<"+mKeyList->getKeyEmailByFpr(sign->fpr)+">"; @@ -774,6 +776,11 @@ void GpgWin::verify() qDebug() << "sig validity reason: " << sign->validity_reason << " - " << gpg_err_code(sign->validity_reason) << " - " << gpgme_strerror(sign->validity_reason); sign = sign->next; } + if (unknownKeyFound) { + vn->addImportAction(); + } else { + vn->removeImportAction(); + } // Remove the last linebreak verifyLabelText.remove(verifyLabelText.length()-1,1); -- cgit