diff --git a/app/core.cpp b/app/core.cpp index 0aa5fa11a..97a49f8e0 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -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; diff --git a/app/core.h b/app/core.h index c1902f17a..a2ded04db 100644 --- a/app/core.h +++ b/app/core.h @@ -656,6 +656,8 @@ private slots: */ void OpenProjectInternal(const QString& filename, bool recovery_project = false); + void ImportSingleFile(const QString &f); + }; } diff --git a/app/dialog/export/export.cpp b/app/dialog/export/export.cpp index 0ffcbb4c3..6210b63f4 100644 --- a/app/dialog/export/export.cpp +++ b/app/dialog/export/export.cpp @@ -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(); } } diff --git a/app/dialog/export/export.h b/app/dialog/export/export.h index 2b257cec2..307e8b0d4 100644 --- a/app/dialog/export/export.h +++ b/app/dialog/export/export.h @@ -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_;