[epiphany/wip/mcatanzaro/fedora-needs-upstreamed: 30/32] Stop duplicating menu items in the app menu and window menu



commit a5ea2a5a96a656d66e2b0f416e184a81722bd859
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Aug 27 13:53:44 2014 -0500

    Stop duplicating menu items in the app menu and window menu
    
    Matters for non-GNOME users
    
    Upstream status: This patch silently remove the Close action from the
    window menu. This patch corresponds to two different patches posted on
    upstream Bugzilla.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735487

 src/ephy-window.c             |   51 -----------------------------------------
 src/resources/epiphany-ui.xml |    9 -------
 2 files changed, 0 insertions(+), 60 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 69e20cf..d040cf5 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -366,8 +366,6 @@ struct _EphyWindowPrivate
 
        EphyLocationController *location_controller;
 
-       gulong app_menu_visibility_handler;
-
        guint closing : 1;
        guint has_size : 1;
        guint fullscreen_mode : 1;
@@ -3083,13 +3081,6 @@ ephy_window_state_event (GtkWidget *widget,
 static void
 ephy_window_finalize (GObject *object)
 {
-       EphyWindow *window = EPHY_WINDOW (object);
-       EphyWindowPrivate *priv = window->priv;
-
-       if (priv->app_menu_visibility_handler != 0)
-               g_signal_handler_disconnect (gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET 
(window))),
-                                            priv->app_menu_visibility_handler);
-
        G_OBJECT_CLASS (ephy_window_parent_class)->finalize (object);
 
        LOG ("EphyWindow finalised %p", object);
@@ -3303,39 +3294,6 @@ _gtk_css_provider_load_from_resource (GtkCssProvider* provider,
        return res;
 }
 
-static const gchar* app_actions[] = {
-       "FileNewWindow",
-       "FileNewWindowIncognito",
-       "EditPreferences",
-       "EditBookmarks",
-       "EditHistory",
-       "FileQuit",
-       "HelpContents",
-       "HelpAbout"
-};
-
-static void
-ephy_window_toggle_visibility_for_app_menu (EphyWindow *window)
-{
-       const gchar *action_name;
-       gboolean shows_app_menu;
-       GtkSettings *settings;
-       GtkAction *action;
-       gint idx;
-
-       settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (window)));
-       g_object_get (settings,
-                     "gtk-shell-shows-app-menu", &shows_app_menu,
-                     NULL);
-
-       for (idx = 0; idx < G_N_ELEMENTS (app_actions); idx++) {
-               action_name = app_actions[idx];
-               action = gtk_action_group_get_action (window->priv->action_group, action_name);
-
-               gtk_action_set_visible (action, !shows_app_menu);
-       }
-}
-
 static GObject *
 ephy_window_constructor (GType type,
                         guint n_construct_properties,
@@ -3493,15 +3451,6 @@ ephy_window_constructor (GType type,
                chrome &= ~(EPHY_WINDOW_CHROME_MENU | EPHY_WINDOW_CHROME_TABSBAR);
        }
 
-       /* We never want the menubar shown, we merge the app menu into
-        * our super menu manually when running outside the Shell. */
-       gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), FALSE);
-
-       ephy_window_toggle_visibility_for_app_menu (window);
-       priv->app_menu_visibility_handler =  g_signal_connect_swapped (gtk_settings_get_for_screen 
(gtk_widget_get_screen (GTK_WIDGET (window))),
-                                                                      "notify::gtk-shell-shows-app-menu",
-                                                                      G_CALLBACK 
(ephy_window_toggle_visibility_for_app_menu), window);
-
        /* ensure the UI is updated */
        gtk_ui_manager_ensure_update (priv->manager);
 
diff --git a/src/resources/epiphany-ui.xml b/src/resources/epiphany-ui.xml
index 684d553..ed48e9a 100644
--- a/src/resources/epiphany-ui.xml
+++ b/src/resources/epiphany-ui.xml
@@ -9,8 +9,6 @@
        </popup>
 
        <popup name="PagePopup" action="PagePopupAction" accelerators="true">
-                <menuitem name="FileNewWindowMenu" action="FileNewWindow"/>
-                <menuitem name="FileNewWindowIncognitoMenu" action="FileNewWindowIncognito"/>
                 <menuitem name="FileNewTabMenu" action="FileNewTab"/>
                 <menuitem name="FileOpenMenu" action="FileOpen"/>
                 <separator name="FileSep1"/>   
@@ -29,10 +27,7 @@
                 <separator name="EditSep4"/> 
                 <menuitem name="FilePrintMenu" action="FilePrint"/>
                 <menuitem name="EditFindMenu" action="EditFind"/>
-                <menuitem name="EditPreferencesMenu" action="EditPreferences"/>
                 <separator name="FileSep5"/>
-                <menuitem name="HistoryEditMenu" action="EditHistory"/>
-                <menuitem name="BookmarksEditMenu" action="EditBookmarks"/>
                <menu name="BookmarksMenu" action="Bookmarks">
                        <menuitem name="BookmarksAddBookmarkMenu" action="FileBookmarkPage"/>
                        <separator name="BookmarksSep1"/>
@@ -43,10 +38,6 @@
                 </menu>
                 <menuitem name="ViewPageSourceMenu" action="ViewPageSource"/>
                 <separator name="FileSep7"/>
-                <menuitem name="HelpContentsMenu" action="HelpContents"/>
-                <menuitem name="HelpAboutMenu" action="HelpAbout"/>
-                <menuitem name="FileCloseWindowMenu" action="FileCloseTab"/>
-                <menuitem name="FileQuitMenu" action="FileQuit"/>
        </popup>
 
        <accelerator name="AlwaysStopAccel" action="ViewAlwaysStop"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]