aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-11-03 05:32:32 +0800
committerChristian Persch <chpe@src.gnome.org>2005-11-03 05:32:32 +0800
commitefbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b (patch)
treee09adfe0a7c474c56426aa60ce43e8b201fab285 /src/ephy-window.c
parent11a032f69278c27d78f2a44471ce2bc273c42de5 (diff)
downloadgsoc2013-epiphany-efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b.tar
gsoc2013-epiphany-efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b.tar.gz
gsoc2013-epiphany-efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b.tar.bz2
gsoc2013-epiphany-efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b.tar.lz
gsoc2013-epiphany-efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b.tar.xz
gsoc2013-epiphany-efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b.tar.zst
gsoc2013-epiphany-efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b.zip
Simplify context menu code by removing the extra EphyDocument*FramePopup
2005-11-02 Christian Persch <chpe@cvs.gnome.org> * data/ui/epiphany-ui.xml: * src/ephy-window.c: (update_popup_actions_visibility), (show_embed_popup): Simplify context menu code by removing the extra EphyDocument*FramePopup variants, and just setting the OpenFrame action's visibility accordingly; and fix its accelerator. Fixes bug #320520.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3a82e882b..97f4511e3 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -306,7 +306,7 @@ static const GtkActionEntry ephy_popups_entries [] = {
/* Framed document */
- { "OpenFrame", NULL, N_("Show Only This _Frame"), NULL,
+ { "OpenFrame", NULL, N_("Show Only _This Frame"), NULL,
N_("Show only this frame in this window"),
G_CALLBACK (popup_cmd_open_frame) },
@@ -914,7 +914,9 @@ ephy_window_delete_event (GtkWidget *widget,
}
static void
-update_image_actions_visibility (EphyWindow *window, gboolean show)
+update_popup_actions_visibility (EphyWindow *window,
+ gboolean is_image,
+ gboolean is_frame)
{
GtkAction *action;
GtkActionGroup *action_group;
@@ -922,13 +924,16 @@ update_image_actions_visibility (EphyWindow *window, gboolean show)
action_group = window->priv->popups_action_group;
action = gtk_action_group_get_action (action_group, "OpenImage");
- gtk_action_set_visible (action, show);
+ gtk_action_set_visible (action, is_image);
action = gtk_action_group_get_action (action_group, "SaveImageAs");
- gtk_action_set_visible (action, show);
+ gtk_action_set_visible (action, is_image);
action = gtk_action_group_get_action (action_group, "SetImageAsBackground");
- gtk_action_set_visible (action, show);
+ gtk_action_set_visible (action, is_image);
action = gtk_action_group_get_action (action_group, "CopyImageLocation");
- gtk_action_set_visible (action, show);
+ gtk_action_set_visible (action, is_image);
+
+ action = gtk_action_group_get_action (action_group, "OpenFrame");
+ gtk_action_set_visible (action, is_frame);
}
static void
@@ -1951,14 +1956,12 @@ show_embed_popup (EphyWindow *window,
}
else if (window->priv->fullscreen_mode)
{
- popup = framed ? "/EphyFullscreenFramedDocumentPopup" :
- "/EphyFullscreenDocumentPopup";
+ popup = "/EphyFullscreenDocumentPopup";
update_edit_actions_sensitivity (window, TRUE);
}
else
{
- popup = framed ? "/EphyFramedDocumentPopup" :
- "/EphyDocumentPopup";
+ popup = "/EphyDocumentPopup";
update_edit_actions_sensitivity (window, TRUE);
}
@@ -1975,7 +1978,10 @@ 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);
+
+ update_popup_actions_visibility (window,
+ context & EPHY_EMBED_CONTEXT_IMAGE,
+ framed);
_ephy_window_set_context_event (window, event);