Commit fd3b5727 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Propose a file name for the generated revocation certificate

We propose "<fingerprint>.rev" in the last used export directory as
file name. This is the same file name as for the revocation certificates
that gpg automatically writes to the openpgp-revocs.d folder when a new
OpenPGP key is generated.

GnuPG-bug-id: 6121
parent 0479937b
......@@ -12,8 +12,9 @@
#include "genrevokecommand.h"
#include <Libkleo/GnuPG>
#include <utils/applicationstate.h>
#include <Libkleo/GnuPG>
#include <Libkleo/Formatting>
#include <gpgme++/key.h>
......@@ -100,9 +101,10 @@ void GenRevokeCommand::postSuccessHook(QWidget *parentWidget)
/* Well not much to do with GnuPGProcessCommand anymore I guess.. */
void GenRevokeCommand::doStart()
auto proposedFileName = ApplicationState::lastUsedExportDirectory() + u'/' + QString::fromLatin1(d->key().primaryFingerprint()) + QLatin1String{".rev"};
while (mOutputFileName.isEmpty()) {
mOutputFileName = QFileDialog::getSaveFileName(d->parentWidgetOrView(), i18n("Generate revocation certificate"),
QStringLiteral("%1 (*.rev)").arg(i18n("Revocation Certificates ")));
if (mOutputFileName.isEmpty()) {
......@@ -116,11 +118,12 @@ void GenRevokeCommand::doStart()
"Overwrite?", mOutputFileName),
i18n("Overwrite Existing File?"));
if (sel == KMessageBox::No) {
mOutputFileName = QString();
proposedFileName = mOutputFileName;
auto proc = process();
// We do custom io
Supports Markdown
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