diff --git a/src/conf/configuredialog.cpp b/src/conf/configuredialog.cpp index e91479368..895206db5 100644 --- a/src/conf/configuredialog.cpp +++ b/src/conf/configuredialog.cpp @@ -1,78 +1,91 @@ /* configuredialog.cpp This file is part of kleopatra SPDX-FileCopyrightText: 2000 Espen Sand SPDX-FileCopyrightText: 2001-2002 Marc Mutz SPDX-FileCopyrightText: 2004, 2008 Klarälvdalens Datakonsult AB SPDX-FileCopyrightText: 2016 Bundesamt für Sicherheit in der Informationstechnik SPDX-FileContributor: Intevation GmbH SPDX-License-Identifier: GPL-2.0-only */ - #include "configuredialog.h" +#include "settings.h" + #include #include #include #include #include "conf/appearanceconfigpage.h" #include "conf/cryptooperationsconfigpage.h" #include "conf/dirservconfigpage.h" #include "conf/gnupgsystemconfigurationpage.h" #include "conf/smimevalidationconfigurationpage.h" ConfigureDialog::ConfigureDialog(QWidget *parent) : KleoPageConfigDialog(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 // the largest one. This way at least after the first showing of // the largest kcm the size is kept. const KConfigGroup geometry(KSharedConfig::openStateConfig(), "Geometry"); const int width = geometry.readEntry("ConfigureDialogWidth", 0); const int height = geometry.readEntry("ConfigureDialogHeight", 0); if (width != 0 && height != 0) { setMinimumSize(width, height); } } void ConfigureDialog::hideEvent(QHideEvent *e) { const QSize minSize = minimumSizeHint(); KConfigGroup geometry(KSharedConfig::openStateConfig(), "Geometry"); geometry.writeEntry("ConfigureDialogWidth", minSize.width()); geometry.writeEntry("ConfigureDialogHeight", minSize.height()); KleoPageConfigDialog::hideEvent(e); } ConfigureDialog::~ConfigureDialog() { } diff --git a/src/kcfg/settings.kcfg b/src/kcfg/settings.kcfg index f23ac3a26..40f25f372 100644 --- a/src/kcfg/settings.kcfg +++ b/src/kcfg/settings.kcfg @@ -1,15 +1,37 @@ + + + + true + + + + true + + + + true + + + + true + + + + true + + Enable usage of groups of keys. Enable usage of groups of keys to create lists of recipients. true