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:
Andrew Borodin 2024-11-17 14:53:10 +03:00
parent 4f47b16ba8
commit 71199a290f

View File

@ -142,23 +142,6 @@ do_create_message (int flags, const char *title, const char *text)
return d; 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 */ /** Show message box from background */
@ -168,7 +151,7 @@ bg_message (int dummy, int *flags, char *title, const char *text)
{ {
(void) dummy; (void) dummy;
title = g_strconcat (_("Background process:"), " ", title, (char *) NULL); title = g_strconcat (_("Background process:"), " ", title, (char *) NULL);
fg_message (*flags, title, text); query_dialog (title, text, *flags, 1, _("&OK"));
g_free (title); g_free (title);
} }
#endif /* ENABLE_BACKGROUND */ #endif /* ENABLE_BACKGROUND */
@ -431,6 +414,7 @@ message (int flags, const char *title, const char *text, ...)
void *p; void *p;
void (*f) (int, int *, char *, const char *); void (*f) (int, int *, char *, const char *);
} func; } func;
func.f = bg_message; func.f = bg_message;
wtools_parent_call (func.p, NULL, 3, sizeof (flags), &flags, strlen (title), title, 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 else
#endif /* ENABLE_BACKGROUND */ #endif /* ENABLE_BACKGROUND */
fg_message (flags, title, p); query_dialog (title, p, flags, 1, _("&OK"));
g_free (p); g_free (p);
} }