diff --git a/main.cpp b/main.cpp index e24fe6a3e..2b0d7ddd0 100644 --- a/main.cpp +++ b/main.cpp @@ -10,6 +10,8 @@ int main(int argc, char *argv[]) // init ffmpeg subsystem av_register_all(); + QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); + QApplication a(argc, argv); MainWindow w; w.show(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 33f303884..f352db73d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -110,7 +110,7 @@ MainWindow::MainWindow(QWidget *parent) : panel_project->load_project(); } } - autorecovery_timer.setInterval(60000); + autorecovery_timer.setInterval(10000); QObject::connect(&autorecovery_timer, SIGNAL(timeout()), this, SLOT(autorecover_interval())); autorecovery_timer.start(); @@ -291,13 +291,13 @@ void MainWindow::on_action_Paste_triggered() } void MainWindow::autorecover_interval() { - if (!project_changed) { + if (project_changed) { QString old_filename = project_url; project_url = autorecovery_filename; panel_project->save_project(); qDebug() << "[INFO] Auto-recovery project saved"; project_url = old_filename; - project_changed = false; + project_changed = true; } } diff --git a/panels/project.cpp b/panels/project.cpp index 28fe01996..1f25e6a01 100644 --- a/panels/project.cpp +++ b/panels/project.cpp @@ -198,8 +198,9 @@ void Project::delete_selected_media() { confirm.setWindowTitle("Delete media in use?"); confirm.setText("The media '" + media->name + "' is currently used in '" + s->name + "'. Deleting it will remove all instances in the sequence. Are you sure you want to do this?"); QAbstractButton* yes_button = confirm.addButton(QMessageBox::Yes); - QAbstractButton* skip_button = confirm.addButton("Skip", QMessageBox::NoRole); - QAbstractButton* abort_button = confirm.addButton(QMessageBox::Abort); + QAbstractButton* skip_button = NULL; + if (items.size() > 1) skip_button = confirm.addButton("Skip", QMessageBox::NoRole); + QAbstractButton* abort_button = confirm.addButton(QMessageBox::Cancel); confirm.exec(); if (confirm.clickedButton() == yes_button) { // remove all clips referencing this media @@ -885,7 +886,7 @@ void Project::add_recent_project(QString url) { #define THROBBER_LIMIT 20 #define THROBBER_SIZE 50 -MediaThrobber::MediaThrobber(QTreeWidgetItem* i) : pixmap(":/icons/throbber.png"), item(i), animation(0) { +MediaThrobber::MediaThrobber(QTreeWidgetItem* i) : pixmap(":/icons/throbber.png"), animation(0), item(i) { // set up throbber animation_update(); animator.setInterval(20); diff --git a/panels/timeline.cpp b/panels/timeline.cpp index 2c434642d..391dd4ed1 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -77,7 +77,7 @@ void Timeline::go_to_start() { } void Timeline::previous_frame() { - seek(playhead-1); + if (playhead > 0) seek(playhead-1); } void Timeline::next_frame() {