From c48042e0da0d3ced1abf7311aff1adb0c2a58834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revel?= Date: Sat, 7 Apr 2012 12:56:02 +0000 Subject: [PATCH] Implement gui_launch_url() for GTK. svn path=/trunk/netsurf/; revision=13820 --- gtk/gui.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gtk/gui.c b/gtk/gui.c index b403297bf..200135cf5 100644 --- a/gtk/gui.c +++ b/gtk/gui.c @@ -659,6 +659,17 @@ void gui_window_save_link(struct gui_window *g, const char *url, void gui_launch_url(const char *url) { + gboolean ok; + GError *error = NULL; + + ok = gtk_show_uri(NULL, url, GDK_CURRENT_TIME, &error); + if (ok == TRUE) + return; + + if (error) { + warn_user(messages_get("URIOpenError"), error->message); + g_error_free(error); + } } void warn_user(const char *warning, const char *detail)