GNOME Bugzilla – Bug 372220
drag and drop append to playlist modifier key
Last modified: 2008-11-28 07:33:10 UTC
If a file is dragged and dropped onto the playlist side bar the file is appended to the playlist. It would be useful if a drag and drop with ctrl or shift modifier key press would append to the playlist when dropped on the main window, as the side bar is not always enabled or visible. http://developer.gnome.org/projects/gup/hig/2.0/input.html#drag-drop indicates ctrl be used as a modifier for copy which is perhaps more like append than cut(shift) Other information:
That would be nice indeed.
Created attachment 80481 [details] [review] Patch to change DND behaviour This patch clears the playlist if the drag-and-drop isn't a copy action (i.e. ctrl isn't being held down). So, for example, holding shift down while dragging will clear the playlist. Since the default DND action here appears to be copy, dragging with no modifiers will still append to the playlist.
The problem is that the drop on the video isn't really a "copy" one, as it will empty the playlist normally. So the default for the video canvas drop needs to be changed as well. The drop code in totem-playlist.c will need to be changed to reflect that too.
I don't quite understand. What do you want the default actions to be for the two areas?
Drop on the video is a "replace" operation by default, and using "Ctrl+drop" would be "add" (should show the "+" cursor). Drop on the playlist is "add" by default, unless "Shift" is pressed, in which case it would replace the content.
I can't seem to be able to find any way to do this with GTK+ (setting a default action). I've dropped a mail to the GTK+ list about it.
Created attachment 123292 [details] [review] add with Ctrl on video, replace with Shift on playlist (and playlist button) This patch implements the desired behaviour. It works by using a callback for the drag_motion signal for the video. There it checks whether Ctrl is pressed or not and sets the drag status appropriately.
Looks good to me and works nicely. Bastien?
Looks good. Thanks for the work. Please commit to trunk.
Committed. Thanks Robin. 2008-11-28 Philip Withnall <philip@tecnocode.co.uk> * src/totem-playlist.c (drop_cb): * src/totem.c (drop_video_cb), (drag_motion_video_cb), (drop_playlist_cb), (video_widget_create): Patch by Robin Stocker <robin@nibor.org> to add a drag-and-drop modifier key for the video widget and playlist, allowing adding to and replacing of the playlist, respectively. (Closes: #372220)