diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-11-03 05:32:32 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-11-03 05:32:32 +0800 |
commit | efbfe12a61f3908722e7ec6f8c26afb3c6e1ce5b (patch) | |
tree | e09adfe0a7c474c56426aa60ce43e8b201fab285 | |
parent | 11a032f69278c27d78f2a44471ce2bc273c42de5 (diff) | |
download | gsoc2013-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.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | data/ui/epiphany-ui.xml | 46 | ||||
-rw-r--r-- | src/ephy-window.c | 28 |
3 files changed, 34 insertions, 51 deletions
@@ -1,5 +1,16 @@ 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. + +2005-11-02 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/EphyAboutModule.cpp: * embed/mozilla/EphyAboutModule.h: diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml index 0bf29d3de..60339dfc7 100644 --- a/data/ui/epiphany-ui.xml +++ b/data/ui/epiphany-ui.xml @@ -112,12 +112,14 @@ <menuitem name="GoBackDP" action="NavigationBack"/> <menuitem name="GoForwardDP" action="NavigationForward"/> <menuitem name="GoReloadDP" action="ViewReload"/> - <separator name="DPSep1"/> + <separator /> <menuitem name="EditCopyDP" action="EditCopy"/> - <separator name="DPSep2"/> + <separator /> <menuitem name="SavePageAsDP" action="FileSaveAs"/> <menuitem name="BookmarkPageDP" action="ContextBookmarkPage"/> <separator /> + <menuitem name="OpenFrameFDP" action="OpenFrame"/> + <separator /> <menuitem name="OpenImageDP" action="OpenImage"/> <menuitem name="SaveImageAsDP" action="SaveImageAs"/> <menuitem name="SetImageAsBackgroundDP" action="SetImageAsBackground"/> @@ -134,6 +136,8 @@ <menuitem name="SavePageAsFSDP" action="FileSaveAs"/> <menuitem name="BookmarkPageFSDP" action="ContextBookmarkPage"/> <separator /> + <menuitem name="OpenFrameFSFDP" action="OpenFrame"/> + <separator /> <menuitem name="ViewToolbarFSDP" action="ViewToolbar"/> <separator /> <menuitem name="OpenImageFSDP" action="OpenImage"/> @@ -142,44 +146,6 @@ <menuitem name="CopyImageLocationFSDP" action="CopyImageLocation"/> </popup> -<popup name="EphyFramedDocumentPopup" action="PopupAction"> - <menuitem name="GoBackFDP" action="NavigationBack"/> - <menuitem name="GoForwardFDP" action="NavigationForward"/> - <menuitem name="GoReloadFDP" action="ViewReload"/> - <separator /> - <menuitem name="EditCopyFDP" action="EditCopy"/> - <separator /> - <menuitem name="SavePageAsFDP" action="FileSaveAs"/> - <menuitem name="BookmarkPageFDP" action="ContextBookmarkPage"/> - <separator /> - <menuitem name="OpenFrameFDP" action="OpenFrame"/> - <separator /> - <menuitem name="OpenImageFDP" action="OpenImage"/> - <menuitem name="SaveImageAsFDP" action="SaveImageAs"/> - <menuitem name="SetImageAsBackgroundFDP" action="SetImageAsBackground"/> - <menuitem name="CopyImageLocationFDP" action="CopyImageLocation"/> -</popup> - -<popup name="EphyFullscreenFramedDocumentPopup" action="PopupAction"> - <menuitem name="GoBackFSFDP" action="NavigationBack"/> - <menuitem name="GoForwardFSFDP" action="NavigationForward"/> - <menuitem name="GoReloadFSFDP" action="ViewReload"/> - <separator /> - <menuitem name="EditCopyFSFDP" action="EditCopy"/> - <separator /> - <menuitem name="SavePageAsFSFDP" action="FileSaveAs"/> - <menuitem name="BookmarkPageFSFDP" action="ContextBookmarkPage"/> - <separator /> - <menuitem name="OpenFrameFSFDP" action="OpenFrame"/> - <separator /> - <menuitem name="ViewToolbarFSFDP" action="ViewToolbar"/> - <separator /> - <menuitem name="OpenImageFSFDP" action="OpenImage"/> - <menuitem name="SaveImageAsFSFDP" action="SaveImageAs"/> - <menuitem name="SetImageAsBackgroundFSFDP" action="SetImageAsBackground"/> - <menuitem name="CopyImageLocationFSFDP" action="CopyImageLocation"/> -</popup> - <popup name="EphyLinkPopup" action="PopupAction"> <menuitem name="OpenLinkLP" action="OpenLink"/> <menuitem name="OpenLinkInNewWindowLP" action="OpenLinkInNewWindow"/> 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); |