Page MenuHome GnuPG

No OneTemporary

diff --git a/src/commands/newcertificatecommand.cpp b/src/commands/newcertificatecommand.cpp
index 1c426d2ea..6cd7632a5 100644
--- a/src/commands/newcertificatecommand.cpp
+++ b/src/commands/newcertificatecommand.cpp
@@ -1,164 +1,166 @@
/* -*- mode: c++; c-basic-offset:4 -*-
commands/newcertificatecommand.cpp
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config-kleopatra.h>
#include "newcertificatecommand.h"
#include "command_p.h"
#include <settings.h>
#include <newcertificatewizard/newcertificatewizard.h>
using namespace Kleo;
using namespace Kleo::Commands;
using namespace GpgME;
class NewCertificateCommand::Private : public Command::Private
{
friend class ::Kleo::Commands::NewCertificateCommand;
NewCertificateCommand *q_func() const
{
return static_cast<NewCertificateCommand *>(q);
}
public:
explicit Private(NewCertificateCommand *qq, KeyListController *c);
~Private() override;
void init();
private:
void slotDialogRejected();
void slotDialogAccepted();
private:
void ensureDialogCreated();
private:
Protocol protocol;
QPointer<NewCertificateWizard> dialog;
};
NewCertificateCommand::Private *NewCertificateCommand::d_func()
{
return static_cast<Private *>(d.get());
}
const NewCertificateCommand::Private *NewCertificateCommand::d_func() const
{
return static_cast<const Private *>(d.get());
}
#define d d_func()
#define q q_func()
NewCertificateCommand::Private::Private(NewCertificateCommand *qq, KeyListController *c)
: Command::Private(qq, c),
protocol(UnknownProtocol),
dialog()
{
}
NewCertificateCommand::Private::~Private() {}
NewCertificateCommand::NewCertificateCommand()
: Command(new Private(this, nullptr))
{
d->init();
}
NewCertificateCommand::NewCertificateCommand(KeyListController *c)
: Command(new Private(this, c))
{
d->init();
}
NewCertificateCommand::NewCertificateCommand(QAbstractItemView *v, KeyListController *c)
: Command(v, new Private(this, c))
{
d->init();
}
void NewCertificateCommand::Private::init()
{
}
NewCertificateCommand::~NewCertificateCommand() {}
void NewCertificateCommand::setProtocol(Protocol proto)
{
d->protocol = proto;
if (d->dialog) {
d->dialog->setProtocol(proto);
}
}
Protocol NewCertificateCommand::protocol() const
{
if (d->dialog) {
return d->dialog->protocol();
} else {
return d->protocol;
}
}
void NewCertificateCommand::doStart()
{
d->ensureDialogCreated();
Q_ASSERT(d->dialog);
- if (d->protocol == UnknownProtocol && !Settings{}.cmsEnabled()) {
+ const Kleo::Settings settings{};
+ const auto cmsAllowed = settings.cmsEnabled() && settings.cmsCertificateCreationAllowed();
+ if (d->protocol == UnknownProtocol && !cmsAllowed) {
d->protocol = GpgME::OpenPGP;
}
if (d->protocol != UnknownProtocol) {
d->dialog->setProtocol(d->protocol);
}
d->dialog->show();
}
void NewCertificateCommand::Private::slotDialogRejected()
{
Q_EMIT q->canceled();
finished();
}
void NewCertificateCommand::Private::slotDialogAccepted()
{
finished();
}
void NewCertificateCommand::doCancel()
{
if (d->dialog) {
d->dialog->close();
}
}
void NewCertificateCommand::Private::ensureDialogCreated()
{
if (dialog) {
return;
}
dialog = new NewCertificateWizard;
applyWindowID(dialog);
dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, SIGNAL(rejected()), q, SLOT(slotDialogRejected()));
connect(dialog, SIGNAL(accepted()), q, SLOT(slotDialogAccepted()));
}
#undef d
#undef q
#include "moc_newcertificatecommand.cpp"
diff --git a/src/kcfg/settings.kcfg b/src/kcfg/settings.kcfg
index 1cc1982ee..14c8b801a 100644
--- a/src/kcfg/settings.kcfg
+++ b/src/kcfg/settings.kcfg
@@ -1,80 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="kleopatrarc" />
<group name="CertificateCreationWizard">
<entry key="CN_placeholder" name="cnPlaceholder" type="String">
<label>Placeholder for CN</label>
<whatsthis>This text will be used as placeholder text for the common name (CN) field of S/MIME certificates.</whatsthis>
<default></default>
</entry>
<entry key="CN_prefill" name="prefillCN" type="Bool">
<label>Prefill CN automatically</label>
<whatsthis>If true, then the common name (CN) field of S/MIME certificates will be prefilled with information gathered from the system,
e.g., from the email settings of the desktop or, on Windows, from the Active Directory.</whatsthis>
<default>true</default>
</entry>
<entry key="EMAIL_placeholder" name="emailPlaceholder" type="String">
<label>Placeholder for EMAIL</label>
<whatsthis>This text will be used as placeholder text for the email address field of OpenPGP and S/MIME certificates.</whatsthis>
<default></default>
</entry>
<entry key="EMAIL_prefill" name="prefillEmail" type="Bool">
<label>Prefill EMAIL automatically</label>
<whatsthis>If true, then the email address field of OpenPGP and S/MIME certificates will be prefilled with information gathered from the system,
e.g., from the email settings of the desktop or, on Windows, from the Active Directory.</whatsthis>
<default>true</default>
</entry>
<entry key="NAME_placeholder" name="namePlaceholder" type="String">
<label>Placeholder for NAME</label>
<whatsthis>This text will be used as placeholder text for the name field of OpenPGP certificates.</whatsthis>
<default></default>
</entry>
<entry key="NAME_prefill" name="prefillName" type="Bool">
<label>Prefill NAME automatically</label>
<whatsthis>If true, then the name field of OpenPGP certificates will be prefilled with information gathered from the system,
e.g., from the email settings of the desktop or, on Windows, from the Active Directory.</whatsthis>
<default>true</default>
</entry>
</group>
<group name="CMS">
<entry key="Enabled" name="cmsEnabled" type="Bool">
<label>Enable S/MIME</label>
<tooltip>Enables support for S/MIME (CMS).</tooltip>
<whatsthis>If false, then Kleopatra's main UI will not offer any functionality related to S/MIME (CMS).</whatsthis>
<default>true</default>
</entry>
+ <entry key="AllowCertificateCreation" name="cmsCertificateCreationAllowed" type="Bool">
+ <label>Allow S/MIME certificate creation</label>
+ <tooltip>Allows the creation of S/MIME certificate signing requests.</tooltip>
+ <whatsthis>If false, then Kleopatra will not offer the creation of S/MIME certificate signing requests.</whatsthis>
+ <default>true</default>
+ </entry>
</group>
<group name="ConfigurationDialog">
<entry name="ShowAppearanceConfiguration" type="Bool">
<label>Show appearance configuration</label>
<default>true</default>
</entry>
<entry name="ShowCryptoOperationsConfiguration" type="Bool">
<label>Show crypto operations configuration</label>
<default>true</default>
</entry>
<entry name="ShowDirectoryServicesConfiguration" type="Bool">
<label>Show directory services configuration</label>
<default>true</default>
</entry>
<entry name="ShowGnuPGSystemConfiguration" type="Bool">
<label>Show GnuPG system configuration</label>
<default>true</default>
</entry>
<entry name="ShowSMimeValidationConfiguration" type="Bool">
<label>Show S/MIME validation configuration</label>
<default>true</default>
</entry>
</group>
<group name="Groups">
<entry name="GroupsEnabled" type="Bool">
<label>Enable Groups</label>
<tooltip>Enable usage of groups of keys.</tooltip>
<whatsthis>Enable usage of groups of keys to create lists of recipients.</whatsthis>
<default>true</default>
</entry>
</group>
</kcfg>

File Metadata

Mime Type
text/x-diff
Expires
Mon, Dec 23, 5:23 PM (2 h, 42 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0c/3c/cf1f9aa5ac6e896eb08d525b1865

Event Timeline