[nautilus] window-menus: don't special case no-app-menu anymore
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] window-menus: don't special case no-app-menu anymore
- Date: Tue, 26 Aug 2014 22:07:03 +0000 (UTC)
commit 7149021c0858972c669af36bcf67774d1aa9593d
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Aug 26 15:01:04 2014 -0700
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.
src/nautilus-window-menus.c | 51 -----------------------------------------
src/nautilus-window-private.h | 1 -
src/nautilus-window.c | 2 -
3 files changed, 0 insertions(+), 54 deletions(-)
---
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 53f8521..b0d640b 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -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)
{
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index 4d11351..255a647 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -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);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 2f30799..1bfca84 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]