summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2017-07-24 13:03:13 +0200
committerAndre Heinecke <[email protected]>2017-07-24 13:03:13 +0200
commitbfb379a204dc36e86689685b2c56727c87128cdb (patch)
treeeec4d08ef0a4e43476a268ce75cde018e587d26e
parentf70991f394793549eb71b431df7cbbad3245fd06 (diff)
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.
-rw-r--r--src/kleopatra.rc1
-rw-r--r--src/mainwindow.cpp19
-rw-r--r--src/mainwindow.h1
3 files changed, 21 insertions, 0 deletions
diff --git a/src/kleopatra.rc b/src/kleopatra.rc
index aed0a47..aabe397 100644
--- a/src/kleopatra.rc
+++ b/src/kleopatra.rc
@@ -82,6 +82,7 @@
</Menu>
<Menu name="help">
<text>&amp;Help</text>
+ <Action name="help_show_compendium"/>
<Action name="help_check_updates"/>
</Menu>
</MenuBar>
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5697107..2c64731 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -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
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 096f48f..bfe4e6e 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -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__ */