mirror of https://github.com/MidnightCommander/mc
Fix of DLG_ACTION handling in viewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
87f3030c7a
commit
9ae7a28bf8
|
@ -334,7 +334,7 @@ ExtendedKeyMap = ctrl-x
|
|||
[viewer]
|
||||
Help = f1
|
||||
WrapMode = f2
|
||||
Quit = f3; f10; q; esc; ctrl-g
|
||||
Quit = f3; f10; q; esc
|
||||
HexMode = f4
|
||||
Goto = f5
|
||||
Search = f7; question; slash
|
||||
|
@ -366,7 +366,7 @@ Ruler = alt-r
|
|||
[viewer:hex]
|
||||
Help = f1
|
||||
HexEditMode = f2
|
||||
Quit = f3; f10; q; esc; ctrl-g
|
||||
Quit = f3; f10; q; esc
|
||||
HexMode = f4
|
||||
Goto = f5
|
||||
Save = f6
|
||||
|
|
|
@ -337,7 +337,7 @@ EditNew = k
|
|||
[viewer]
|
||||
Help = f1
|
||||
WrapMode = f2
|
||||
Quit = f3; f10; q; esc; ctrl-g
|
||||
Quit = f3; f10; q; esc
|
||||
HexMode = f4
|
||||
Goto = f5
|
||||
Search = f7; question; slash
|
||||
|
@ -369,7 +369,7 @@ Ruler = alt-r
|
|||
[viewer:hex]
|
||||
Help = f1
|
||||
HexEditMode = f2
|
||||
Quit = f3; f10; q; esc; ctrl-g
|
||||
Quit = f3; f10; q; esc
|
||||
HexMode = f4
|
||||
Goto = f5
|
||||
Save = f6
|
||||
|
|
|
@ -426,7 +426,7 @@ static const global_keymap_ini_t default_editor_x_keymap[] = {
|
|||
static const global_keymap_ini_t default_viewer_keymap[] = {
|
||||
{"Help", "f1"},
|
||||
{"WrapMode", "f2"},
|
||||
{"Quit", "f3; f10; q; esc; ctrl-g"},
|
||||
{"Quit", "f3; f10; q; esc"},
|
||||
{"HexMode", "f4"},
|
||||
{"Goto", "f5"},
|
||||
{"Search", "f7; question; slash"},
|
||||
|
@ -463,7 +463,7 @@ static const global_keymap_ini_t default_viewer_keymap[] = {
|
|||
static const global_keymap_ini_t default_viewer_hex_keymap[] = {
|
||||
{"Help", "f1"},
|
||||
{"HexEditMode", "f2"},
|
||||
{"Quit", "f3; f10; q; esc; ctrl-g"},
|
||||
{"Quit", "f3; f10; q; esc"},
|
||||
{"HexMode", "f4"},
|
||||
{"Goto", "f5"},
|
||||
{"Save", "f6"},
|
||||
|
|
|
@ -382,6 +382,9 @@ mcview_execute_cmd (mcview_t * view, unsigned long command)
|
|||
if (!mcview_is_in_panel (view))
|
||||
dlg_stop (view->widget.owner);
|
||||
break;
|
||||
case CK_Cancel:
|
||||
/* don't close viewer due to SIGINT */
|
||||
break;
|
||||
default:
|
||||
res = MSG_NOT_HANDLED;
|
||||
}
|
||||
|
@ -522,9 +525,19 @@ mcview_dialog_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm,
|
|||
return MSG_HANDLED;
|
||||
|
||||
case DLG_ACTION:
|
||||
/* command from buttonbar */
|
||||
view = (mcview_t *) data;
|
||||
return send_message ((Widget *) view, WIDGET_COMMAND, parm);
|
||||
/* shortcut */
|
||||
if (sender == NULL)
|
||||
return mcview_execute_cmd (NULL, parm);
|
||||
/* message from buttonbar */
|
||||
if (sender == (Widget *) find_buttonbar (h))
|
||||
{
|
||||
if (data != NULL)
|
||||
return send_message ((Widget *) data, WIDGET_COMMAND, parm);
|
||||
|
||||
view = (mcview_t *) find_widget_type (h, mcview_callback);
|
||||
return mcview_execute_cmd (view, parm);
|
||||
}
|
||||
return MSG_NOT_HANDLED;
|
||||
|
||||
case DLG_VALIDATE:
|
||||
view = (mcview_t *) find_widget_type (h, mcview_callback);
|
||||
|
|
Loading…
Reference in New Issue