Take compliance mode name from config

Different users require a different name for VS-NfD compliance
VS-NfD is something german and Kleopatra now also sees some
usage in NATO RESTRICTED, EU RESTRICTED, etc. use
cases. To better work for that we now take it from libkleopatrarc
so that it can be centrally configured for such deployments.
parent 3afa2818
Pipeline #36526 failed with stage
in 62 minutes and 5 seconds
......@@ -15,7 +15,7 @@ option(DISABLE_KWATCHGNUPG "Don't build the kwatchgnupg tool [default=OFF]" OFF)
# Standalone build. Find / include everything necessary.
set(KF5_MIN_VERSION "5.74.0")
set(KMIME_VERSION "5.15.40")
set(LIBKLEO_VERSION "5.15.40")
set(LIBKLEO_VERSION "5.15.41")
set(QT_REQUIRED_VERSION "5.13.0")
set(GPGME_REQUIRED_VERSION "1.11.1")
......
......@@ -282,10 +282,10 @@ static QString formatSigningInformation(const Signature &sig)
text +=
(QStringLiteral("<br/>")
+ (IS_DE_VS(sig)
? i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that a signature is compliant with that.",
"The signature is VS-NfD-compliant.")
: i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that a signature is not compliant with that.",
"The signature <b>is not</b> VS-NfD-compliant.")));
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"The signature is %1", Formatting::deVsString())
: i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"The signature <b>is not</b> %1.", Formatting::deVsString())));
}
return text;
......@@ -548,10 +548,10 @@ static QString formatDecryptionResultDetails(const DecryptionResult &res, const
if (Kleo::gpgComplianceP("de-vs")) {
details += ((IS_DE_VS(res)
? i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that the decryption is compliant with that.",
"The decryption is VS-NfD-compliant.")
: i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that the decryption is compliant with that.",
"The decryption <b>is not</b> VS-NfD-compliant."))
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"The decryption is %1.", Formatting::deVsString())
: i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"The decryption <b>is not</b> %1."), Formatting::deVsString())
+ QStringLiteral("<br/>"));
}
......
......@@ -22,6 +22,7 @@
#include "utils/kleo_assert.h"
#include <Libkleo/Stl_Util>
#include <Libkleo/Formatting>
#include <gpgme++/key.h>
......@@ -275,10 +276,10 @@ private:
? KColorScheme(QPalette::Active, KColorScheme::View).background(KColorScheme::PositiveBackground).color().name()
: KColorScheme(QPalette::Active, KColorScheme::View).background(KColorScheme::NegativeBackground).color().name()));
ui.complianceLB.setText(de_vs
? i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that all cryptographic operations necessary for the communication are compliant with that.",
"VS-NfD-compliant communication possible.")
: i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that all cryptographic operations necessary for the communication are compliant with that.",
"VS-NfD-compliant communication not possible."));
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"%1 communication possible.", Formatting::deVsString())
: i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"%1 communication not possible.", Formatting::deVsString()));
ui.complianceLB.setVisible(true);
}
......
......@@ -26,6 +26,7 @@
#include "kleopatra_debug.h"
#include <Libkleo/GnuPG>
#include <Libkleo/Formatting>
#include <Libkleo/FileNameRequester>
#include <QWindow>
......@@ -289,10 +290,10 @@ private Q_SLOTS:
? KColorScheme(QPalette::Active, KColorScheme::View).background(KColorScheme::PositiveBackground).color().name()
: KColorScheme(QPalette::Active, KColorScheme::View).background(KColorScheme::NegativeBackground).color().name()));
mParent->setLabelText(de_vs
? i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that all cryptographic operations necessary for the communication are compliant with that.",
"VS-NfD-compliant communication possible.")
: i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that all cryptographic operations necessary for the communication are compliant with that.",
"VS-NfD-compliant communication not possible."));
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"%1 communication possible.", Formatting::deVsString())
: i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"%1 communication not possible.", Formatting::deVsString()));
}
} else {
btn->setText(i18n("Next"));
......
......@@ -168,12 +168,10 @@ public:
void updateStatusBar()
{
const auto complianceMode = Formatting::complianceMode();
if (!complianceMode.isEmpty()) {
if (complianceMode == QStringLiteral("de-vs")) {
auto statusBar = new QStatusBar;
q->setStatusBar(statusBar);
auto statusLbl = new QLabel(i18nc("Compliance means that GnuPG is running in a more restricted mode e.g. to handle restricted documents.",
// The germans want some extra sausage
"Compliance: %1", complianceMode == QLatin1String("de-vs") ? QStringLiteral ("VS-NfD") : complianceMode));
auto statusLbl = new QLabel(Formatting::deVsString());
statusBar->insertPermanentWidget(0, statusLbl);
} else {
......
......@@ -13,6 +13,7 @@
#include <Libkleo/Exception>
#include <Libkleo/Classify>
#include <Libkleo/KeyCache>
#include <Libkleo/Formatting>
#include "crypto/gui/signencryptwidget.h"
#include "crypto/gui/resultitemwidget.h"
......@@ -471,10 +472,10 @@ public:
? KColorScheme(QPalette::Active, KColorScheme::View).background(KColorScheme::PositiveBackground).color().name()
: KColorScheme(QPalette::Active, KColorScheme::View).background(KColorScheme::NegativeBackground).color().name()));
mAdditionalInfoLabel->setText(de_vs
? i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that all cryptographic operations necessary for the communication are compliant with that.",
"VS-NfD-compliant communication possible.")
: i18nc("VS-NfD-conforming is a German standard for restricted documents for which special restrictions about algorithms apply. The string states that all cryptographic operations necessary for the communication are compliant with that.",
"VS-NfD-compliant communication not possible."));
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"%1 communication possible.", Formatting::deVsString())
: i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"%1 communication not possible.", Formatting::deVsString()));
mAdditionalInfoLabel->setVisible(true);
}
}
......
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