| 395 | } |
| 396 | |
| 397 | void |
| 398 | PrecompNodePrivate::reloadProject(bool setWriteNodeChoice) |
| 399 | { |
| 400 | std::string filename = projectFileNameKnob.lock()->getValue(); |
| 401 | QFileInfo file( QString::fromUtf8( filename.c_str() ) ); |
| 402 | |
| 403 | if ( !file.exists() ) { |
| 404 | Dialogs::errorDialog( tr("Pre-Comp").toStdString(), tr("Pre-comp file not found.").toStdString() ); |
| 405 | |
| 406 | return; |
| 407 | } |
| 408 | QString fileUnPathed = file.fileName(); |
| 409 | |
| 410 | subLabelKnob.lock()->setValue( fileUnPathed.toStdString() ); |
| 411 | |
| 412 | QString path = file.path() + QLatin1Char('/'); |
| 413 | |
| 414 | precompInputs.clear(); |
| 415 | |
| 416 | ProjectPtr project = app.lock()->getProject(); |
| 417 | project->resetProject(); |
| 418 | { |
| 419 | //Set a temporary timeline that will be used while loading the project. |
| 420 | //This is to avoid that the seekFrame call has an effect on this project since they share the same timeline |
| 421 | TimeLinePtr tmpTimeline( new TimeLine( project.get() ) ); |
| 422 | project->setTimeLine(tmpTimeline); |
| 423 | } |
| 424 | |
| 425 | bool ok = project->loadProject( path, fileUnPathed); |
| 426 | if (!ok) { |
| 427 | project->resetProject(); |
| 428 | } |
| 429 | |
| 430 | //Switch the timeline to this instance's timeline |
| 431 | project->setTimeLine( _publicInterface->getApp()->getTimeLine() ); |
| 432 | |
| 433 | populateWriteNodesChoice(true, setWriteNodeChoice); |
| 434 | |
| 435 | if (ok) { |
| 436 | createReadNode(); |
| 437 | } |
| 438 | refreshOutputNode(); |
| 439 | } |
| 440 | |
| 441 | void |
| 442 | PrecompNodePrivate::populateWriteNodesChoice(bool setPartOfPrecomp, |
no test coverage detected