summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-04-25 22:11:55 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-04-25 22:11:55 (GMT)
commitbf3ee089cb57765c48065423027eb4fffbe297f1 (patch)
tree2432a7705866c0773bc70ea3287f45534ec085e1 /gtk
parent638e07f026d85de0c01630217570d4148aaaced5 (diff)
downloadnetsurf-bf3ee089cb57765c48065423027eb4fffbe297f1.tar.gz
netsurf-bf3ee089cb57765c48065423027eb4fffbe297f1.tar.bz2
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.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gui.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gui.c b/gtk/gui.c
index 5578f63..c17c128 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,