mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 01:54:24 +03:00
Make message box with button.
* (bg_message): use query_dialog() instead of fg_message(). * (message): likewise. * (fg_message): isn't used anymore. Remove. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
4f47b16ba8
commit
71199a290f
@ -142,23 +142,6 @@ do_create_message (int flags, const char *title, const char *text)
|
||||
return d;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Show message dialog. Dismiss it when any key is pressed.
|
||||
* Not safe to call from background.
|
||||
*/
|
||||
|
||||
static void
|
||||
fg_message (int flags, const char *title, const char *text)
|
||||
{
|
||||
WDialog *d;
|
||||
|
||||
d = do_create_message (flags, title, text);
|
||||
tty_getch ();
|
||||
dlg_run_done (d);
|
||||
widget_destroy (WIDGET (d));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/** Show message box from background */
|
||||
|
||||
@ -168,7 +151,7 @@ bg_message (int dummy, int *flags, char *title, const char *text)
|
||||
{
|
||||
(void) dummy;
|
||||
title = g_strconcat (_("Background process:"), " ", title, (char *) NULL);
|
||||
fg_message (*flags, title, text);
|
||||
query_dialog (title, text, *flags, 1, _("&OK"));
|
||||
g_free (title);
|
||||
}
|
||||
#endif /* ENABLE_BACKGROUND */
|
||||
@ -431,6 +414,7 @@ message (int flags, const char *title, const char *text, ...)
|
||||
void *p;
|
||||
void (*f) (int, int *, char *, const char *);
|
||||
} func;
|
||||
|
||||
func.f = bg_message;
|
||||
|
||||
wtools_parent_call (func.p, NULL, 3, sizeof (flags), &flags, strlen (title), title,
|
||||
@ -438,7 +422,7 @@ message (int flags, const char *title, const char *text, ...)
|
||||
}
|
||||
else
|
||||
#endif /* ENABLE_BACKGROUND */
|
||||
fg_message (flags, title, p);
|
||||
query_dialog (title, p, flags, 1, _("&OK"));
|
||||
|
||||
g_free (p);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user