[nautilus/wip/gaction_: 22/38] nautilus-view: drop empty trash on view



commit 87420da09d674261a2b7af2a00438fffb1d1c995
Author: Carlos Soriano <carlos sorian89 gmail com>
Date:   Mon Jan 5 15:58:34 2015 +0100

    nautilus-view: drop empty trash on view
    
    When the user is in the trash, there's already a inapp dialog that shows
    a button to empty the trash. On the other hand the sidebar also shows
    this item.
    Since it's not expected the user to see the trash directly as a folder,
    drop this item from the menus.

 src/nautilus-actions.h             |    1 -
 src/nautilus-directory-view-ui.xml |    3 ---
 src/nautilus-view.c                |   27 ---------------------------
 3 files changed, 0 insertions(+), 31 deletions(-)
---
diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h
index 8b6890a..2fe782a 100644
--- a/src/nautilus-actions.h
+++ b/src/nautilus-actions.h
@@ -63,7 +63,6 @@
 #define NAUTILUS_ACTION_PROPERTIES "Properties"
 #define NAUTILUS_ACTION_PROPERTIES_ACCEL "PropertiesAccel"
 #define NAUTILUS_ACTION_LOCATION_PROPERTIES "LocationProperties"
-#define NAUTILUS_ACTION_EMPTY_TRASH "Empty Trash"
 #define NAUTILUS_ACTION_CUT "Cut"
 #define NAUTILUS_ACTION_LOCATION_CUT "LocationCut"
 #define NAUTILUS_ACTION_COPY "Copy"
diff --git a/src/nautilus-directory-view-ui.xml b/src/nautilus-directory-view-ui.xml
index f5d0555..b665f4a 100644
--- a/src/nautilus-directory-view-ui.xml
+++ b/src/nautilus-directory-view-ui.xml
@@ -17,9 +17,6 @@
       <placeholder name="New Documents Placeholder"/>
     </menu>
   </placeholder>
-  <placeholder name="Global File Items Placeholder">
-    <menuitem name="Empty Trash" action="Empty Trash"/>
-  </placeholder>
   <placeholder name="Edit Actions">
     <placeholder name="Undostack Actions">
       <menuitem name="Undo" action="Undo"/>
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index d7f9167..b0ab56b 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -1444,15 +1444,6 @@ action_select_pattern_callback (GtkAction *action,
        select_pattern(callback_data);
 }
 
-static void
-action_empty_trash_callback (GtkAction *action,
-                            gpointer callback_data)
-{                
-        g_assert (NAUTILUS_IS_VIEW (callback_data));
-
-       nautilus_file_operations_empty_trash (GTK_WIDGET (callback_data));
-}
-
 typedef struct {
        NautilusView *view;
        NautilusFile *new_file;
@@ -6743,10 +6734,6 @@ static const GtkActionEntry directory_view_entries[] = {
   /* label, accelerator */       N_("_Open Scripts Folder"), NULL,
   /* tooltip */                 N_("Show the folder containing the scripts that appear in this menu"),
                                 G_CALLBACK (action_open_scripts_folder_callback) },
-  /* name, stock id */         { NAUTILUS_ACTION_EMPTY_TRASH, NULL,
-  /* label, accelerator */       N_("E_mpty Trash"), NULL,
-  /* tooltip */                  N_("Delete all items in the Trash"),
-                                G_CALLBACK (action_empty_trash_callback) },
   /* name, stock id */         { NAUTILUS_ACTION_CUT, NULL,
   /* label, accelerator */       N_("Cu_t"), "<control>X",
   /* tooltip */                  N_("Prepare the selected files to be moved with a Paste command"),
@@ -7090,12 +7077,6 @@ clipboard_targets_received (GtkClipboard     *clipboard,
 }
 
 static gboolean
-should_show_empty_trash (NautilusView *view)
-{
-       return (showing_trash_directory (view));
-}
-
-static gboolean
 file_list_all_are_folders (GList *file_list)
 {
        GList *l;
@@ -8080,14 +8061,6 @@ real_update_menus (NautilusView *view)
        gtk_action_set_visible (action, show_properties);
 
        action = gtk_action_group_get_action (view->details->dir_action_group,
-                                             NAUTILUS_ACTION_EMPTY_TRASH);
-       g_object_set (action,
-                     "label", _("E_mpty Trash"),
-                     NULL);
-       gtk_action_set_sensitive (action, !nautilus_trash_monitor_is_empty ());
-       gtk_action_set_visible (action, should_show_empty_trash (view));
-
-       action = gtk_action_group_get_action (view->details->dir_action_group,
                                              NAUTILUS_ACTION_SELECT_ALL);
        gtk_action_set_sensitive (action, !nautilus_view_is_empty (view));
 


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