exportdialog: add option to reimport result

This commit is contained in:
itsmattkc
2022-09-16 12:35:40 -07:00
parent 05551ed59d
commit 6e0c6cdc52
4 changed files with 43 additions and 6 deletions
+8
View File
@@ -1256,6 +1256,7 @@ void Core::OpenExportDialogForViewer(ViewerOutput *viewer, const rational &time,
ed->SetTime(time);
connect(ed, &ExportDialog::finished, ed, &ExportDialog::deleteLater);
ed->open();
connect(ed, &ExportDialog::RequestImportFile, this, &Core::ImportSingleFile);
}
void Core::CheckForAutoRecoveries()
@@ -1421,6 +1422,13 @@ void Core::OpenProjectInternal(const QString &filename, bool recovery_project)
task_dialog->open();
}
void Core::ImportSingleFile(const QString &f)
{
if (Project *p = GetActiveProject()) {
ImportFiles({f}, p->root());
}
}
int Core::CountFilesInFileList(const QFileInfoList &filenames)
{
int file_count = 0;
+2
View File
@@ -656,6 +656,8 @@ private slots:
*/
void OpenProjectInternal(const QString& filename, bool recovery_project = false);
void ImportSingleFile(const QString &f);
};
}
+29 -6
View File
@@ -157,6 +157,30 @@ ExportDialog::ExportDialog(ViewerOutput *viewer_node, bool stills_only_mode, QWi
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();
btn_layout->setMargin(0);
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);
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();
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
} else {
// Accept this dialog and close
if (import_file_after_export_) {
QString filename = filename_edit_->text().trimmed();
emit RequestImportFile(filename);
}
this->accept();
}
}
+4
View File
@@ -67,6 +67,9 @@ public:
public slots:
virtual void done(int r) override;
signals:
void RequestImportFile(const QString &s);
private:
void AddPreferencesTab(QWidget *inner_widget, const QString &title);
@@ -118,6 +121,7 @@ private:
QWidget* preferences_area_;
QCheckBox *export_bkg_box_;
QCheckBox *import_file_after_export_;
bool stills_only_mode_;