diff --git a/debian/gitfromlog.sh b/debian/gitfromlog.sh index 90c0175fa..726fd4e95 100644 --- a/debian/gitfromlog.sh +++ b/debian/gitfromlog.sh @@ -1,3 +1,3 @@ # A simple script to extract the Git hash from an auto-generated debian/changelog -grep -Po '(?<=-)(([a-z0-9])\w+)(?=\+)' $1 \ No newline at end of file +grep -Po '(?<=-)(([a-z0-9])\w+)(?=\+)' -m 1 $1 \ No newline at end of file diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index 5e9f3adc5..9a02a5a7a 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include KeySequenceEditor::KeySequenceEditor(QWidget* parent, QAction* a) @@ -193,8 +194,8 @@ void PreferencesDialog::save() { int ret = QMessageBox::question(this, "Restart Required", - "Some of the changed settings will require a restart of Olive. Would you like to" - "restart now?", + "Some of the changed settings will require a restart of Olive. Would you like " + "to restart now?", QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); if (ret == QMessageBox::Cancel) { @@ -283,7 +284,16 @@ void PreferencesDialog::save() { init_audio(); } - accept(); + accept(); + + if (restart_after_saving) { + // since we already ran can_close_project(), bypass checking again by running setWindowModified(false) + Olive::MainWindow->setWindowModified(false); + + Olive::MainWindow->close(); + + QProcess::startDetached(QApplication::applicationFilePath(), { Olive::ActiveProjectFilename }); + } } void PreferencesDialog::reset_default_shortcut() { diff --git a/mainwindow.cpp b/mainwindow.cpp index b50556672..eb6511e29 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -810,8 +810,8 @@ void MainWindow::paintEvent(QPaintEvent *event) { QMainWindow::paintEvent(event); if (first_show) { - emit finished_first_paint(); first_show = false; + emit finished_first_paint(); } }