| 440 | |
| 441 | |
| 442 | void AutomationPatternView::dropEvent( QDropEvent * _de ) |
| 443 | { |
| 444 | QString type = StringPairDrag::decodeKey( _de ); |
| 445 | QString val = StringPairDrag::decodeValue( _de ); |
| 446 | if( type == "automatable_model" ) |
| 447 | { |
| 448 | AutomatableModel * mod = dynamic_cast<AutomatableModel *>( |
| 449 | Engine::projectJournal()-> |
| 450 | journallingObject( val.toInt() ) ); |
| 451 | if( mod != NULL ) |
| 452 | { |
| 453 | bool added = m_pat->addObject( mod ); |
| 454 | if ( !added ) |
| 455 | { |
| 456 | TextFloat::displayMessage( mod->displayName(), |
| 457 | tr( "Model is already connected " |
| 458 | "to this pattern." ), |
| 459 | embed::getIconPixmap( "automation" ), |
| 460 | 2000 ); |
| 461 | } |
| 462 | } |
| 463 | update(); |
| 464 | |
| 465 | if( gui->automationEditor() && |
| 466 | gui->automationEditor()->currentPattern() == m_pat ) |
| 467 | { |
| 468 | gui->automationEditor()->setCurrentPattern( m_pat ); |
| 469 | } |
| 470 | } |
| 471 | else |
| 472 | { |
| 473 | TrackContentObjectView::dropEvent( _de ); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | |
| 478 |
nothing calls this directly
no test coverage detected