[nautilus/wip/csoriano/desktop-split: 9/53] files-view: use inheritance for showing the properties menu item



commit b831d0d63f2a720d010dd0107561350028f20fe1
Author: Carlos Soriano <csoriano gnome org>
Date:   Fri Mar 18 14:44:50 2016 +0100

    files-view: use inheritance for showing the properties menu item
    
    So we can remove another special casing of the desktop in a parent class

 src/nautilus-desktop-canvas-view.c |    7 +++++--
 src/nautilus-files-view.c          |    4 +---
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index 674304e..bc6dfa8 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -571,6 +571,8 @@ real_update_context_menus (NautilusFilesView *view)
 
        view_action_group = nautilus_files_view_get_action_group (view);
        desktop_view = NAUTILUS_DESKTOP_CANVAS_VIEW (view);
+        selection = nautilus_view_get_selection (NAUTILUS_VIEW (view));
+       selection_count = g_list_length (selection);
 
        action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "empty-trash");
        g_simple_action_set_enabled (G_SIMPLE_ACTION (action), trash_link_is_selection (view));
@@ -584,9 +586,10 @@ real_update_context_menus (NautilusFilesView *view)
        action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "change-background");
        g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE);
 
+       action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "properties");
+       g_simple_action_set_enabled (G_SIMPLE_ACTION (action), selection_count > 0);
+
        /* Stretch */
-        selection = nautilus_view_get_selection (NAUTILUS_VIEW (view));
-       selection_count = g_list_length (selection);
        canvas_container = get_canvas_container (desktop_view);
 
        action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "stretch");
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index a550a34..64b0b38 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -6241,7 +6241,6 @@ real_update_actions_state (NautilusFilesView *view)
         gboolean item_opens_in_view;
         gboolean is_read_only;
         GAction *action;
-        gboolean show_properties;
         GActionGroup *view_action_group;
         gboolean show_mount;
         gboolean show_unmount;
@@ -6286,7 +6285,6 @@ real_update_actions_state (NautilusFilesView *view)
         can_paste_files_into = (!selection_contains_recent &&
                                 selection_count == 1 &&
                                 can_paste_into_file (NAUTILUS_FILE (selection->data)));
-        show_properties = !NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view) || selection_count > 0;
          settings_show_delete_permanently = g_settings_get_boolean (nautilus_preferences,
                                                                     
NAUTILUS_PREFERENCES_SHOW_DELETE_PERMANENTLY);
          settings_show_create_link = g_settings_get_boolean (nautilus_preferences,
@@ -6505,7 +6503,7 @@ real_update_actions_state (NautilusFilesView *view)
         action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
                                              "properties");
         g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
-                                     show_properties);
+                                     TRUE);
         action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
                                              "new-document");
         g_simple_action_set_enabled (G_SIMPLE_ACTION (action),


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