mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Ticket #2111: allow pause in copy/move/delete file operation.
Initial step: if button callback retuns zero, don't close the dialog after button press. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
2f74680628
commit
161a5af516
@ -59,7 +59,6 @@ button_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *
|
||||
{
|
||||
WButton *b = BUTTON (w);
|
||||
WDialog *h = w->owner;
|
||||
int stop = 0;
|
||||
int off = 0;
|
||||
|
||||
switch (msg)
|
||||
@ -94,13 +93,10 @@ button_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *
|
||||
if (parm != ' ' && parm != '\n')
|
||||
return MSG_NOT_HANDLED;
|
||||
|
||||
if (b->callback != NULL)
|
||||
stop = b->callback (b, b->action);
|
||||
if (b->callback == NULL || stop != 0)
|
||||
{
|
||||
h->ret_value = b->action;
|
||||
h->ret_value = b->action;
|
||||
if (b->callback == NULL || b->callback (b, b->action) != 0)
|
||||
dlg_stop (h);
|
||||
}
|
||||
|
||||
return MSG_HANDLED;
|
||||
|
||||
case MSG_CURSOR:
|
||||
|
@ -13,6 +13,7 @@
|
||||
struct WButton;
|
||||
|
||||
/* button callback */
|
||||
/* return 0 to continue work with dialog, non-zero to close */
|
||||
typedef int (*bcback_fn) (struct WButton * button, int action);
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user