Mercurial > pidgin
changeset 7140:48cc5d5d5a6c
[gaim-migrate @ 7707]
The right-click menu for e-mail links now presents a "Copy E-Mail Address"
item.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 04 Oct 2003 19:34:53 +0000 |
parents | ebf3b709a77a |
children | af8ac078d4c2 |
files | ChangeLog src/gtkimhtml.c |
diffstat | 2 files changed, 37 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat Oct 04 15:48:40 2003 +0000 +++ b/ChangeLog Sat Oct 04 19:34:53 2003 +0000 @@ -11,6 +11,8 @@ * Multiple copies of gaim installed at different locations no longer attempt to load the same, possibly incompatible plugins (Robert McQueen) + * The right-click menu for e-mail links now presents a "Copy E-Mail + Address" item. * Zephyr formatting fixes (Arun A Tharuvai) * Zephyr can connect to chats (Karsten Huneycutt) * Get User Info in MSN and Yahoo now return an error indicating that
--- a/src/gtkimhtml.c Sat Oct 04 15:48:40 2003 +0000 +++ b/src/gtkimhtml.c Sat Oct 04 19:34:53 2003 +0000 @@ -525,19 +525,42 @@ menu = gtk_menu_new(); /* buttons and such */ - img = gtk_image_new_from_stock(GTK_STOCK_COPY, GTK_ICON_SIZE_MENU); - item = gtk_image_menu_item_new_with_mnemonic(_("_Copy Link Location")); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); - g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(url_copy), - url); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - img = gtk_image_new_from_stock(GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU); - item = gtk_image_menu_item_new_with_mnemonic(_("_Open Link in Browser")); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); - g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(url_open), - tempdata); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + if (!strncmp(url, "mailto:", 7)) + { + /* Copy E-Mail Address */ + img = gtk_image_new_from_stock(GTK_STOCK_COPY, + GTK_ICON_SIZE_MENU); + item = gtk_image_menu_item_new_with_mnemonic( + _("_Copy E-Mail Address")); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); + g_signal_connect(G_OBJECT(item), "activate", + G_CALLBACK(url_copy), url + 7); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + } + else + { + /* Copy Link Location */ + img = gtk_image_new_from_stock(GTK_STOCK_COPY, + GTK_ICON_SIZE_MENU); + item = gtk_image_menu_item_new_with_mnemonic( + _("_Copy Link Location")); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); + g_signal_connect(G_OBJECT(item), "activate", + G_CALLBACK(url_copy), url); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + + /* Open Link in Browser */ + img = gtk_image_new_from_stock(GTK_STOCK_JUMP_TO, + GTK_ICON_SIZE_MENU); + item = gtk_image_menu_item_new_with_mnemonic( + _("_Open Link in Browser")); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img); + g_signal_connect(G_OBJECT(item), "activate", + G_CALLBACK(url_open), tempdata); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + } + gtk_widget_show_all(menu); gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,