diff options
author | Pavel Cisler <pavel@eazel.com> | 2000-12-01 21:32:18 +0000 |
---|---|---|
committer | Pavel Cisler <pce@src.gnome.org> | 2000-12-01 21:32:18 +0000 |
commit | 86aeacbb0cb116a7b34af0c475fae52bc0150fd1 (patch) | |
tree | 6273bba60d0ca49338a41972e17d6395c837efbd /libnautilus-extensions/nautilus-icon-dnd.c | |
parent | 447ad0fdb5461ed4417077c8f2cfac25f68f9b9d (diff) | |
download | nautilus-86aeacbb0cb116a7b34af0c475fae52bc0150fd1.tar.gz |
reviewed by: Darin Adler <darin@eazel.com>
2000-12-01 Pavel Cisler <pavel@eazel.com>
reviewed by: Darin Adler <darin@eazel.com>
* libnautilus-extensions/nautilus-file-operations.c:
(progress_dialog_set_to_from_item_text), (handle_xfer_ok),
(handle_xfer_vfs_error), (handle_xfer_overwrite), (get_link_name),
(nautilus_file_operations_copy_move),
(nautilus_file_operations_new_folder),
(nautilus_file_operations_move_to_trash),
(nautilus_file_operations_delete), (do_empty_trash):
Fixed 3392 - Messages in nautilus-file-operations hard to localize.
Replaced all the cases that did "clever" string composition from
parts depending on the specific file operation with full texts of
the respective error alerts and progress dialog label texts and
titles.
Changed action_verb to action_label.
Got rid of progress_dialog_set_files_done_text because the the
"Files copied:" etc. label is no longer composed.
Added switch statements in handle_xfer_vfs_error that choose the
right error text based on the xfer operation kind.
Fixed 3139 - Add comments to all the localizable strings to make them
easier to localize.
* libnautilus-extensions/nautilus-file-operations.c:
(icon_position_iterator_new),
* libnautilus-extensions/nautilus-file-operations.h:
(nautilus_file_operations_copy_move),
* libnautilus-extensions/nautilus-icon-container.c:
(nautilus_icon_container_get_icon_locations),
(nautilus_icon_container_get_selected_icon_locations):
* libnautilus-extensions/nautilus-icon-container.h:
* libnautilus-extensions/nautilus-icon-dnd.c:
(handle_nonlocal_move), (nautilus_icon_container_find_drop_target):
* libnautilus-extensions/nautilus-icon-private.h:
* src/file-manager/fm-directory-view.c:
(fm_directory_view_initialize_class), (duplicate_callback),
(fm_directory_view_create_links_for_files), (offset_drop_points),
(fm_directory_view_duplicate_selection),
(fm_directory_get_selected_icon_locations),
(fm_directory_view_move_copy_items):
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-icon-view.c:
(fm_icon_view_get_selected_icon_locations),
(fm_icon_view_set_selection), (fm_icon_view_initialize_class),
(icon_view_move_copy_items):
* src/file-manager/fm-list-view.c: (fm_list_view_initialize_class),
(fm_list_view_get_selected_icon_locations),
(fm_list_view_sort_items):
Fixed 2817 - when you duplicate a file, it doesn't end up in the correct
position.
Redid the icon position array to use GArray instead of a simple vector of
GdkPoints. GArray contains the count of all the contained points
which is now needed.
Added new calls to get the icon locations of selected icons and
of a list of NautilusIcon objects.
Passed the list of icon locations to the duplicate method.
Added a default signal handler that returns the list of
icon locations of selected icons.
Added code to fm_directory_view_duplicate_selection that
offsets the new duplicates to the left and bottom of the
original item.
Diffstat (limited to 'libnautilus-extensions/nautilus-icon-dnd.c')
-rw-r--r-- | libnautilus-extensions/nautilus-icon-dnd.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/libnautilus-extensions/nautilus-icon-dnd.c b/libnautilus-extensions/nautilus-icon-dnd.c index 38c623415..575f6e08f 100644 --- a/libnautilus-extensions/nautilus-icon-dnd.c +++ b/libnautilus-extensions/nautilus-icon-dnd.c @@ -795,8 +795,8 @@ handle_nonlocal_move (NautilusIconContainer *container, gboolean icon_hit) { GList *source_uris, *p; - GdkPoint *source_item_locations; - int i; + GArray *source_item_locations; + int index; if (container->details->dnd_info->drag_info.selection_list == NULL) { return; @@ -809,16 +809,20 @@ handle_nonlocal_move (NautilusIconContainer *container, } source_uris = g_list_reverse (source_uris); - source_item_locations = NULL; + source_item_locations = g_array_new (FALSE, TRUE, sizeof (GdkPoint)); if (!icon_hit) { /* Drop onto a container. Pass along the item points to allow placing * the items in their same relative positions in the new container. */ - source_item_locations = g_new (GdkPoint, g_list_length (source_uris)); - for (i = 0, p = container->details->dnd_info->drag_info.selection_list; - p != NULL; i++, p = p->next) { - source_item_locations[i].x = ((DragSelectionItem *)p->data)->icon_x; - source_item_locations[i].y = ((DragSelectionItem *)p->data)->icon_y; + source_item_locations = g_array_set_size (source_item_locations, + g_list_length (container->details->dnd_info->drag_info.selection_list)); + + for (index = 0, p = container->details->dnd_info->drag_info.selection_list; + p != NULL; index++, p = p->next) { + g_array_index (source_item_locations, GdkPoint, index).x = + ((DragSelectionItem *)p->data)->icon_x; + g_array_index (source_item_locations, GdkPoint, index).y = + ((DragSelectionItem *)p->data)->icon_y; } } @@ -829,8 +833,9 @@ handle_nonlocal_move (NautilusIconContainer *container, target_uri, context->action, x, y); + g_list_free (source_uris); - g_free (source_item_locations); + g_array_free (source_item_locations, TRUE); } static char * @@ -865,7 +870,7 @@ nautilus_icon_container_find_drop_target (NautilusIconContainer *container, if (icon_uri != NULL) { file = nautilus_file_get (icon_uri); - if ( !nautilus_drag_can_accept_items (file, + if (!nautilus_drag_can_accept_items (file, container->details->dnd_info->drag_info.selection_list)) { /* the item we dropped our selection on cannot accept the items, * do the same thing as if we just dropped the items on the canvas |