summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/help.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-22 14:05:41 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-22 14:05:41 +0200
commitb55285a77da0e0b829e4ce8d7e09debaabc68e15 (patch)
treef622559ef65bbdd3e1c5bdb06098a8f89eec0563 /app/wlib/gtklib/help.c
parentd3897ce090dbeb220ed2c782f095597e417cf3cc (diff)
parentd1ae75703e1ed81d65ea16946dcdb77e7a13adc9 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'app/wlib/gtklib/help.c')
-rw-r--r--app/wlib/gtklib/help.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/wlib/gtklib/help.c b/app/wlib/gtklib/help.c
index dbb69f6..8f2766d 100644
--- a/app/wlib/gtklib/help.c
+++ b/app/wlib/gtklib/help.c
@@ -28,9 +28,12 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#include "misc.h"
+
#include "gtkint.h"
#include "i18n.h"
+
/**
* Handle the commands issued from the Help drop-down. Currently, we only have a table
* of contents, but search etc. might be added in the future.
@@ -44,11 +47,19 @@ DoHelpMenu(void *data)
{
int func = (intptr_t)data;
+ const char * topic;
+
switch (func) {
case 1:
wHelp("index");
break;
+ case 3:
+ topic = GetCurCommandName();
+ if (topic && topic[0])
+ wHelp(topic);
+ break;
+
default:
break;
}
@@ -56,6 +67,10 @@ DoHelpMenu(void *data)
return;
}
+void wDoAccelHelp(wAccelKey_e key, void * context) {
+ DoHelpMenu(context);
+}
+
/**
* Add the entries for Help to the drop-down.
*
@@ -66,4 +81,5 @@ DoHelpMenu(void *data)
void wMenuAddHelp(wMenu_p m)
{
wMenuPushCreate(m, NULL, _("&Contents"), 0, DoHelpMenu, (void*)1);
+ wMenuPushCreate(m, NULL, _("Co&mmand Context help"), 0, DoHelpMenu, (void*)3);
}