Commit 7149021c authored by Cosimo Cecchi's avatar Cosimo Cecchi

window-menus: don't special case no-app-menu anymore

We're relying on GTK+ showing the app menu in the header bar these days,
so we don't need this special case anymore.
parent 2bd2e4e5
......@@ -624,19 +624,6 @@ static const GtkRadioActionEntry view_radio_entries[] = {
"<control>2", N_("View items as a grid of icons"), 1 }
};
static const gchar* app_actions[] = {
NAUTILUS_ACTION_NEW_WINDOW,
NAUTILUS_ACTION_CONNECT_TO_SERVER,
NAUTILUS_ACTION_EDIT_BOOKMARKS,
NAUTILUS_ACTION_PREFERENCES,
NAUTILUS_ACTION_HELP,
NAUTILUS_ACTION_ABOUT,
NAUTILUS_ACTION_CLOSE_ALL_WINDOWS,
/* also hide the help menu entirely when using an app menu */
"Help"
};
static void
action_toggle_state (GSimpleAction *action,
GVariant *parameter,
......@@ -662,28 +649,6 @@ nautilus_window_initialize_actions (NautilusWindow *window)
window);
}
static void
nautilus_window_menus_set_visibility_for_app_menu (NautilusWindow *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->details->main_action_group, action_name);
gtk_action_set_visible (action, !shows_app_menu);
}
}
/**
* nautilus_window_initialize_menus
*
......@@ -716,12 +681,6 @@ nautilus_window_initialize_menus (NautilusWindow *window)
-1, G_CALLBACK (action_view_radio_changed),
window);
nautilus_window_menus_set_visibility_for_app_menu (window);
window->details->app_menu_visibility_id =
g_signal_connect_swapped (gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (window))),
"notify::gtk-shell-shows-app-menu",
G_CALLBACK (nautilus_window_menus_set_visibility_for_app_menu), window);
action = gtk_action_group_get_action (action_group, NAUTILUS_ACTION_UP);
g_object_set (action, "short_label", _("_Up"), NULL);
......@@ -764,16 +723,6 @@ nautilus_window_initialize_menus (NautilusWindow *window)
gtk_ui_manager_add_ui_from_resource (ui_manager, "/org/gnome/nautilus/nautilus-shell-ui.xml", NULL);
}
void
nautilus_window_finalize_menus (NautilusWindow *window)
{
if (window->details->app_menu_visibility_id != 0) {
g_signal_handler_disconnect (gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (window))),
window->details->app_menu_visibility_id);
window->details->app_menu_visibility_id = 0;
}
}
static GList *
get_extension_menus (NautilusWindow *window)
{
......
......@@ -110,7 +110,6 @@ void nautilus_window_sync_up_button (NautilusWindow *window);
/* window menus */
void nautilus_window_initialize_actions (NautilusWindow *window);
void nautilus_window_initialize_menus (NautilusWindow *window);
void nautilus_window_finalize_menus (NautilusWindow *window);
void nautilus_window_update_show_hide_menu_items (NautilusWindow *window);
......
......@@ -1629,8 +1629,6 @@ nautilus_window_finalize (GObject *object)
window->details->sidebar_width_handler_id = 0;
}
nautilus_window_finalize_menus (window);
g_clear_object (&window->details->ui_manager);
/* nautilus_window_close() should have run */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment