From 7564180aa406fe0c5fa561fdbdb1f3566ca1487a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Rameau?= Date: Sun, 9 Oct 2005 19:49:00 +0000 Subject: Eliminate the *Popup/*ImagePopup popup variants. Add image context to all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2005-10-09 Jean-François Rameau * 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. --- ChangeLog | 10 ++++++++ data/ui/epiphany-ui.xml | 68 +++++++++++++++++++++++++------------------------ src/ephy-window.c | 36 +++++++++++++++----------- 3 files changed, 66 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0c09e96d..6f1f64997 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-10-09 Jean-François Rameau + + * 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. + 2005-10-09 Christian Persch * src/ephy-shell.c: diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml index 7eb2693d8..b7c3b4a1a 100644 --- a/data/ui/epiphany-ui.xml +++ b/data/ui/epiphany-ui.xml @@ -102,6 +102,11 @@ + + + + + @@ -113,6 +118,11 @@ + + + + + @@ -126,6 +136,11 @@ + + + + + @@ -139,6 +154,11 @@ + + + + + @@ -154,6 +174,11 @@ + + + + + @@ -167,29 +192,11 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + @@ -197,16 +204,11 @@ - - - - - - - - - - + + + + + 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 @@ -852,6 +852,24 @@ ephy_window_delete_event (GtkWidget *widget, return FALSE; } +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) { @@ -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", -- cgit v1.2.3