diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-06-18 20:17:16 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-06-18 20:17:16 +0800 |
commit | 3b3889d5baf7963455f228bbaced14ecb56fad61 (patch) | |
tree | 1ac5aa3df67d32d021e47f9c53a414121aed1415 /src | |
parent | a1ebf5424cef4d6923a24ac391c3287414cec800 (diff) | |
download | gsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.tar gsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.tar.gz gsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.tar.bz2 gsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.tar.lz gsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.tar.xz gsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.tar.zst gsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.zip |
Unify the "Copy Email Address" and "Copy Link Address" context menu
2003-06-18 Christian Persch <chpe@cvs.gnome.org>
* data/ui/epiphany-ui.xml.in:
* src/ephy-window.c:
* src/popup-commands.h:
* src/popup-commands.c: (popup_cmd_copy_email),
(popup_cmd_copy_link_location), (popup_cmd_copy_link_address):
Unify the "Copy Email Address" and "Copy Link Address" context menu
entries. Fixes bug #115377.
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); - |