Unverified Commit 998a19b3 authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Use new DocAction for g4w comp and new docs

This makes it more flexible to distribute additional
use case centric documentation with kleopatra. Previously
only the windows specific Gpg4win Compendium was handled
differently.
parent 66228e66
......@@ -32,7 +32,7 @@ option(DISABLE_KWATCHGNUPG "Don't build the kwatchgnupg tool [default=OFF]" OFF)
# Standalone build. Find / include everything necessary.
set(KF5_MIN_VERSION "5.89.0")
set(KMIME_VERSION "5.19.40")
set(LIBKLEO_VERSION "5.19.46")
set(LIBKLEO_VERSION "5.19.47")
set(QT_REQUIRED_VERSION "5.15.2")
set(GPGME_REQUIRED_VERSION "1.15.0")
set(BOOST_REQUIRED_VERSION "1.58")
......
......@@ -88,7 +88,10 @@
</Menu>
<Menu name="help">
<text>&amp;Help</text>
<Action name="help_show_compendium"/>
<Action name="help_doc_quickguide"/>
<Action name="help_doc_compendium"/>
<Action name="help_doc_symenc"/>
<Separator/>
<Action name="help_check_updates"/>
</Menu>
</MenuBar>
......
......@@ -75,6 +75,7 @@
#include <Libkleo/Stl_Util>
#include <Libkleo/Classify>
#include <Libkleo/KeyCache>
#include <Libkleo/DocAction>
#include <vector>
#include <KSharedConfig>
......@@ -227,19 +228,6 @@ public:
UpdateNotification::forceUpdateCheck(q);
}
void openCompendium()
{
QDir datadir(QCoreApplication::applicationDirPath() + QStringLiteral("/../share/gpg4win"));
const auto path = datadir.filePath(i18nc("The Gpg4win compendium is only available"
"at this point (24.7.2017) in german and english."
"Please check with Gpg4win before translating this filename.",
"gpg4win-compendium-en.pdf"));
qCDebug(KLEOPATRA_LOG) << "Opening Compendium at:" << path;
// The compendium is always installed. So this should work. Otherwise
// we have debug output.
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
}
void slotConfigCommitted();
void slotContextMenuRequested(QAbstractItemView *, const QPoint &p)
{
......@@ -435,10 +423,6 @@ void MainWindow::Private::setupActions()
"help_check_updates", i18n("Check for updates"), QString(),
"gpg4win-compact", q, SLOT(forceUpdateCheck()), QString(), false, true
},
{
"help_show_compendium", i18n("Gpg4win Compendium"), QString(),
"gpg4win-compact", q, SLOT(openCompendium()), QString(), false, true
},
#endif
{
"view_certificate_overview", i18nc("@action show certificate overview", "Certificates"),
......@@ -504,6 +488,34 @@ void MainWindow::Private::setupActions()
clipboadMenu->clipboardMenu()->setPopupMode(QToolButton::InstantPopup);
coll->addAction(QStringLiteral("clipboard_menu"), clipboadMenu->clipboardMenu());
/* Add additional help actions for documentation */
const auto compendium = new DocAction(QIcon::fromTheme(QStringLiteral("gpg4win-compact")), i18n("Gpg4win Compendium"),
i18nc("The Gpg4win compendium is only available"
"at this point (24.7.2017) in german and english."
"Please check with Gpg4win before translating this filename.",
"gpg4win-compendium-en.pdf"),
QStringLiteral("../share/gpg4win"));
coll->addAction(QStringLiteral("help_doc_compendium"), compendium);
/* Documentation centered around the german approved VS-NfD mode for official
* RESTRICTED communication. This is only available in some distributions with
* the focus on official communications. */
const auto symguide = new DocAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("Password-based encryption"),
i18nc("Only available in German and English. Leave to English for other languages.",
"handout_symmetric_encryption_gnupg_en.pdf"),
QStringLiteral("../share/doc/gnupg-vsd"));
coll->addAction(QStringLiteral("help_doc_symenc"), symguide);
const auto quickguide = new DocAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("Quickguide"),
i18nc("Only available in German and English. Leave to English for other languages.",
"handout_sign_encrypt_gnupg_en.pdf"),
QStringLiteral("../share/doc/gnupg-vsd"));
coll->addAction(QStringLiteral("help_doc_quickguide"), quickguide);
const auto man_gpg = new DocAction(QIcon::fromTheme(QStringLiteral("help-hint")), i18n("GnuPG Manual"),
QStringLiteral("gnupg.pdf"), QStringLiteral("../share/doc/gnupg"));
coll->addAction(QStringLiteral("help_doc_gnupg"), man_gpg);
q->setStandardToolBarMenuEnabled(true);
controller.createActions(coll);
......
......@@ -53,7 +53,6 @@ private:
Q_PRIVATE_SLOT(d, void showPadView())
Q_PRIVATE_SLOT(d, void showSmartcardView())
Q_PRIVATE_SLOT(d, void forceUpdateCheck())
Q_PRIVATE_SLOT(d, void openCompendium())
Q_PRIVATE_SLOT(d, void listSmartcardReaders())
};
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