diff --git a/src/docks/encodedock.cpp b/src/docks/encodedock.cpp index 14867642cc..7011af66dc 100755 --- a/src/docks/encodedock.cpp +++ b/src/docks/encodedock.cpp @@ -2766,22 +2766,36 @@ void EncodeDock::on_reframeButton_clicked() void EncodeDock::on_resampleButton_clicked(bool checked) { - if (checked) { - QMessageBox dialog(QMessageBox::Warning, + if (!Settings.askResample() || ("clip" == ui->fromCombo->currentData().toString() && !MLT.profile().is_explicit())) { + setResampleEnabled(checked); + } else if (checked) { + QMessageBox dialog(QMessageBox::Question, tr("Resample Export"), - tr("

Resample is for experts and may not do what you expect.

" - "

Do you want to change Video Mode in the Settings menu?

"), + tr("

Are you sure you want to resample instead of change the Video Mode?

" + "

Changing the aspect ratio adds black bars.

" + "

Increasing resolution or frame rate is limited by Video Mode.

"), QMessageBox::No | QMessageBox::Yes, this); + dialog.addButton(tr("Open Settings > Video Mode"), QMessageBox::ResetRole); dialog.setDefaultButton(QMessageBox::Yes); - dialog.setEscapeButton(QMessageBox::Yes); + dialog.setEscapeButton(QMessageBox::Cancel); dialog.setWindowModality(QmlApplication::dialogModality()); - if (QMessageBox::No == dialog.exec()) { + dialog.setCheckBox(new QCheckBox(tr("Do not show this anymore.", + "Resample export warning dialog"))); + switch (dialog.exec()) { + case QMessageBox::Accepted: setResampleEnabled(checked); - } else { + break; + case QMessageBox::No: + ui->resampleButton->setChecked(false); + break; + default: ui->resampleButton->setChecked(false); MAIN.showSettingsMenu(); + break; } + if (dialog.checkBox()->isChecked()) + Settings.setAskResample(false); } else { setResampleEnabled(false); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 83552b5bac..e2cff06872 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3989,7 +3989,7 @@ void MainWindow::backupPeriodically() bool MainWindow::confirmProfileChange() { - if (MLT.isClip()) + if (MLT.isClip() || !Settings.askChangeVideoMode()) return true; QMessageBox dialog(QMessageBox::Warning, @@ -4003,7 +4003,12 @@ bool MainWindow::confirmProfileChange() dialog.setWindowModality(QmlApplication::dialogModality()); dialog.setDefaultButton(QMessageBox::Yes); dialog.setEscapeButton(QMessageBox::No); - return QMessageBox::Yes == dialog.exec(); + dialog.setCheckBox(new QCheckBox(tr("Do not show this anymore.", + "Change video mode warning dialog"))); + auto result = QMessageBox::Yes == dialog.exec(); + if (dialog.checkBox()->isChecked()) + Settings.setAskChangeVideoMode(false); + return result; } void MainWindow::on_actionSystemTheme_triggered() @@ -5434,5 +5439,4 @@ void MainWindow::showSettingsMenu() const point = ui->menuBar->mapToGlobal(point); #endif ui->menuSettings->popup(point, ui->menuSettings->defaultAction()); - } diff --git a/src/settings.cpp b/src/settings.cpp index c0cfb3bb8c..2dbeff73b2 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -389,6 +389,16 @@ void ShotcutSettings::setEncodeParallelProcessing(bool b) settings.setValue("encode/parallelProcessing", b); } +bool ShotcutSettings::askResample() const +{ + return settings.value("encode/askResample", true).toBool(); +} + +void ShotcutSettings::setAskResample(bool b) +{ + settings.setValue("encode/askResample", b); +} + int ShotcutSettings::playerAudioChannels() const { return settings.value("player/audioChannels", 2).toInt(); @@ -955,6 +965,16 @@ void ShotcutSettings::setAskUpgradeAutomatic(bool b) settings.setValue("askUpgradeAutmatic", b); } +bool ShotcutSettings::askChangeVideoMode() +{ + return settings.value("askChangeVideoMode", true).toBool(); +} + +void ShotcutSettings::setAskChangeVideoMode(bool b) +{ + settings.setValue("askChangeVideoMode", b); +} + void ShotcutSettings::sync() { settings.sync(); diff --git a/src/settings.h b/src/settings.h index 4f9f62e33c..64716442fe 100644 --- a/src/settings.h +++ b/src/settings.h @@ -139,6 +139,8 @@ class ShotcutSettings : public QObject void setShowConvertClipDialog(bool); bool encodeParallelProcessing() const; void setEncodeParallelProcessing(bool); + bool askResample() const; + void setAskResample(bool); // player int playerAudioChannels() const; @@ -257,6 +259,8 @@ class ShotcutSettings : public QObject void setCheckUpgradeAutomatic(bool b); bool askUpgradeAutomatic(); void setAskUpgradeAutomatic(bool b); + bool askChangeVideoMode(); + void setAskChangeVideoMode(bool b); void sync(); QString appDataLocation() const;