Verified Commit bfb379a2 authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Add link to Gpg4win doc in help menu for Windows

The compendium is basically a book that explains crypto with
Kleopatra on Windows. Making it accessible from Kleopatra
helps users to find it.

This change only affects windows as the action is ifdefed.
parent f70991f3
......@@ -82,6 +82,7 @@
</Menu>
<Menu name="help">
<text>&amp;Help</text>
<Action name="help_show_compendium"/>
<Action name="help_check_updates"/>
</Menu>
</MenuBar>
......
......@@ -81,7 +81,9 @@
#include <QProcess>
#include <QVBoxLayout>
#include <QMimeData>
#include <QDesktopServices>
#include <QDesktopWidget>
#include <QDir>
#include <QStatusBar>
#include <QLabel>
......@@ -222,6 +224,19 @@ public:
UpdateNotification::checkUpdate(q, true);
}
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)
{
......@@ -385,6 +400,10 @@ 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
// most have been MOVED TO keylistcontroller.cpp
#if 0
......
......@@ -74,6 +74,7 @@ private:
Q_PRIVATE_SLOT(d, void slotFocusQuickSearch())
Q_PRIVATE_SLOT(d, void toggleSmartcardView())
Q_PRIVATE_SLOT(d, void forceUpdateCheck())
Q_PRIVATE_SLOT(d, void openCompendium())
};
#endif /* __KLEOPATRA_MAINWINDOW_DESKTOP_H__ */
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