diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-01-15 01:20:30 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-15 08:52:18 -0800 |
commit | 2fb7aa1172930cbedb5ea9b24c6f2c98f40a7ff1 (patch) | |
tree | 32950f72849bac756162d076549cb7635947ec61 /gtk-gui.c | |
parent | 678fffdcf497832a366b8230c30fc83794391ece (diff) | |
download | subsurface-2fb7aa1172930cbedb5ea9b24c6f2c98f40a7ff1.tar.gz |
Attempt to override the URI handler in the about dialog
The previous patch in this series adds the function
subsurface_launch_for_uri(), which has to be called from the about
dialog instead of the default function for the URI calls to work
on Windows - i.e. opening links from the dialog.
gtk_about_dialog_set_url_hook() is a deprecated method, but seems
to be the only reasonable way to make the override between GTK 2.20 -
2.24 possible. The "activate-link" signal is recomended instead,
but is not portable for GTK bellow 2.24.
An alternative would be to somehow hack into the GtkAboutDialog
and override the callback for each clickable link.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r-- | gtk-gui.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -957,6 +957,11 @@ static void renumber_dialog(GtkWidget *w, gpointer data) gtk_widget_destroy(dialog); } +static void about_dialog_link_cb(GtkAboutDialog *dialog, const gchar *link, gpointer data) +{ + subsurface_launch_for_uri(link); +} + static void about_dialog(GtkWidget *w, gpointer data) { const char *logo_property = NULL; @@ -984,6 +989,7 @@ static void about_dialog(GtkWidget *w, gpointer data) /* Must be last: */ logo_property, logo, NULL); + gtk_about_dialog_set_url_hook(about_dialog_link_cb, NULL, NULL); } static void view_list(GtkWidget *w, gpointer data) |