aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@src.gnome.org>2007-09-16 20:10:34 +0800
committerCosimo Cecchi <cosimoc@src.gnome.org>2007-09-16 20:10:34 +0800
commit0c63d5983df779d4f4001a711978e072ee715840 (patch)
treeb43f6e4f832d383cce07212c84396720d8788080
parent84ded07f18c026bd3e2c0e1f45535b9f6baced2e (diff)
downloadgsoc2013-epiphany-0c63d5983df779d4f4001a711978e072ee715840.tar
gsoc2013-epiphany-0c63d5983df779d4f4001a711978e072ee715840.tar.gz
gsoc2013-epiphany-0c63d5983df779d4f4001a711978e072ee715840.tar.bz2
gsoc2013-epiphany-0c63d5983df779d4f4001a711978e072ee715840.tar.lz
gsoc2013-epiphany-0c63d5983df779d4f4001a711978e072ee715840.tar.xz
gsoc2013-epiphany-0c63d5983df779d4f4001a711978e072ee715840.tar.zst
gsoc2013-epiphany-0c63d5983df779d4f4001a711978e072ee715840.zip
Use friendly display for mailto: links; shows a nice text in status bar
when hovering a mailto: link. Initial patch by Diego Escalante Urrelo, fixes bug #339161. svn path=/trunk/; revision=7452
-rw-r--r--src/ephy-tab.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 4e31dd573..8b3a32be1 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -1039,10 +1039,49 @@ ephy_tab_get_load_status (EphyTab *tab)
static void
ephy_tab_set_link_message (EphyTab *tab, char *message)
{
+ char *status_message;
+ char **splitted_message;
g_return_if_fail (EPHY_IS_TAB (tab));
g_free (tab->priv->link_message);
- tab->priv->link_message = ephy_string_blank_chr (message);
+ status_message = ephy_string_blank_chr (message);
+
+ if (status_message && g_str_has_prefix (status_message, "mailto:"))
+ {
+ int i = 1;
+ char *p;
+ GString *tmp;
+
+ /* We first want to eliminate all the things after "?", like
+ * cc, subject and alike.
+ */
+
+ p = strchr (status_message, '?');
+ if (p != NULL) *p = '\0';
+
+ /* Then we also want to check if there is more than an email address
+ * in the mailto: list.
+ */
+
+ splitted_message = g_strsplit_set (status_message, ";", -1);
+ tmp = g_string_new (g_strdup_printf (_("Send an email message to ā€œ%sā€"),
+ (splitted_message[0] + 7)));
+
+ while (splitted_message [i] != NULL)
+ {
+ g_string_append_printf (tmp, ", ā€œ%sā€", splitted_message[i]);
+ i++;
+ }
+
+ tab->priv->link_message = g_string_free (tmp, FALSE);
+
+ g_free (status_message);
+ g_strfreev (splitted_message);
+ }
+ else
+ {
+ tab->priv->link_message = status_message;
+ }
g_object_notify (G_OBJECT (tab), "message");
}