Fix PR comments
This commit is contained in:
+2
-2
@@ -383,10 +383,10 @@ void Core::DialogExportShow()
|
||||
}
|
||||
|
||||
#ifdef USE_OTIO
|
||||
void Core::DialogImportOTIOShow(const QList<Sequence*>& sequences) {
|
||||
bool Core::DialogImportOTIOShow(const QList<Sequence*>& sequences) {
|
||||
Project* active_project = GetActiveProject();
|
||||
OTIOPropertiesDialog opd(sequences, active_project);
|
||||
opd.exec();
|
||||
return opd.exec() == QDialog::Accepted;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -402,7 +402,7 @@ public slots:
|
||||
* @brief Show OTIO import dialog
|
||||
*/
|
||||
#ifdef USE_OTIO
|
||||
void DialogImportOTIOShow(const QList<Sequence*>& sequences);
|
||||
bool DialogImportOTIOShow(const QList<Sequence*>& sequences);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,8 @@ OTIOPropertiesDialog::OTIOPropertiesDialog(const QList<Sequence*>& sequences, Pr
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
|
||||
layout->addWidget(new QLabel(tr("Change settings for each OTIO sequence to be loaded")));
|
||||
layout->addWidget(new QLabel(tr("OpenTimelineIO files to not store sequence properties (resolution, framerate etc.).\n"
|
||||
"Set the correct parameters here or they will be left at the default setting.")));
|
||||
|
||||
table_ = new QTreeWidget();
|
||||
table_->setColumnCount(2);
|
||||
@@ -66,7 +67,7 @@ OTIOPropertiesDialog::OTIOPropertiesDialog(const QList<Sequence*>& sequences, Pr
|
||||
connect(buttons, &QDialogButtonBox::rejected, this, &OTIOPropertiesDialog::reject);
|
||||
layout->addWidget(buttons);
|
||||
|
||||
setWindowTitle(tr("Load OTIO File"));
|
||||
setWindowTitle(tr("Load OpenTimelineIO File"));
|
||||
}
|
||||
|
||||
void OTIOPropertiesDialog::SetupSequence() {
|
||||
|
||||
@@ -97,9 +97,17 @@ bool LoadOTIOTask::Run()
|
||||
|
||||
// Generate a list of sequences with the same names as the timelines.
|
||||
// Assumes each timeline has a unique name.
|
||||
int unnamedSequenceCount = 1;
|
||||
foreach (auto timeline, timelines) {
|
||||
Sequence* sequence = new Sequence();
|
||||
sequence->SetLabel(QString::fromStdString(timeline->name()));
|
||||
if (!timeline->name().empty()) {
|
||||
sequence->SetLabel(QString::fromStdString(timeline->name()));
|
||||
} else {
|
||||
// If the otio timeline does not provide a name, create a default one here
|
||||
QString label = "Sequence " + QString::number(unnamedSequenceCount);
|
||||
sequence->SetLabel(QString::fromStdString(label.toStdString()));
|
||||
unnamedSequenceCount++;
|
||||
}
|
||||
// Set default params incase they aren't edited.
|
||||
sequence->set_default_parameters();
|
||||
timeline_sequnce_map.insert(timeline, sequence);
|
||||
@@ -112,11 +120,18 @@ bool LoadOTIOTask::Run()
|
||||
}
|
||||
|
||||
// Dialog has to be called from the main thread so we pass the list of sequences here.
|
||||
bool accepted = false;
|
||||
QMetaObject::invokeMethod(Core::instance(),
|
||||
"DialogImportOTIOShow",
|
||||
Qt::BlockingQueuedConnection,
|
||||
Q_RETURN_ARG(bool, accepted),
|
||||
Q_ARG(QList<Sequence*>,timeline_sequnce_map.values()));
|
||||
|
||||
if (!accepted) {
|
||||
SetError(tr("Loading OpenTimelineIO file(s) was canceled"));
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (auto timeline, timeline_sequnce_map.keys()) {
|
||||
Sequence* sequence = timeline_sequnce_map.value(timeline);
|
||||
sequence->setParent(project_);
|
||||
|
||||
Reference in New Issue
Block a user