]> git.sesse.net Git - vlc/commitdiff
We can now DnD a file everywhere on the playlist dialog. Droping above the tree will...
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 5 Mar 2006 11:24:59 +0000 (11:24 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 5 Mar 2006 11:24:59 +0000 (11:24 +0000)
modules/gui/wxwidgets/dialogs/playlist.cpp

index b1011e01354459a2c0da666073e85a3f8dd35ea9..c4102e84169f729dea8305762fb289e0800b90ff 100644 (file)
@@ -375,6 +375,8 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
 #if wxUSE_DRAG_AND_DROP
     /* Associate drop targets with the playlist */
     SetDropTarget( new PlaylistFileDropTarget( this ) );
+    menubar->SetDropTarget( new PlaylistFileDropTarget( this ) );
+    toolbar->SetDropTarget( new PlaylistFileDropTarget( this ) );
 #endif
 
     i_saved_id = -1;
@@ -1242,10 +1244,9 @@ bool PlaylistFileDropTarget::OnDropFiles( wxCoord x, wxCoord y,
 
     /* find the destination node and position in that node */
     const wxPoint pt( x, y );
-    int flags = 0;
-    wxTreeItemId item = p->treectrl->HitTest( pt, flags );
+    wxTreeItemId item = p->treectrl->HitTest( pt );
 
-    if( flags & wxTREE_HITTEST_NOWHERE )
+    if( !item.IsOk() )
     {
         /* We were droped below the last item so we append to the
          * general node */
@@ -1254,14 +1255,6 @@ bool PlaylistFileDropTarget::OnDropFiles( wxCoord x, wxCoord y,
     }
     else
     {
-        /* We were droped on an item */
-        if( !item.IsOk() )
-        {
-            printf("Arf ....\n" );
-            UnlockPlaylist( p->p_intf->p_sys, p->p_playlist );
-            return FALSE;
-        }
-
         PlaylistItem *p_plitem =
             (PlaylistItem *)p->treectrl->GetItemData( item );
         p_dest = playlist_ItemGetById( p->p_playlist, p_plitem->i_id );