static void mail_to_uri_cb (TextView *textview,
guint action,
void *data);
+static void copy_mail_to_uri_cb (TextView *textview,
+ guint action,
+ void *data);
static GtkItemFactoryEntry textview_link_popup_entries[] =
{
{
{N_("/_Add to addressbook"), NULL, add_uri_to_addrbook_cb, 0, NULL},
{N_("/_Email"), NULL, mail_to_uri_cb, 0, NULL},
+ {N_("/_Copy"), NULL, copy_mail_to_uri_cb, 0, NULL},
};
&& (((bp_ + 1) < ep_) && isalnum(*(bp_ + 1)))) {
/* hyphens are allowed, but only in
between alnums */
- } else if (!ispunct(*bp_)) {
+ } else if (!strchr(",;:=?./+<>!&", *bp_)) {
/* but anything not being a punctiation
is ok */
} else {
compose_new(account, uri->uri + 7, NULL);
}
+static void copy_mail_to_uri_cb (TextView *textview, guint action, void *data)
+{
+ RemoteURI *uri = g_object_get_data(G_OBJECT(textview->mail_popup_menu),
+ "menu_button");
+ if (uri == NULL)
+ return;
+
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), uri->uri + 7, -1);
+ g_object_set_data(G_OBJECT(textview->mail_popup_menu), "menu_button",
+ NULL);
+}