diff --git a/io/config.cpp b/io/config.cpp index faebd0c94..155d11b91 100644 --- a/io/config.cpp +++ b/io/config.cpp @@ -27,7 +27,8 @@ Config::Config() autoscale_by_default(false), recording_mode(2), enable_seek_to_import(false), - enable_audio_scrubbing(true) + enable_audio_scrubbing(true), + drop_on_media_to_replace(true) {} void Config::load(QString path) { @@ -95,6 +96,9 @@ void Config::load(QString path) { } else if (stream.name() == "AudioScrubbing") { stream.readNext(); enable_audio_scrubbing = (stream.text() == "1"); + } else if (stream.name() == "DropFileOnMediaToReplace") { + stream.readNext(); + drop_on_media_to_replace = (stream.text() == "1"); } } } @@ -138,6 +142,7 @@ void Config::save(QString path) { stream.writeTextElement("RecordingMode", QString::number(recording_mode)); stream.writeTextElement("EnableSeekToImport", QString::number(enable_seek_to_import)); stream.writeTextElement("AudioScrubbing", QString::number(enable_audio_scrubbing)); + stream.writeTextElement("DropFileOnMediaToReplace", QString::number(drop_on_media_to_replace)); stream.writeEndElement(); // configuration stream.writeEndDocument(); // doc diff --git a/io/config.h b/io/config.h index 5addb63ce..a8a7cddab 100644 --- a/io/config.h +++ b/io/config.h @@ -34,6 +34,7 @@ struct Config { int recording_mode; bool enable_seek_to_import; bool enable_audio_scrubbing; + bool drop_on_media_to_replace; void load(QString path); void save(QString path); diff --git a/mainwindow.cpp b/mainwindow.cpp index ce3d0da38..11c5e4376 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -655,6 +655,7 @@ void MainWindow::toolMenu_About_To_Be_Shown() { ui->actionAuto_scale_by_Default->setChecked(config.autoscale_by_default); ui->actionEnable_Seek_to_Import->setChecked(config.enable_seek_to_import); ui->actionAudio_Scrubbing->setChecked(config.enable_audio_scrubbing); + ui->actionEnable_Drop_on_Media_to_Replace->setChecked(config.drop_on_media_to_replace); } void MainWindow::on_actionEdit_Tool_Selects_Links_triggered() { @@ -931,3 +932,7 @@ void MainWindow::on_actionNest_triggered() { void MainWindow::on_actionToggle_Show_All_triggered() { if (sequence != NULL) panel_timeline->toggle_show_all(); } + +void MainWindow::on_actionEnable_Drop_on_Media_to_Replace_triggered() { + config.drop_on_media_to_replace = !config.drop_on_media_to_replace; +} diff --git a/mainwindow.h b/mainwindow.h index da61a9aa9..1dd264cf8 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -201,6 +201,8 @@ private slots: void on_actionToggle_Show_All_triggered(); + void on_actionEnable_Drop_on_Media_to_Replace_triggered(); + private: Ui::MainWindow *ui; void setup_layout(); diff --git a/mainwindow.ui b/mainwindow.ui index 506187947..62492d5f4 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -33,7 +33,7 @@ 0 0 653 - 20 + 25 @@ -183,6 +183,7 @@ + @@ -857,6 +858,14 @@ \ + + + true + + + Enable Drop File on Media to Replace + + diff --git a/panels/project.cpp b/panels/project.cpp index f8ab360f8..e7da458fe 100644 --- a/panels/project.cpp +++ b/panels/project.cpp @@ -1648,7 +1648,7 @@ void update_footage_tooltip(QTreeWidgetItem *item, Media *media, QString error) if (i > 0) { tooltip += ", "; } - if (media->video_tracks.at(i)->video_interlacing != VIDEO_PROGRESSIVE) { + if (media->video_tracks.at(i)->video_interlacing == VIDEO_PROGRESSIVE) { tooltip += QString::number(media->video_tracks.at(i)->video_frame_rate); } else { tooltip += QString::number(media->video_tracks.at(i)->video_frame_rate * 2); diff --git a/ui/sourcetable.cpp b/ui/sourcetable.cpp index 78af77453..3fd930719 100644 --- a/ui/sourcetable.cpp +++ b/ui/sourcetable.cpp @@ -9,6 +9,7 @@ #include "project/undo.h" #include "project/sequence.h" #include "mainwindow.h" +#include "io/config.h" #include #include @@ -237,6 +238,7 @@ void SourceTable::dropEvent(QDropEvent* event) { && drop_item != NULL && get_type_from_tree(drop_item) == MEDIA_TYPE_FOOTAGE && !QFileInfo(paths.at(0)).isDir() + && config.drop_on_media_to_replace && QMessageBox::question(this, "Replace Media", "You dropped a file onto '" + drop_item->text(0) + "'. Would you like to replace it with the dropped file?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { replace = true; panel_project->replace_media(drop_item, paths.at(0));