Re: dragging to trash folder problems

2009-12-27 Thread kvic...@pobox.com

kyle,
thanx for the response. see below for a followup question.

At 10:36 PM -0500 12/26/09, Kyle Sluder wrote:

On Sat, Dec 26, 2009 at 5:24 PM, kvic...@pobox.com kvic...@pobox.com wrote:

 however, if the user drags an object to the trash icon, and then
 subsequently drags to and drops on the (popped) opened trash folder, i no
 longer receive the NSDragOperationDelete operation in
 -draggedImage:endedAt:operation: and hence cannot detect that this should
 actually be a delete and the opened trash folder remains open on the
 desktop.


This sounds like a bug. You should file it at
http://bugreport.apple.com. If the Dock is going to report a
drag-to-Trash as a delete operation, then the Finder should report a
drag-to-Trash-folder as a delete operation as well.


reported as 7499789




 1) how can i detect that the user dropped into a (popped) opened trash
 folder?


If you are able to drag to a folder at all, you must be providing a
file or a promise pasteboard item. In that case, you should be able to
tell if the destination folder is a Trash folder (either NSWorkspace
or some Carbon API). Then you can perform the delete.


i am not providing either a file or a promise (at least not that i 
know of). in my table's data source implementation of 
-tableView:writeRowsWithIndexes:toPasteboard: i supply one (or more) 
private pboard types and i also provide NSRTFPboardType and 
NSStringPboardType data that enables dragging (rich) text to text 
files and which create text clipping files when dropped in a folder 
or on the desktop. for testing purposes, i implemented 
-tableView:setObjectValue:forTableColumn:row: and 
-pasteboard:provideDataForType:  in my datasource, but neither is 
called.


ken
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


dragging to trash folder problems

2009-12-26 Thread kvic...@pobox.com
i've implemented -draggedImage:endedAt:operation: and i check if the 
operation is an NSDragOperationDelete to detect drags to the trash, 
and if so, i then appropriately delete the dragged object from my 
app's document.


this all works fine as long as the user drags the object to the trash 
icon in the dock.


however, if the user drags an object to the trash icon, and then 
subsequently drags to and drops on the (popped) opened trash folder, 
i no longer receive the NSDragOperationDelete operation in 
-draggedImage:endedAt:operation: and hence cannot detect that this 
should actually be a delete and the opened trash folder remains open 
on the desktop.


not only that, but if the user drops in the (pop) opened trash 
folder, since i don't perform the delete, the user can again drag the 
same object to the trash icon in the dock and this opens a second 
trash folder. this can be repeated many times, resulting in many 
opened trash folders on the desktop.


my questions:
1) how can i detect that the user dropped into a (popped) opened trash folder?
2) is the behavior of (popping) open multiple instances of the trash 
folder a (known) bug?


this is on leopard 10.5.8.

ken
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: dragging to trash folder problems

2009-12-26 Thread Kyle Sluder
On Sat, Dec 26, 2009 at 5:24 PM, kvic...@pobox.com kvic...@pobox.com wrote:
 however, if the user drags an object to the trash icon, and then
 subsequently drags to and drops on the (popped) opened trash folder, i no
 longer receive the NSDragOperationDelete operation in
 -draggedImage:endedAt:operation: and hence cannot detect that this should
 actually be a delete and the opened trash folder remains open on the
 desktop.

This sounds like a bug. You should file it at
http://bugreport.apple.com. If the Dock is going to report a
drag-to-Trash as a delete operation, then the Finder should report a
drag-to-Trash-folder as a delete operation as well.

 1) how can i detect that the user dropped into a (popped) opened trash
 folder?

If you are able to drag to a folder at all, you must be providing a
file or a promise pasteboard item. In that case, you should be able to
tell if the destination folder is a Trash folder (either NSWorkspace
or some Carbon API). Then you can perform the delete.

Safari 4.0.4 is able to handle dragging bookmarks bar items to the
Trash icon in the dock as well as to a springloaded Trash folder
window.

 2) is the behavior of (popping) open multiple instances of the trash folder
 a (known) bug?

I don't think this is a bug, for the same reason that I can pop open
multiple instances of any other folder. This might not be expected
behavior for someone used to the pre-OS X Finder, but it seems pretty
consistent with the non-spatial OS X Finder.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com