From bf3ee089cb57765c48065423027eb4fffbe297f1 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 25 Apr 2016 23:11:55 +0100 Subject: use the miscellaneous table warning entry change all the frontends to provide the warning callback in the miscelaneous table instead of using the warn_user function. Changing all the warn_user callsites still requires completion. --- gtk/gui.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gtk') diff --git a/gtk/gui.c b/gtk/gui.c index 5578f63cb..c17c128e2 100644 --- a/gtk/gui.c +++ b/gtk/gui.c @@ -480,7 +480,15 @@ static nserror gui_launch_url(struct nsurl *url) return NSERROR_NO_FETCH_HANDLER; } -void warn_user(const char *warning, const char *detail) +/** + * Warn the user of an event. + * + * \param[in] warning A warning looked up in the message translation table + * \param[in] detail Additional text to be displayed or NULL. + * \return NSERROR_OK on success or error code if there was a + * faliure displaying the message to the user. + */ +static nserror nsgtk_warning(const char *warning, const char *detail) { char buf[300]; /* 300 is the size the RISC OS GUI uses */ static GtkWindow *nsgtk_warning_window; @@ -500,6 +508,8 @@ void warn_user(const char *warning, const char *detail) gtk_label_set_text(WarningLabel, buf); gtk_widget_show_all(GTK_WIDGET(nsgtk_warning_window)); + + return NSERROR_OK; } @@ -1013,6 +1023,7 @@ static nserror nsgtk_option_init(int *pargc, char** argv) static struct gui_misc_table nsgtk_misc_table = { .schedule = nsgtk_schedule, + .warning = nsgtk_warning, .quit = gui_quit, .launch_url = gui_launch_url, -- cgit v1.2.3