aboutsummaryrefslogtreecommitdiffstats
path: root/src/popup-commands.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-06-18 20:17:16 +0800
committerChristian Persch <chpe@src.gnome.org>2003-06-18 20:17:16 +0800
commit3b3889d5baf7963455f228bbaced14ecb56fad61 (patch)
tree1ac5aa3df67d32d021e47f9c53a414121aed1415 /src/popup-commands.c
parenta1ebf5424cef4d6923a24ac391c3287414cec800 (diff)
downloadgsoc2013-epiphany-3b3889d5baf7963455f228bbaced14ecb56fad61.tar.gz
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/popup-commands.c')
-rw-r--r--src/popup-commands.c47
1 files changed, 18 insertions, 29 deletions
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);
}
-