From ef0d973b72494eaf3443d4dcb7060774857f333c Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Tue, 10 Jan 2012 06:51:26 +0000 Subject: [PATCH] Set URL hook for about about dialog Links in text areas still don't work. I have no idea why GTK thinks it needs so many different ways to open a URL. --- src/Makefile.am | 3 ++- src/main.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index ec7fb21..6ac5415 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,7 +46,8 @@ CLEANFILES = gmon.out valgrind.out MAINTAINERCLEANFILES = Makefile.in test: all - .libs/aweather -o -d 7 -s KOUN -t '2011-02-01 10:01Z' + .libs/aweather -o -d 5 +#.libs/aweather -o -d 7 -s KOUN -t '2011-02-01 10:01Z' #.libs/aweather -o -d 7 -s KLSX -t '2010-12-31 17:56Z' #.libs/aweather -o -d 7 -s KDGX -t '2010-12-31 23:10Z' #.libs/aweather -o -d 7 -s KDGX -t '1999-05-03 23:51Z' diff --git a/src/main.c b/src/main.c index c3d0469..f544bb2 100644 --- a/src/main.c +++ b/src/main.c @@ -51,7 +51,7 @@ static void log_func(const gchar *log_domain, GLogLevelFlags log_level, } } -static void xdg_open(GtkLinkButton *button, const gchar *link, gpointer user_data) +static void xdg_open(GtkWidget *widget, const gchar *link, gpointer user_data) { gchar *argv[] = {"xdg-open", (gchar*)link, NULL}; g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); @@ -153,7 +153,9 @@ int main(int argc, char *argv[]) } /* Use external handler for link buttons */ - gtk_link_button_set_uri_hook(xdg_open, NULL, NULL); + gtk_link_button_set_uri_hook((GtkLinkButtonUriFunc)xdg_open, NULL, NULL); + gtk_about_dialog_set_url_hook((GtkAboutDialogActivateLinkFunc)xdg_open, NULL, NULL); + gtk_about_dialog_set_email_hook((GtkAboutDialogActivateLinkFunc)xdg_open, NULL, NULL); /* Setup debug level for aweather_gui_new */ g_log_set_handler(NULL, G_LOG_LEVEL_MASK, log_func, NULL); -- 2.43.2