diff options
author | Jean-François Rameau <jframeau@cvs.gnome.org> | 2005-10-10 03:49:00 +0800 |
---|---|---|
committer | Jean-François Rameau <jframeau@src.gnome.org> | 2005-10-10 03:49:00 +0800 |
commit | 7564180aa406fe0c5fa561fdbdb1f3566ca1487a (patch) | |
tree | 4b31224f6bcae63b5996a8ebf4825fb695ed18a1 /src | |
parent | 5596836e1b87d5ddf6f9ad787a52ed8fecb472a2 (diff) | |
download | gsoc2013-epiphany-7564180aa406fe0c5fa561fdbdb1f3566ca1487a.tar gsoc2013-epiphany-7564180aa406fe0c5fa561fdbdb1f3566ca1487a.tar.gz gsoc2013-epiphany-7564180aa406fe0c5fa561fdbdb1f3566ca1487a.tar.bz2 gsoc2013-epiphany-7564180aa406fe0c5fa561fdbdb1f3566ca1487a.tar.lz gsoc2013-epiphany-7564180aa406fe0c5fa561fdbdb1f3566ca1487a.tar.xz gsoc2013-epiphany-7564180aa406fe0c5fa561fdbdb1f3566ca1487a.tar.zst gsoc2013-epiphany-7564180aa406fe0c5fa561fdbdb1f3566ca1487a.zip |
Eliminate the *Popup/*ImagePopup popup variants. Add image context to all
2005-10-09 Jean-François Rameau <jframeau@cvs.gnome.org>
* data/ui/epiphany-ui.xml:
* src/ephy-window.c: (show_embed_popup),
(update_image_actions_visibility):
Eliminate the *Popup/*ImagePopup popup variants.
Add image context to all popups it can show up.
Display image context dynamically.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 3dfdb4c39..c1d2fa02e 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -853,6 +853,24 @@ ephy_window_delete_event (GtkWidget *widget, } static void +update_image_actions_visibility (EphyWindow *window, gboolean show) +{ + GtkAction *action; + GtkActionGroup *action_group; + + action_group = window->priv->popups_action_group; + + action = gtk_action_group_get_action (action_group, "OpenImage"); + gtk_action_set_visible (action, show); + action = gtk_action_group_get_action (action_group, "SaveImageAs"); + gtk_action_set_visible (action, show); + action = gtk_action_group_get_action (action_group, "SetImageAsBackground"); + gtk_action_set_visible (action, show); + action = gtk_action_group_get_action (action_group, "CopyImageLocation"); + gtk_action_set_visible (action, show); +} + +static void update_edit_actions_sensitivity (EphyWindow *window, gboolean hide) { GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (window)); @@ -1775,30 +1793,16 @@ show_embed_popup (EphyWindow *window, LOG ("show_embed_popup context %x", context); - if ((context & EPHY_EMBED_CONTEXT_EMAIL_LINK) && - (context & EPHY_EMBED_CONTEXT_IMAGE)) - { - popup = "/EphyImageEmailLinkPopup"; - } - else if (context & EPHY_EMBED_CONTEXT_EMAIL_LINK) + if (context & EPHY_EMBED_CONTEXT_EMAIL_LINK) { popup = "/EphyEmailLinkPopup"; update_edit_actions_sensitivity (window, TRUE); } - else if ((context & EPHY_EMBED_CONTEXT_LINK) && - (context & EPHY_EMBED_CONTEXT_IMAGE)) - { - popup = "/EphyImageLinkPopup"; - } else if (context & EPHY_EMBED_CONTEXT_LINK) { popup = "/EphyLinkPopup"; update_edit_actions_sensitivity (window, TRUE); } - else if (context & EPHY_EMBED_CONTEXT_IMAGE) - { - popup = "/EphyImagePopup"; - } else if (context & EPHY_EMBED_CONTEXT_INPUT) { popup = "/EphyInputPopup"; @@ -1830,6 +1834,8 @@ show_embed_popup (EphyWindow *window, action = gtk_action_group_get_action (action_group, "OpenLinkInNewTab"); ephy_action_change_sensitivity_flags (action, SENS_FLAG_CONTEXT, !can_open_in_new); + update_image_actions_visibility (window, context & EPHY_EMBED_CONTEXT_IMAGE); + _ephy_window_set_context_event (window, event); g_signal_connect (widget, "deactivate", |