Skip to content

Commit

Permalink
Proposed fix 1643 Allow drag-and-drop of project files
Browse files Browse the repository at this point in the history
  • Loading branch information
curlymorphic committed Jan 21, 2015
1 parent c13d111 commit 9460fde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/gui/FileBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion src/gui/TrackContainerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down Expand Up @@ -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() );
Expand Down

0 comments on commit 9460fde

Please sign in to comment.