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 147337 - dragging songs to source list should create new playlist
dragging songs to source list should create new playlist
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-07-11 10:56 UTC by Stefan Ihringer
Modified: 2005-08-25 02:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (4.76 KB, patch)
2005-08-16 11:40 UTC, Jonathan Matthew
none Details | Review
better patch (29.71 KB, patch)
2005-08-21 23:01 UTC, Jonathan Matthew
none Details | Review
more patch (39.90 KB, patch)
2005-08-23 13:50 UTC, Jonathan Matthew
none Details | Review
will I ever get this right? (40.77 KB, patch)
2005-08-23 23:34 UTC, Jonathan Matthew
none Details | Review
apparently not (41.13 KB, patch)
2005-08-24 11:30 UTC, Jonathan Matthew
none Details | Review
just one more.. (41.47 KB, patch)
2005-08-24 22:45 UTC, Jonathan Matthew
committed Details | Review

Description Stefan Ihringer 2004-07-11 10:56:00 UTC
This is a feature from iTunes: You can select multiple songs and simply drag 
them to an empty spot in the source list to create a new playlist containing 
those songs.
Comment 1 Jonathan Matthew 2005-08-16 11:40:33 UTC
Created attachment 50781 [details] [review]
patch

This was very nearly already working in 0.9.  The attached patch fixes this and
a few related sourcelist DnD issues.

For DnD into the sourcelist:
- accept text/uri-list with no destination path (this bug)
- check for the text/x-rhythmbox-* types before text/uri-list
- prefer same over text/uri-list (ordering in target_table in rb-shell.c)


also:
- only specify a playlist name for autoplaylists; specifying NULL attempts to
edit the new playlist name, which seems right to me.
- kill some unused stuff in rb-sourcelist-model.c

This also re-enables creation of one genre/artist/album autoplaylists by
dragging from the property view into the sourcelist, which is kind of nice.
Comment 2 Jonathan Matthew 2005-08-21 23:01:33 UTC
Created attachment 51081 [details] [review]
better patch

Now does multiple genre/artist/album autoplaylists by dragging from property
views, and leaks less memory.

I moved the property view dnd code into the property model, so it could make
use of rb-tree-dnd to do multi-select drag and drop properly.  Without this,
dragging multiple selected property values was tricky.	It'd only work if you
started dragging with the same click that selected the last property value.

I had to add a new optional method to the rb-tree-dnd drop target interface to
allow the target to select the dnd type.  Otherwise, dragging from a property
view to a static playlist would fail, as the autoplaylist dnd type would be
selected, so we'd end up creating a new playlist.  If I switched the target
list around so text/uri-list was preferred, autoplaylist dnd would never
happen.
Comment 3 James "Doc" Livingston 2005-08-23 12:14:54 UTC
I can't comment on the code, because I don't know enough about the techinical
side of DnD, but the patch works well for me. Unless there are issues you know
about that need fixing, this looks fine to commit.

One nice thing this patch also lets you do, is drag an item from a property view
to another application and have it work correctly - by passing the URIs. This is
really handy because it lets you add all the songs by an artist to the totem
playlist, or copy them to a folder (by dragging them to Nautilus).
Comment 4 Jonathan Matthew 2005-08-23 13:09:47 UTC
As it is, this patch breaks reordering of playlists by dragging in the source list.  I've almost got that 
working properly again (better than it was before).  I'll attach an updated patch when I'm done.
Comment 5 Jonathan Matthew 2005-08-23 13:50:04 UTC
Created attachment 51191 [details] [review]
more patch

Fixes playlist reorder DnD, reworks the playlist manager so it uses the
sourcelist rather than its own list (so reordering is persistent), and
implements text/uri-list drag target for playlists in the sourcelist, so you
can drag playlists to other apps (fixes bug 307310).
Comment 6 James "Doc" Livingston 2005-08-23 15:50:20 UTC
The playlist re-ordering doesn't work for me. If I have any automatic playlists,
I can't drag any playlist to a position directly below an automatic one. When I
can drag a playlist, it doesn't move to the correct position.
Comment 7 Jonathan Matthew 2005-08-23 23:34:48 UTC
Created attachment 51222 [details] [review]
will I ever get this right?

All playlists are now reorderable.  If other source types should be
reorderable, we should probably add a rb_source_is_reorderable (or something)
to figure it out.
Comment 8 Jonathan Matthew 2005-08-24 11:30:54 UTC
Created attachment 51244 [details] [review]
apparently not

Source reordering now works if there are invisible sources too.
Comment 9 James "Doc" Livingston 2005-08-24 12:08:44 UTC
That last patch works perfectly for me - and looks fine to be committed.
Comment 10 Jonathan Matthew 2005-08-24 22:45:33 UTC
Created attachment 51297 [details] [review]
just one more..

Updated to apply cleanly to current (anon) CVS, and to remove a couple of
unused variables that would have caused build breaks.  Please commit.
Comment 11 James "Doc" Livingston 2005-08-25 02:45:34 UTC
2005-08-25  James Livingston  <jrl@ids.org.au>

        Patch from Jonathan Mattnew <jonathan@kaolin.hn.org>

        * lib/rb-tree-dnd.c: (rb_tree_dnd_drag_drop_cb):
        * lib/rb-tree-dnd.h:
        * rhythmdb/rhythmdb-property-model.c:
        (rhythmdb_property_model_class_init),
        (rhythmdb_property_model_drag_source_init),
        (rhythmdb_property_model_iter_parent),
        (rhythmdb_property_model_row_draggable),
        (rhythmdb_property_model_drag_data_delete), (query_model_cb),
        (rhythmdb_property_model_drag_data_get),
        (rhythmdb_property_model_enable_drag):
        * rhythmdb/rhythmdb-property-model.h:
        * shell/rb-playlist-manager.c: (rb_playlist_manager_finalize),
        (rb_playlist_manager_set_property), (append_new_playlist_source),
        (rb_playlist_manager_save_playlists):
        * shell/rb-shell.c: (rb_shell_construct),
        (sourcelist_drag_received_cb):
        * sources/rb-iradio-source.c: (rb_iradio_source_class_init):
        * sources/rb-playlist-source.c: (impl_receive_drag):
        * sources/rb-sourcelist-model.c: (rb_sourcelist_model_class_init),
        (rb_sourcelist_model_drag_dest_init),
        (rb_sourcelist_model_set_dnd_targets),
        (rb_sourcelist_model_drag_data_received), (path_is_reorderable),
        (rb_sourcelist_model_row_drop_position),
        (rb_sourcelist_model_get_drag_target),
        (rb_sourcelist_model_drag_data_get):
        * sources/rb-sourcelist-model.h:
        * sources/rb-sourcelist.c: (rb_sourcelist_class_init),
        (rb_sourcelist_init), (rb_sourcelist_get_property),
        (rb_sourcelist_selection_changed_cb):
        * sources/rb-sourcelist.h:
        * widgets/rb-property-view.c: (rb_property_view_constructor): Greatly
        improve drag-n-drop support. Allow dragging of item from property
        views to the source list, to create new automatic playlists. Allow
        playlist re-ordering. Fix dragging from Rhythmbox to other
        applications. (Closes bug 147337)