From 510f3f9be3675a59670e6f50a5f857da9aba86f1 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 3 Nov 2007 01:23:19 +0000 Subject: Display "Javascript scriptlet" string as tooltip for bookmark action instead of the whole javascript code when bookmarking a scriptlet. Fix bug #492695. svn path=/trunk/; revision=7616 --- src/bookmarks/ephy-bookmark-action.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'src/bookmarks') diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index aa6de32e0..4b6e1f038 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -434,23 +434,29 @@ query_tooltip_cb (GtkWidget *proxy, title = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_TITLE); location = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_LOCATION); - if (strstr (location, "%s") != NULL) + if (g_str_has_prefix (location, "javascript:")) { - GnomeVFSURI *uri = gnome_vfs_uri_new (location); - if (uri != NULL) - { - text = g_markup_printf_escaped ("%s\n%s://%s", - title, - gnome_vfs_uri_get_scheme (uri), - gnome_vfs_uri_get_host_name (uri)); - gnome_vfs_uri_unref (uri); - } + text = g_strdup (_("Javascript scriptlet")); } - if (text == NULL) + else { - text = g_markup_printf_escaped ("%s\n%s", title, location); + if (strstr (location, "%s") != NULL) + { + GnomeVFSURI *uri = gnome_vfs_uri_new (location); + if (uri != NULL) + { + text = g_markup_printf_escaped ("%s\n%s://%s", + title, + gnome_vfs_uri_get_scheme (uri), + gnome_vfs_uri_get_host_name (uri)); + gnome_vfs_uri_unref (uri); + } + } + if (text == NULL) + { + text = g_markup_printf_escaped ("%s\n%s", title, location); + } } - gtk_tooltip_set_markup (tooltip, text); g_free (text); -- cgit v1.2.3