Verified Commit 4ccbaec6 authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Respect action restrictions in welcomewidget

Check for the two welcome actions if they are disabled
through KDE Action Restrictions
parent f573a51f
......@@ -22,6 +22,8 @@
#include "commands/newcertificatecommand.h"
#include <KLocalizedString>
#include <KSharedConfig>
#include <KConfigGroup>
static const QString templ = QStringLiteral(
"<h3>%1</h3>" // Welcome
......@@ -79,12 +81,16 @@ public:
mGenerateBtn->setToolTip(i18n("Create a new OpenPGP key pair") + QStringLiteral("<br>") +
i18n("To create an S/MIME certificate request use \"New Key Pair\" from the 'File' Menu instead"));
KConfigGroup restrictions(KSharedConfig::openConfig(), "KDE Action Restrictions");
mGenerateBtn->setEnabled(restrictions.readEntry("action/file_new_certificate", true));
mImportBtn = new QToolButton();
mImportBtn->setIconSize(QSize(64, 64));
mImportBtn->setToolTip(i18n("Import from a file.") + QStringLiteral("<br>") +
i18n("To import from a public keyserver use \"Lookup on Server\" instead."));
mImportBtn->setEnabled(restrictions.readEntry("action/file_import_certificate", true));
auto btnLayout = new QHBoxLayout;
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