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:
Andrew Borodin 2012-11-22 13:55:38 +04:00
parent 2f74680628
commit 161a5af516
2 changed files with 4 additions and 7 deletions

View File

@ -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;
if (b->callback == NULL || b->callback (b, b->action) != 0)
dlg_stop (h);
}
return MSG_HANDLED;
case MSG_CURSOR:

View File

@ -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 ***************************************************************************************/