diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 6 | ||||
-rw-r--r-- | src/popup-commands.c | 47 | ||||
-rw-r--r-- | src/popup-commands.h | 6 |
3 files changed, 21 insertions, 38 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index b560b1e09..bdcd30718 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -240,10 +240,8 @@ static EggActionGroupEntry ephy_popups_entries [] = { NULL, G_CALLBACK (popup_cmd_download_link), NULL }, { "BookmarkLink", N_("_Bookmark Link..."), EPHY_STOCK_BOOKMARK_PAGE, NULL, NULL, G_CALLBACK (popup_cmd_bookmark_link), NULL }, - { "CopyLinkLocation", N_("_Copy Link Address"), NULL, NULL, - NULL, G_CALLBACK (popup_cmd_copy_link_location), NULL }, - { "CopyEmail", N_("Copy _Email Address"), NULL, NULL, - NULL, G_CALLBACK (popup_cmd_copy_email), NULL }, + { "CopyLinkAddress", N_("_Copy Link Address"), NULL, NULL, + NULL, G_CALLBACK (popup_cmd_copy_link_address), NULL }, /* Images */ { "OpenImage", N_("Open _Image"), GTK_STOCK_OPEN, NULL, diff --git a/src/popup-commands.c b/src/popup-commands.c index ff1390704..354713783 100644 --- a/src/popup-commands.c +++ b/src/popup-commands.c @@ -226,39 +226,29 @@ popup_cmd_copy_to_clipboard (EphyWindow *window, const char *text) } void -popup_cmd_copy_email (EggAction *action, - EphyWindow *window) -{ - EphyEmbedEvent *info; - const char *location; - const GValue *value; - EphyEmbed *embed; - - embed = ephy_window_get_active_embed (window); - g_return_if_fail (embed != NULL); - - info = get_event_info (window); - ephy_embed_event_get_property (info, "email", &value); - location = g_value_get_string (value); - popup_cmd_copy_to_clipboard (window, location); -} - -void -popup_cmd_copy_link_location (EggAction *action, - EphyWindow *window) +popup_cmd_copy_link_address (EggAction *action, + EphyWindow *window) { - EphyEmbedEvent *info; - const char *location; + EphyEmbedEvent *event; + const char *address; const GValue *value; EphyEmbed *embed; - embed = ephy_window_get_active_embed (window); - g_return_if_fail (embed != NULL); + event = get_event_info (window); + g_return_if_fail (IS_EPHY_EMBED_EVENT (event)); - info = get_event_info (window); - ephy_embed_event_get_property (info, "link", &value); - location = g_value_get_string (value); - popup_cmd_copy_to_clipboard (window, location); + if (event->context & EMBED_CONTEXT_EMAIL_LINK) + { + ephy_embed_event_get_property (event, "email", &value); + address = g_value_get_string (value); + popup_cmd_copy_to_clipboard (window, address); + } + else if (event->context & EMBED_CONTEXT_LINK) + { + ephy_embed_event_get_property (event, "link", &value); + address = g_value_get_string (value); + popup_cmd_copy_to_clipboard (window, address); + } } static void @@ -461,4 +451,3 @@ popup_cmd_open_image (EggAction *action, ephy_embed_load_url (embed, location); } - diff --git a/src/popup-commands.h b/src/popup-commands.h index 5ec17215a..da14090aa 100644 --- a/src/popup-commands.h +++ b/src/popup-commands.h @@ -46,10 +46,7 @@ void popup_cmd_add_frame_bookmark (EggAction *action, void popup_cmd_view_source (EggAction *action, EphyWindow *window); -void popup_cmd_copy_page_location (EggAction *action, - EphyWindow *window); - -void popup_cmd_copy_email (EggAction *action, +void popup_cmd_copy_link_address (EggAction *action, EphyWindow *window); void popup_cmd_copy_link_location (EggAction *action, @@ -81,4 +78,3 @@ void popup_cmd_download_link (EggAction *action, void popup_cmd_save_image_as (EggAction *action, EphyWindow *window); - |