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

Allow prefilling of name/email for new certificates to be disabled

Prefilling of the name and email input fields in the new certificate
wizard with information retrieved from the system/environment can be
disabled by setting CN_prefill, NAME_prefill, and EMAIL_prefill to false.

GnuPG-bug-id: 5690
parent aa694114
Pipeline #100225 passed with stage
in 14 minutes and 13 seconds
......@@ -10,16 +10,34 @@
<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="ConfigurationDialog">
<entry name="ShowAppearanceConfiguration" type="Bool">
......
......@@ -14,6 +14,8 @@
#include "newcertificatewizard.h"
#include <settings.h>
#include "ui_chooseprotocolpage.h"
#include "ui_enterdetailspage.h"
#include "ui_keycreationpage.h"
......@@ -1408,6 +1410,7 @@ void EnterDetailsPage::updateForm()
clearForm();
const auto settings = Kleo::Settings{};
const KConfigGroup config(KSharedConfig::openConfig(), "CertificateCreationWizard");
QStringList attrOrder = config.readEntry(pgp() ? "OpenPGPAttributeOrder" : "DNAttributeOrder", QStringList());
......@@ -1484,10 +1487,11 @@ void EnterDetailsPage::updateForm()
widgets.push_back(ui.resultLE);
widgets.push_back(ui.advancedPB);
if (ui.nameLE->text().isEmpty()) {
const bool prefillName = (pgp() && settings.prefillName()) || (!pgp() && settings.prefillCN());
if (ui.nameLE->text().isEmpty() && prefillName) {
ui.nameLE->setText(userFullName());
}
if (ui.emailLE->text().isEmpty()) {
if (ui.emailLE->text().isEmpty() && settings.prefillEmail()) {
ui.emailLE->setText(userEmailAddress());
}
......
Markdown is supported
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