exportdialog: add option to reimport result
This commit is contained in:
@@ -1256,6 +1256,7 @@ void Core::OpenExportDialogForViewer(ViewerOutput *viewer, const rational &time,
|
|||||||
ed->SetTime(time);
|
ed->SetTime(time);
|
||||||
connect(ed, &ExportDialog::finished, ed, &ExportDialog::deleteLater);
|
connect(ed, &ExportDialog::finished, ed, &ExportDialog::deleteLater);
|
||||||
ed->open();
|
ed->open();
|
||||||
|
connect(ed, &ExportDialog::RequestImportFile, this, &Core::ImportSingleFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::CheckForAutoRecoveries()
|
void Core::CheckForAutoRecoveries()
|
||||||
@@ -1421,6 +1422,13 @@ void Core::OpenProjectInternal(const QString &filename, bool recovery_project)
|
|||||||
task_dialog->open();
|
task_dialog->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Core::ImportSingleFile(const QString &f)
|
||||||
|
{
|
||||||
|
if (Project *p = GetActiveProject()) {
|
||||||
|
ImportFiles({f}, p->root());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int Core::CountFilesInFileList(const QFileInfoList &filenames)
|
int Core::CountFilesInFileList(const QFileInfoList &filenames)
|
||||||
{
|
{
|
||||||
int file_count = 0;
|
int file_count = 0;
|
||||||
|
|||||||
@@ -656,6 +656,8 @@ private slots:
|
|||||||
*/
|
*/
|
||||||
void OpenProjectInternal(const QString& filename, bool recovery_project = false);
|
void OpenProjectInternal(const QString& filename, bool recovery_project = false);
|
||||||
|
|
||||||
|
void ImportSingleFile(const QString &f);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,6 +157,30 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, bool stills_only_mode, QWi
|
|||||||
|
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
|
{
|
||||||
|
QGroupBox *options_group = new QGroupBox();
|
||||||
|
preferences_layout->addWidget(options_group, row, 0, 1, 4);
|
||||||
|
|
||||||
|
QGridLayout *options_layout = new QGridLayout(options_group);
|
||||||
|
|
||||||
|
int opt_row = 0;
|
||||||
|
|
||||||
|
export_bkg_box_ = new QCheckBox(tr("Run In Background"));
|
||||||
|
export_bkg_box_->setToolTip(tr("Exporting in the background allows you to continue using Olive while "
|
||||||
|
"exporting, but may result in slower export speeds, and may"
|
||||||
|
"severely impact editing and playback performance."));
|
||||||
|
options_layout->addWidget(export_bkg_box_, opt_row, 0);
|
||||||
|
|
||||||
|
import_file_after_export_ = new QCheckBox(tr("Import Result After Export"));
|
||||||
|
options_layout->addWidget(import_file_after_export_, opt_row, 1);
|
||||||
|
|
||||||
|
connect(export_bkg_box_, &QCheckBox::toggled, import_file_after_export_, [this](bool e){
|
||||||
|
import_file_after_export_->setEnabled(!e);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
row++;
|
||||||
|
|
||||||
QHBoxLayout *btn_layout = new QHBoxLayout();
|
QHBoxLayout *btn_layout = new QHBoxLayout();
|
||||||
btn_layout->setMargin(0);
|
btn_layout->setMargin(0);
|
||||||
preferences_layout->addLayout(btn_layout, row, 0, 1, 4);
|
preferences_layout->addLayout(btn_layout, row, 0, 1, 4);
|
||||||
@@ -171,12 +195,6 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, bool stills_only_mode, QWi
|
|||||||
btn_layout->addWidget(cancel_btn);
|
btn_layout->addWidget(cancel_btn);
|
||||||
connect(cancel_btn, &QPushButton::clicked, this, &ExportDialog::reject);
|
connect(cancel_btn, &QPushButton::clicked, this, &ExportDialog::reject);
|
||||||
|
|
||||||
export_bkg_box_ = new QCheckBox(tr("Run In Background"));
|
|
||||||
export_bkg_box_->setToolTip(tr("Exporting in the background allows you to continue using Olive while "
|
|
||||||
"exporting, but may result in slower export speeds, and may"
|
|
||||||
"severely impact editing and playback performance."));
|
|
||||||
btn_layout->addWidget(export_bkg_box_);
|
|
||||||
|
|
||||||
btn_layout->addStretch();
|
btn_layout->addStretch();
|
||||||
|
|
||||||
splitter->addWidget(preferences_area_);
|
splitter->addWidget(preferences_area_);
|
||||||
@@ -371,6 +389,11 @@ void ExportDialog::ExportFinished()
|
|||||||
// If this task was cancelled, we stay open so the user can potentially queue another export
|
// If this task was cancelled, we stay open so the user can potentially queue another export
|
||||||
} else {
|
} else {
|
||||||
// Accept this dialog and close
|
// Accept this dialog and close
|
||||||
|
if (import_file_after_export_) {
|
||||||
|
QString filename = filename_edit_->text().trimmed();
|
||||||
|
emit RequestImportFile(filename);
|
||||||
|
}
|
||||||
|
|
||||||
this->accept();
|
this->accept();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
virtual void done(int r) override;
|
virtual void done(int r) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void RequestImportFile(const QString &s);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddPreferencesTab(QWidget *inner_widget, const QString &title);
|
void AddPreferencesTab(QWidget *inner_widget, const QString &title);
|
||||||
|
|
||||||
@@ -118,6 +121,7 @@ private:
|
|||||||
|
|
||||||
QWidget* preferences_area_;
|
QWidget* preferences_area_;
|
||||||
QCheckBox *export_bkg_box_;
|
QCheckBox *export_bkg_box_;
|
||||||
|
QCheckBox *import_file_after_export_;
|
||||||
|
|
||||||
bool stills_only_mode_;
|
bool stills_only_mode_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user