+ const auto description = i18n("Key %1 found in %2 (%3)", QString::fromLatin1(key.key.keyID()) + u": "_s + Kleo::Formatting::prettyNameAndEMail(key.key), key.source == KeyInfo::AutocryptHeader ? i18nc("noun", "Autocrypt message header") : i18n("Attachment"),
+ status);
+ if (key.status == KeyInfo::KnownOrOlderKey) {
+ knownkeys.append(description);
+ } else {
+ newkeys.append(description);
+ }
+ }
+ if (!newkeys.isEmpty()) {
+ auto res = KMessageBox::questionTwoActionsList(parentWidget(), i18n("The following new or updated OpenPGP keys were found in the headers and/or attachments to this message. Do you want to import them?"), newkeys, i18n("Import keys"), KGuiItem(i18n("Import")), KStandardGuiItem::cancel());
+ if (res == KMessageBox::PrimaryAction) {
+ // TODO: can we somehow get Kleopatra's dialog, here?
+ auto ctx = GpgME::Context::create(GpgME::Protocol::OpenPGP);