aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-action.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@src.gnome.org>2007-11-03 09:23:19 +0800
committerCosimo Cecchi <cosimoc@src.gnome.org>2007-11-03 09:23:19 +0800
commit510f3f9be3675a59670e6f50a5f857da9aba86f1 (patch)
treee5d3f28ae32b12e915f61caf8528a836c75c41bf /src/bookmarks/ephy-bookmark-action.c
parent12e20fe014010a689599c528624774966428c1f3 (diff)
downloadgsoc2013-epiphany-510f3f9be3675a59670e6f50a5f857da9aba86f1.tar.gz
gsoc2013-epiphany-510f3f9be3675a59670e6f50a5f857da9aba86f1.tar.zst
gsoc2013-epiphany-510f3f9be3675a59670e6f50a5f857da9aba86f1.zip
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
Diffstat (limited to 'src/bookmarks/ephy-bookmark-action.c')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c32
1 files changed, 19 insertions, 13 deletions
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);