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

Allow hiding of individual configuration pages

The configuration pages can be hidden by setting the following config
entries to `false` in the `[ConfigurationDialog]` group in `kleopatrarc`:
ShowAppearanceConfiguration, ShowCryptoOperationsConfiguration,
ShowDirectoryServicesConfiguration, ShowGnuPGSystemConfiguration,
ShowSMimeValidationConfiguration.

GnuPG-bug-id: 5689
parent aec82b82
Pipeline #99961 passed with stage
in 15 minutes and 29 seconds
......@@ -12,9 +12,10 @@
SPDX-License-Identifier: GPL-2.0-only
*/
#include "configuredialog.h"
#include "settings.h"
#include <KConfig>
#include <KLocalizedString>
#include <KConfigGroup>
......@@ -31,26 +32,38 @@ ConfigureDialog::ConfigureDialog(QWidget *parent)
{
setFaceType(KPageDialog::List);
setWindowTitle(i18nc("@title:window", "Configure"));
addModule(i18n("Directory Services"),
QStringLiteral("kleopatra/configuration.html#configuration-directory-services"),
QStringLiteral("view-certificate-server-configure"),
new DirectoryServicesConfigurationPage(this));
addModule(i18n("Appearance"),
QStringLiteral("kleopatra/configuration-appearance.html"),
QStringLiteral("applications-graphics"),
new Kleo::Config::AppearanceConfigurationPage(this));
addModule(i18n("Crypto Operations"),
QStringLiteral("kleopatra/configuration-cryptooperations.html"),
QStringLiteral("document-encrypt"),
new Kleo::Config::CryptoOperationsConfigurationPage(this));
addModule(i18n("S/MIME Validation"),
QStringLiteral("kleopatra/configuration.html#configuration-smime-validation"),
QStringLiteral("preferences-system-network"),
new Kleo::Config::SMimeValidationConfigurationPage(this));
addModule(i18n("GnuPG System"),
QStringLiteral("kleopatra/configuration.html#configuration-gnupgsystem"),
QStringLiteral("document-encrypt"),
new Kleo::Config::GnuPGSystemConfigurationPage(this));
const auto settings = Kleo::Settings{};
if (settings.showDirectoryServicesConfiguration()) {
addModule(i18n("Directory Services"),
QStringLiteral("kleopatra/configuration.html#configuration-directory-services"),
QStringLiteral("view-certificate-server-configure"),
new DirectoryServicesConfigurationPage(this));
}
if (settings.showAppearanceConfiguration()) {
addModule(i18n("Appearance"),
QStringLiteral("kleopatra/configuration-appearance.html"),
QStringLiteral("applications-graphics"),
new Kleo::Config::AppearanceConfigurationPage(this));
}
if (settings.showCryptoOperationsConfiguration()) {
addModule(i18n("Crypto Operations"),
QStringLiteral("kleopatra/configuration-cryptooperations.html"),
QStringLiteral("document-encrypt"),
new Kleo::Config::CryptoOperationsConfigurationPage(this));
}
if (settings.showSMimeValidationConfiguration()) {
addModule(i18n("S/MIME Validation"),
QStringLiteral("kleopatra/configuration.html#configuration-smime-validation"),
QStringLiteral("preferences-system-network"),
new Kleo::Config::SMimeValidationConfigurationPage(this));
}
if (settings.showGnuPGSystemConfiguration()) {
addModule(i18n("GnuPG System"),
QStringLiteral("kleopatra/configuration.html#configuration-gnupgsystem"),
QStringLiteral("document-encrypt"),
new Kleo::Config::GnuPGSystemConfigurationPage(this));
}
// We store the minimum size of the dialog on hide, because otherwise
// the KCMultiDialog starts with the size of the first kcm, not
......
......@@ -4,6 +4,28 @@
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="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>
......
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