diff options
author | Vincent Sanders <vince@kyllikki.org> | 2016-04-25 23:11:55 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2016-04-25 23:11:55 +0100 |
commit | bf3ee089cb57765c48065423027eb4fffbe297f1 (patch) | |
tree | 2432a7705866c0773bc70ea3287f45534ec085e1 /framebuffer/gui.c | |
parent | 638e07f026d85de0c01630217570d4148aaaced5 (diff) | |
download | netsurf-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 'framebuffer/gui.c')
-rw-r--r-- | framebuffer/gui.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/framebuffer/gui.c b/framebuffer/gui.c index 11511fe0e..7e48b654e 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -108,6 +108,21 @@ static void die(const char *error) exit(1); } + +/** + * Warn the user of an event. + * + * \param[in] message 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 fb_warn_user(const char *warning, const char *detail) +{ + LOG("%s %s", warning, detail); + return NSERROR_OK; +} + /* queue a redraw operation, co-ordinates are relative to the window */ static void fb_queue_redraw(struct fbtk_widget_s *widget, int x0, int y0, int x1, int y1) @@ -1103,7 +1118,7 @@ fb_url_enter(void *pw, char *text) error = nsurl_create(text, &url); if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + fb_warn_user(messages_get_errorcode(error), 0); } else { browser_window_navigate(bw, url, NULL, BW_NAVIGATE_HISTORY, NULL, NULL, NULL); @@ -2056,6 +2071,7 @@ static struct gui_window_table framebuffer_window_table = { static struct gui_misc_table framebuffer_misc_table = { .schedule = framebuffer_schedule, + .warning = fb_warn_user, .quit = gui_quit, }; @@ -2156,7 +2172,7 @@ main(int argc, char** argv) nsurl_unref(url); } if (ret != NSERROR_OK) { - warn_user(messages_get_errorcode(ret), 0); + fb_warn_user(messages_get_errorcode(ret), 0); } else { framebuffer_run(); |