[nautilus/wip/gaction_: 4/14] eautilus-view: drop create link



commit 9fa83d891d889a43cadc8a3f4d787438fe488259
Author: Carlos Soriano <carlos sorian89 gmail com>
Date:   Mon Jan 5 13:51:43 2015 +0100

    eautilus-view: drop create link
    
    The ui won't offer a way to do it since it's an action that probably
    most of users won't even know what a link is, and those who need it
    probably can use other ways to manage these kind of actions.

 src/nautilus-actions.h             |    1 -
 src/nautilus-directory-view-ui.xml |    1 -
 src/nautilus-view.c                |  104 ------------------------------------
 3 files changed, 0 insertions(+), 106 deletions(-)
---
diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h
index 542d99f..ad57454 100644
--- a/src/nautilus-actions.h
+++ b/src/nautilus-actions.h
@@ -77,7 +77,6 @@
 #define NAUTILUS_ACTION_COPY_TO "Copy To"
 #define NAUTILUS_ACTION_RENAME "Rename"
 #define NAUTILUS_ACTION_DUPLICATE "Duplicate"
-#define NAUTILUS_ACTION_CREATE_LINK "Create Link"
 #define NAUTILUS_ACTION_SET_AS_WALLPAPER "Set As Wallpaper"
 #define NAUTILUS_ACTION_SELECT_ALL "Select All"
 #define NAUTILUS_ACTION_INVERT_SELECTION "Invert Selection"
diff --git a/src/nautilus-directory-view-ui.xml b/src/nautilus-directory-view-ui.xml
index 184249b..4c4fade 100644
--- a/src/nautilus-directory-view-ui.xml
+++ b/src/nautilus-directory-view-ui.xml
@@ -95,7 +95,6 @@
   <placeholder name="File Actions">
     <menuitem name="Move To" action="Move To"/>
     <menuitem name="Copy To" action="Copy To"/>
-    <menuitem name="Create Link" action="Create Link"/>
     <menuitem name="Rename" action="Rename"/>
     <menuitem name="Set As Wallpaper" action="Set As Wallpaper"/>
   </placeholder>
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 1367db0..022e6ea 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -270,9 +270,6 @@ typedef struct {
 /* forward declarations */
 
 static gboolean display_selection_info_idle_callback           (gpointer              data);
-static void     nautilus_view_create_links_for_files           (NautilusView      *view,
-                                                               GList                *files,
-                                                               GArray               *item_locations);
 static void     trash_or_delete_files                          (GtkWindow            *parent_window,
                                                                const GList          *files,
                                                                NautilusView      *view);
@@ -417,21 +414,6 @@ nautilus_view_get_selection_for_file_transfer (NautilusView *view)
        return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_selection_for_file_transfer (view);
 }
 
-/**
- * nautilus_view_get_selected_icon_locations:
- *
- * return an array of locations of selected icons if available
- * Return value: GArray of GdkPoints
- * 
- **/
-static GArray *
-nautilus_view_get_selected_icon_locations (NautilusView *view)
-{
-       g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
-
-       return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_selected_icon_locations (view);
-}
-
 static void
 nautilus_view_invert_selection (NautilusView *view)
 {
@@ -1339,27 +1321,6 @@ real_delete (NautilusView *view)
 }
 
 static void
-action_create_link_callback (GtkAction *action,
-                            gpointer callback_data)
-{
-        NautilusView *view;
-        GList *selection;
-        GArray *selected_item_locations;
-        
-        g_assert (NAUTILUS_IS_VIEW (callback_data));
-
-        view = NAUTILUS_VIEW (callback_data);
-       selection = nautilus_view_get_selection (view);
-       if (selection_not_empty_in_menu_callback (view, selection)) {
-               selected_item_locations = nautilus_view_get_selected_icon_locations (view);
-               nautilus_view_create_links_for_files (view, selection, selected_item_locations);
-               g_array_free (selected_item_locations, TRUE);
-       }
-
-        nautilus_file_list_free (selection);
-}
-
-static void
 action_select_all_callback (GtkAction *action, 
                            gpointer callback_data)
 {
@@ -3920,20 +3881,6 @@ nautilus_view_get_copied_files_atom (NautilusView *view)
 }
 
 static void
-prepend_uri_one (gpointer data, gpointer callback_data)
-{
-       NautilusFile *file;
-       GList **result;
-       
-       g_assert (NAUTILUS_IS_FILE (data));
-       g_assert (callback_data != NULL);
-
-       result = (GList **) callback_data;
-       file = (NautilusFile *) data;
-       *result = g_list_prepend (*result, nautilus_file_get_uri (file));
-}
-
-static void
 offset_drop_points (GArray *relative_item_points,
                    int x_offset, int y_offset)
 {
@@ -3949,41 +3896,6 @@ offset_drop_points (GArray *relative_item_points,
        }
 }
 
-static void
-nautilus_view_create_links_for_files (NautilusView *view, GList *files,
-                                     GArray *relative_item_points)
-{
-       GList *uris;
-       char *dir_uri;
-       CopyMoveDoneData *copy_move_done_data;
-       g_assert (relative_item_points->len == 0
-                 || g_list_length (files) == relative_item_points->len);
-       
-        g_assert (NAUTILUS_IS_VIEW (view));
-        g_assert (files != NULL);
-
-       /* create a list of URIs */
-       uris = NULL;
-       g_list_foreach (files, prepend_uri_one, &uris);
-       uris = g_list_reverse (uris);
-
-        g_assert (g_list_length (uris) == g_list_length (files));
-
-       /* offset the drop locations a bit so that we don't pile
-        * up the icons on top of each other
-        */
-       offset_drop_points (relative_item_points,
-                           DUPLICATE_HORIZONTAL_ICON_OFFSET,
-                           DUPLICATE_VERTICAL_ICON_OFFSET);
-
-        copy_move_done_data = pre_copy_move (view);
-       dir_uri = nautilus_view_get_backing_uri (view);
-       nautilus_file_operations_copy_move (uris, relative_item_points, dir_uri, GDK_ACTION_LINK, 
-                                           GTK_WIDGET (view), copy_move_done_callback, copy_move_done_data);
-       g_free (dir_uri);
-       g_list_free_full (uris, g_free);
-}
-
 /* special_link_in_selection
  * 
  * Return TRUE if one of our special links is in the selection.
@@ -7130,10 +7042,6 @@ static const GtkActionEntry directory_view_entries[] = {
   /* label, accelerator */       N_("_Invert Selection"), "<control><shift>I",
   /* tooltip */                  N_("Select all and only the items that are not currently selected"),
                                 G_CALLBACK (action_invert_selection_callback) }, 
-  /* name, stock id */         { NAUTILUS_ACTION_CREATE_LINK, NULL,
-  /* label, accelerator */       N_("Ma_ke Link"), "<control>M",
-  /* tooltip */                  N_("Create a symbolic link for each selected item"),
-                                G_CALLBACK (action_create_link_callback) },
   /* name, stock id */         { NAUTILUS_ACTION_RENAME, NULL,
   /* label, accelerator */       N_("Rena_me…"), "F2",
   /* tooltip */                  N_("Rename selected item"),
@@ -8329,7 +8237,6 @@ real_update_menus (NautilusView *view)
        gboolean can_move_files;
        gboolean can_trash_files;
        gboolean can_copy_files;
-       gboolean can_link_files;
        gboolean show_separate_delete_command;
        gboolean show_open_alternate;
        gboolean show_open_in_new_tab;
@@ -8369,7 +8276,6 @@ real_update_menus (NautilusView *view)
                && !selection_contains_special_link;
 
        can_move_files = can_delete_files && !selection_contains_recent;
-       can_link_files = can_create_files && can_copy_files;
 
        action = gtk_action_group_get_action (view->details->dir_action_group,
                                              NAUTILUS_ACTION_RENAME);
@@ -8593,16 +8499,6 @@ real_update_menus (NautilusView *view)
                                              NAUTILUS_ACTION_RESTORE_FROM_TRASH);
        update_restore_from_trash_action (action, selection, FALSE);
 
-       action = gtk_action_group_get_action (view->details->dir_action_group,
-                                             NAUTILUS_ACTION_CREATE_LINK);
-       gtk_action_set_sensitive (action, can_link_files);
-       gtk_action_set_visible (action, !selection_contains_recent);
-       g_object_set (action, "label",
-                     ngettext ("Ma_ke Link",
-                               "Ma_ke Links",
-                               selection_count),
-                     NULL);
-
        show_properties = !showing_network_directory (view)
                && (!NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view) || selection_count > 0);
 


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