diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-09-21 21:55:05 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-09-22 00:36:13 -0400 |
commit | b0713fb3bb41e6daf07c80d88098fee1461c0658 (patch) | |
tree | 5c05072b64af8e1db4fe42dc2efd9f4e31e01a69 /gtk/gtklinkbutton.c | |
parent | 0e1bba6ef5817730dbe1cd53c9ba8a5ea6972053 (diff) | |
download | gtk+-b0713fb3bb41e6daf07c80d88098fee1461c0658.tar.gz |
Remove url hooks from GtkAboutDialog and GtkLinkButton
With gtk_show_uri, global configurability of link activation has
moved to GIO/gvfs. For local overrides, GtkLinkButton has the ::clicked
signal, and GtkAboutDialog gets an ::activate-link signal.
Bug 339745
Diffstat (limited to 'gtk/gtklinkbutton.c')
-rw-r--r-- | gtk/gtklinkbutton.c | 71 |
1 files changed, 13 insertions, 58 deletions
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c index 0211f15c44..85de592c0f 100644 --- a/gtk/gtklinkbutton.c +++ b/gtk/gtklinkbutton.c @@ -105,10 +105,6 @@ static const GtkTargetEntry link_drop_types[] = { static const GdkColor default_link_color = { 0, 0, 0, 0xeeee }; static const GdkColor default_visited_link_color = { 0, 0x5555, 0x1a1a, 0x8b8b }; -static GtkLinkButtonUriFunc uri_func = NULL; -static gpointer uri_func_data = NULL; -static GDestroyNotify uri_func_destroy = NULL; - G_DEFINE_TYPE (GtkLinkButton, gtk_link_button, GTK_TYPE_BUTTON) static void @@ -476,28 +472,22 @@ static void gtk_link_button_clicked (GtkButton *button) { GtkLinkButton *link_button = GTK_LINK_BUTTON (button); + GdkScreen *screen; + GError *error; - if (uri_func) - (* uri_func) (link_button, link_button->priv->uri, uri_func_data); + if (gtk_widget_has_screen (GTK_WIDGET (button))) + screen = gtk_widget_get_screen (GTK_WIDGET (button)); else - { - GdkScreen *screen; - GError *error; - - if (gtk_widget_has_screen (GTK_WIDGET (button))) - screen = gtk_widget_get_screen (GTK_WIDGET (button)); - else - screen = NULL; + screen = NULL; - error = NULL; - gtk_show_uri (screen, link_button->priv->uri, GDK_CURRENT_TIME, &error); - if (error) - { - g_warning ("Unable to show '%s': %s", - link_button->priv->uri, - error->message); - g_error_free (error); - } + error = NULL; + gtk_show_uri (screen, link_button->priv->uri, GDK_CURRENT_TIME, &error); + if (error) + { + g_warning ("Unable to show '%s': %s", + link_button->priv->uri, + error->message); + g_error_free (error); } gtk_link_button_set_visited (link_button, TRUE); @@ -706,41 +696,6 @@ gtk_link_button_get_uri (GtkLinkButton *link_button) } /** - * gtk_link_button_set_uri_hook: - * @func: (allow-none): a function called each time a #GtkLinkButton is clicked, or %NULL - * @data: (allow-none): user data to be passed to @func, or %NULL - * @destroy: (allow-none): a #GDestroyNotify that gets called when @data is no longer needed, or %NULL - * - * Sets @func as the function that should be invoked every time a user clicks - * a #GtkLinkButton. This function is called before every callback registered - * for the "clicked" signal. - * - * If no uri hook has been set, GTK+ defaults to calling gtk_show_uri(). - * - * Return value: the previously set hook function. - * - * Since: 2.10 - */ -GtkLinkButtonUriFunc -gtk_link_button_set_uri_hook (GtkLinkButtonUriFunc func, - gpointer data, - GDestroyNotify destroy) -{ - GtkLinkButtonUriFunc old_uri_func; - - if (uri_func_destroy) - (* uri_func_destroy) (uri_func_data); - - old_uri_func = uri_func; - - uri_func = func; - uri_func_data = data; - uri_func_destroy = destroy; - - return old_uri_func; -} - -/** * gtk_link_button_set_visited: * @link_button: a #GtkLinkButton * @visited: the new 'visited' state |