After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 372220 - drag and drop append to playlist modifier key
drag and drop append to playlist modifier key
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Movie player
2.16.x
Other All
: Normal minor
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on: 439547
Blocks:
 
 
Reported: 2006-11-07 22:15 UTC by Tristan Hill
Modified: 2008-11-28 07:33 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Patch to change DND behaviour (1.31 KB, patch)
2007-01-17 06:47 UTC, Philip Withnall
rejected Details | Review
add with Ctrl on video, replace with Shift on playlist (and playlist button) (2.28 KB, patch)
2008-11-24 00:05 UTC, Robin Stocker
committed Details | Review

Description Tristan Hill 2006-11-07 22:15:24 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:
Comment 1 Bastien Nocera 2006-11-15 13:54:25 UTC
That would be nice indeed.
Comment 2 Philip Withnall 2007-01-17 06:47:51 UTC
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.
Comment 3 Bastien Nocera 2007-01-17 08:59:04 UTC
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.
Comment 4 Philip Withnall 2007-01-19 19:21:21 UTC
I don't quite understand. What do you want the default actions to be for the two areas?
Comment 5 Bastien Nocera 2007-01-19 19:45:56 UTC
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.
Comment 6 Bastien Nocera 2007-05-11 00:13:40 UTC
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.
Comment 7 Robin Stocker 2008-11-24 00:05:56 UTC
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.
Comment 8 Philip Withnall 2008-11-25 07:25:22 UTC
Looks good to me and works nicely. Bastien?
Comment 9 Bastien Nocera 2008-11-25 13:20:04 UTC
Looks good. Thanks for the work.

Please commit to trunk.
Comment 10 Philip Withnall 2008-11-28 07:33:10 UTC
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)