Merge pull request #1668 from curlymorphic/i1634
Proposed fix 1643 Allow drag-and-drop of project files
This commit is contained in:
@@ -518,6 +518,10 @@ void FileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * me )
|
||||
new StringPairDrag( "importedproject", f->fullName(),
|
||||
embed::getIconPixmap( "midi_file" ), this );
|
||||
break;
|
||||
case FileItem::ProjectFile:
|
||||
new StringPairDrag( "projectfile", f->fullName(),
|
||||
embed::getIconPixmap( "project_file" ), this );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -307,7 +307,7 @@ void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
StringPairDrag::processDragEnterEvent( _dee,
|
||||
QString( "presetfile,pluginpresetfile,samplefile,instrument,"
|
||||
"importedproject,soundfontfile,vstpluginfile,"
|
||||
"importedproject,soundfontfile,vstpluginfile,projectfile,"
|
||||
"track_%1,track_%2" ).
|
||||
arg( Track::InstrumentTrack ).
|
||||
arg( Track::SampleTrack ) );
|
||||
@@ -360,6 +360,13 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
|
||||
ImportFilter::import( value, m_tc );
|
||||
_de->accept();
|
||||
}
|
||||
|
||||
else if( type == "projectfile")
|
||||
{
|
||||
Engine::getSong()->loadProject( value );
|
||||
_de->accept();
|
||||
}
|
||||
|
||||
else if( type.left( 6 ) == "track_" )
|
||||
{
|
||||
DataFile dataFile( value.toUtf8() );
|
||||
|
||||
Reference in New Issue
Block a user