Commit 542f240b authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Cosimo Cecchi

Select GDK_ACTION_MOVE as default action when DnD-ing a uri list into the

2008-05-27  Cosimo Cecchi  <cosimoc@gnome.org>

	* libnautilus-private/nautilus-dnd.c:
	(nautilus_drag_default_drop_action_for_uri_list):
	* libnautilus-private/nautilus-dnd.h:
	* libnautilus-private/nautilus-icon-dnd.c:
	(nautilus_icon_container_get_drop_action):
	Select GDK_ACTION_MOVE as default action when DnD-ing a uri list
	into the trash. (#534769).

svn path=/trunk/; revision=14200
parent d97ec8db
2008-05-27 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-private/nautilus-dnd.c:
(nautilus_drag_default_drop_action_for_uri_list):
* libnautilus-private/nautilus-dnd.h:
* libnautilus-private/nautilus-icon-dnd.c:
(nautilus_icon_container_get_drop_action):
Select GDK_ACTION_MOVE as default action when DnD-ing a uri list
into the trash. (#534769).
2008-05-24 Christian Neumair <cneumair@gnome.org>
* src/nautilus-property-browser.c (nautilus_property_browser_init),
......
......@@ -453,6 +453,18 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context,
}
GdkDragAction
nautilus_drag_default_drop_action_for_uri_list (GdkDragContext *context,
const char *target_uri_string)
{
if (eel_uri_is_trash (target_uri_string) && (context->actions & GDK_ACTION_MOVE)) {
/* Only move to Trash */
return GDK_ACTION_MOVE;
} else {
return context->suggested_action;
}
}
/* Encode a "x-special/gnome-icon-list" selection.
Along with the URIs of the dragged files, this encodes
the location and size of each icon relative to the cursor.
......
......@@ -126,6 +126,8 @@ void nautilus_drag_default_drop_action_for_icons (GdkDrag
const GList *items,
int *action);
GdkDragAction nautilus_drag_default_drop_action_for_netscape_url (GdkDragContext *context);
GdkDragAction nautilus_drag_default_drop_action_for_uri_list (GdkDragContext *context,
const char *target_uri_string);
gboolean nautilus_drag_drag_data_get (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection_data,
......
......@@ -1276,6 +1276,13 @@ nautilus_icon_container_get_drop_action (NautilusIconContainer *container,
action);
g_free (drop_target);
break;
case NAUTILUS_ICON_DND_URI_LIST:
drop_target = nautilus_icon_container_find_drop_target (container,
context, x, y, &icon_hit, FALSE);
*action = nautilus_drag_default_drop_action_for_uri_list (context, drop_target);
g_free (drop_target);
break;
/* handle emblems by setting the action if we're over an object */
case NAUTILUS_ICON_DND_KEYWORD:
......@@ -1291,7 +1298,6 @@ nautilus_icon_container_get_drop_action (NautilusIconContainer *container,
case NAUTILUS_ICON_DND_COLOR:
case NAUTILUS_ICON_DND_BGIMAGE:
case NAUTILUS_ICON_DND_RESET_BACKGROUND:
case NAUTILUS_ICON_DND_URI_LIST:
case NAUTILUS_ICON_DND_ROOTWINDOW_DROP:
*action = context->suggested_action;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment