From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/wlib/gtklib/help.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/wlib/gtklib/help.c') 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 #include +#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); } -- cgit v1.2.3