diff --git a/src/aboutdata.cpp b/src/aboutdata.cpp index b15f10176..c352920cc 100644 --- a/src/aboutdata.cpp +++ b/src/aboutdata.cpp @@ -1,92 +1,101 @@ /* aboutdata.cpp This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2001, 2002, 2004 Klarälvdalens Datakonsult AB SPDX-License-Identifier: GPL-2.0-or-later */ #include #include #include "aboutdata.h" +#include + #include static const char kleopatra_version[] = KLEOPATRA_VERSION_STRING; static const char description[] = I18N_NOOP("Certificate Manager and Unified Crypto GUI"); struct about_data { const char *name; const char *desc; const char *email; const char *web; }; static const about_data authors[] = { { "Andre Heinecke", I18N_NOOP("Current Maintainer"), "aheinecke@gnupg.org", nullptr }, { "Marc Mutz", I18N_NOOP("Former Maintainer"), "mutz@kde.org", nullptr }, { "Steffen Hansen", I18N_NOOP("Former Maintainer"), "hansen@kde.org", nullptr }, { "Matthias Kalle Dalheimer", I18N_NOOP("Original Author"), "kalle@kde.org", nullptr }, }; static const about_data credits[] = { { I18N_NOOP("David Faure"), I18N_NOOP("Backend configuration framework, KIO integration"), "faure@kde.org", nullptr }, { I18N_NOOP("Michel Boyer de la Giroday"), I18N_NOOP("Key-state dependent colors and fonts in the certificates list"), "michel@klaralvdalens-datakonsult.se", nullptr }, { I18N_NOOP("Thomas Moenicke"), I18N_NOOP("Artwork"), "tm@php-qt.org", nullptr }, { I18N_NOOP("Frank Osterfeld"), I18N_NOOP("Resident gpgme/win wrangler, UI Server commands and dialogs"), "osterfeld@kde.org", nullptr }, { I18N_NOOP("Karl-Heinz Zimmer"), I18N_NOOP("DN display ordering support, infrastructure"), "khz@kde.org", nullptr }, { I18N_NOOP("Laurent Montel"), I18N_NOOP("Qt5 port, general code maintenance"), "montel@kde.org", nullptr }, }; AboutData::AboutData() : KAboutData(QStringLiteral("kleopatra"), i18n("Kleopatra"), - QLatin1String(kleopatra_version), i18n(description), KAboutLicense::GPL, +#ifdef Q_OS_WIN + Kleo::gpg4winVersion(), + Kleo::gpg4winDescription(), +#else + QLatin1String(kleopatra_version), + i18n(description), +#endif + KAboutLicense::GPL, i18n("(c) 2002 Steffen\u00A0Hansen, Matthias\u00A0Kalle\u00A0" "Dalheimer, Klar\u00E4lvdalens\u00A0" "Datakonsult\u00A0" "AB\n" "(c) 2004, 2007, 2008, 2009 Marc\u00A0Mutz, Klar\u00E4lvdalens\u00A0" "Datakonsult\u00A0" "AB") + QLatin1Char('\n') + i18n("(c) 2010-2019 The Kleopatra developers") #ifdef Q_OS_WIN - , i18n("Visit the Gpg4win homepage") + , Kleo::gpg4winLongDescription() #endif ) { using ::authors; using ::credits; for (unsigned int i = 0; i < sizeof authors / sizeof * authors; ++i) { addAuthor(i18n(authors[i].name), i18n(authors[i].desc), QLatin1String(authors[i].email), QLatin1String(authors[i].web)); } for (unsigned int i = 0; i < sizeof credits / sizeof * credits; ++i) { addCredit(i18n(credits[i].name), i18n(credits[i].desc), QLatin1String(credits[i].email), QLatin1String(credits[i].web)); } #ifdef Q_OS_WIN setBugAddress("https://dev.gnupg.org/u/rgpg4win"); #endif } diff --git a/src/view/welcomewidget.cpp b/src/view/welcomewidget.cpp index 76583ca1f..e029da991 100644 --- a/src/view/welcomewidget.cpp +++ b/src/view/welcomewidget.cpp @@ -1,136 +1,141 @@ /* view/smartcardwidget.h This file is part of Kleopatra, the KDE keymanager SPDX-FileCopyrightText: 2017 Bundesamt für Sicherheit in der Informationstechnik SPDX-FileContributor: Intevation GmbH SPDX-License-Identifier: GPL-2.0-or-later */ #include "welcomewidget.h" #include +#include #include #include #include #include #include #include "commands/importcertificatefromfilecommand.h" #include "commands/newcertificatecommand.h" #include static const QString templ = QStringLiteral( "

%1

" // Welcome "

%2

%3

" // Intro + Explanation "
  • %4
  • %5
" // "

%6

" // More info ""); using namespace Kleo; class WelcomeWidget::Private { public: Private(WelcomeWidget *qq): q(qq) { auto vLay = new QVBoxLayout(q); auto hLay = new QHBoxLayout; const QString welcome = i18nc("%1 is version", "Welcome to Kleopatra %1", +#ifdef Q_OS_WIN + Kleo::gpg4winVersion()); +#else QStringLiteral(KLEOPATRA_VERSION_STRING)); +#endif const QString introduction = i18n("Kleopatra is a front-end for the crypto software GnuPG."); const QString keyExplanation = i18n("For most actions you need either a public key (certificate) or your own private key."); const QString privateKeyExplanation = i18n("The private key is needed to decrypt or sign."); const QString publicKeyExplanation = i18n("The public key can be used by others to verify your identity or encrypt to you."); const QString wikiUrl = i18nc("More info about public key cryptography, please link to your local version of Wikipedia", "https://en.wikipedia.org/wiki/Public-key_cryptography"); const QString learnMore = i18nc("%1 is link a wiki article", "You can learn more about this on Wikipedia.", wikiUrl); auto label = new QLabel(templ.arg(welcome).arg(introduction).arg(keyExplanation).arg(privateKeyExplanation).arg(publicKeyExplanation).arg(learnMore)); label->setTextInteractionFlags(Qt::TextBrowserInteraction); label->setOpenExternalLinks(true); auto genKeyAction = new QAction(q); genKeyAction->setText(i18n("New Key Pair...")); genKeyAction->setIcon(QIcon::fromTheme(QStringLiteral("view-certificate-add"))); auto importAction = new QAction(q); importAction->setText(i18n("Import...")); importAction->setIcon(QIcon::fromTheme(QStringLiteral("view-certificate-import"))); connect(importAction, &QAction::triggered, q, [this] () { import(); }); connect(genKeyAction, &QAction::triggered, q, [this] () { generate(); }); mGenerateBtn = new QToolButton(); mGenerateBtn->setDefaultAction(genKeyAction); mGenerateBtn->setIconSize(QSize(64, 64)); mGenerateBtn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); mGenerateBtn->setToolTip(i18n("Create a new OpenPGP key pair") + QStringLiteral("
") + i18n("To create an S/MIME certificate request use \"New Key Pair\" from the 'File' Menu instead")); mImportBtn = new QToolButton(); mImportBtn->setDefaultAction(importAction); mImportBtn->setIconSize(QSize(64, 64)); mImportBtn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); mImportBtn->setToolTip(i18n("Import from a file.") + QStringLiteral("
") + i18n("To import from a public keyserver use \"Lookup on Server\" instead.")); auto btnLayout = new QHBoxLayout; btnLayout->addStretch(-1); btnLayout->addWidget(mGenerateBtn); btnLayout->addWidget(mImportBtn); btnLayout->addStretch(-1); vLay->addStretch(-1); vLay->addLayout(hLay); vLay->addLayout(btnLayout); vLay->addStretch(-1); hLay->addStretch(-1); hLay->addWidget(label); hLay->addStretch(-1); } void import() { mImportBtn->setEnabled(false); auto cmd = new Kleo::ImportCertificateFromFileCommand(); cmd->setParentWidget(q); QObject::connect(cmd, &Kleo::ImportCertificateFromFileCommand::finished, q, [this]() { mImportBtn->setEnabled(true); }); cmd->start(); } void generate() { mGenerateBtn->setEnabled(false); auto cmd = new Commands::NewCertificateCommand(); cmd->setProtocol(GpgME::OpenPGP); cmd->setParentWidget(q); QObject::connect(cmd, &Commands::NewCertificateCommand::finished, q, [this]() { mGenerateBtn->setEnabled(true); }); cmd->start(); } WelcomeWidget *const q; QToolButton *mGenerateBtn; QToolButton *mImportBtn; }; WelcomeWidget::WelcomeWidget (QWidget *parent): QWidget(parent), d(new Private(this)) { }