Fix of DLG_ACTION handling in interactive help.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2011-03-29 10:34:24 +04:00
parent 3e35200517
commit 4519c85134
4 changed files with 17 additions and 5 deletions

View File

@ -193,7 +193,7 @@ Delete = f8; delete
Help = f1
Index = f2; c
Back = f3; left; l
Quit = f10; esc; ctrl-g
Quit = f10; esc
Up = up; ctrl-p
Down = down; ctrl-n
PageDown = f; space; pgdn; ctrl-v

View File

@ -119,7 +119,7 @@ SortByMTime =
[dialog]
Ok = enter
Cancel = f10; esc; ctrl-g
Cancel = f10; esc
Up = left; up
#Left = left; up
Down = right; down

View File

@ -905,6 +905,9 @@ help_execute_cmd (unsigned long command)
case CK_Quit:
dlg_stop (whelp);
break;
case CK_Cancel:
/* don't close help due to SIGINT */
break;
default:
ret = MSG_NOT_HANDLED;
}
@ -952,8 +955,17 @@ help_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *dat
return help_handle_key (h, parm);
case DLG_ACTION:
/* command from buttonbar */
return help_execute_cmd (parm);
/* shortcut */
if (sender == NULL)
return help_execute_cmd (parm);
/* message from buttonbar */
if (sender == (Widget *) find_buttonbar (h))
{
if (data != NULL)
return send_message ((Widget *) data, WIDGET_COMMAND, parm);
return help_execute_cmd (parm);
}
return MSG_NOT_HANDLED;
default:
return default_dlg_callback (h, sender, msg, parm, data);

View File

@ -297,7 +297,7 @@ static const global_keymap_ini_t default_help_keymap[] = {
{"Help", "f1"},
{"Index", "f2; c"},
{"Back", "f3; left; l"},
{"Quit", "f10; esc; ctrl-g"},
{"Quit", "f10; esc"},
{"Up", "up; ctrl-p"},
{"Down", "down; ctrl-n"},
{"PageDown", "f; space; pgdn; ctrl-v"},