diff --git a/src/model_options.cpp b/src/model_options.cpp index b8da7bb..082571c 100644 --- a/src/model_options.cpp +++ b/src/model_options.cpp @@ -178,6 +178,14 @@ bool OptionsModel::loadTemplate(OptionsModel *model, const QString &name) settings.sync(); } } + if(settings.value(KEY_PROFILE_NAME).toString().compare("auto", Qt::CaseInsensitive) == 0) + { + settings.setValue(KEY_PROFILE_NAME, QString::fromLatin1(OptionsModel::PROFILE_UNRESTRICTED)); + } + if(settings.value(KEY_TUNING_NAME).toString().compare("none", Qt::CaseInsensitive) == 0) + { + settings.setValue(KEY_TUNING_NAME, QString::fromLatin1(OptionsModel::TUNING_UNSPECIFIED)); + } bool complete = true; diff --git a/src/version.h b/src/version.h index 2adccc5..984a2ad 100644 --- a/src/version.h +++ b/src/version.h @@ -25,8 +25,8 @@ #define VER_X264_MAJOR 2 #define VER_X264_MINOR 3 -#define VER_X264_PATCH 5 -#define VER_X264_BUILD 821 +#define VER_X264_PATCH 6 +#define VER_X264_BUILD 824 #define VER_X264_PORTABLE_EDITION (0) diff --git a/src/win_addJob.cpp b/src/win_addJob.cpp index 771562a..8efb256 100644 --- a/src/win_addJob.cpp +++ b/src/win_addJob.cpp @@ -79,22 +79,6 @@ WIDGET->addAction(_action); \ } -#define BLOCK_SIGNALS(FLAG) do \ -{ \ - ui->cbxEncoderType->blockSignals(FLAG); \ - ui->cbxEncoderArch->blockSignals(FLAG); \ - ui->cbxEncoderVariant->blockSignals(FLAG); \ - ui->cbxRateControlMode->blockSignals(FLAG); \ - ui->spinQuantizer->blockSignals(FLAG); \ - ui->spinBitrate->blockSignals(FLAG); \ - ui->cbxPreset->blockSignals(FLAG); \ - ui->cbxTuning->blockSignals(FLAG); \ - ui->cbxProfile->blockSignals(FLAG); \ - ui->editCustomX264Params->blockSignals(FLAG); \ - ui->editCustomAvs2YUVParams->blockSignals(FLAG); \ -} \ -while(0) - Q_DECLARE_METATYPE(const void*) /////////////////////////////////////////////////////////////////////////////// @@ -231,12 +215,13 @@ AddJobDialog::AddJobDialog(QWidget *parent, OptionsModel *const options, Recentl m_sysinfo(sysinfo), m_preferences(preferences), m_defaults(new OptionsModel(sysinfo)), - ui(new Ui::AddJobDialog()) + ui(new Ui::AddJobDialog()), + m_monitorConfigChanges(true) { //Init the dialog, from the .ui file ui->setupUi(this); setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint)); - + //Fix dialog size ui->buttonSaveTemplate->setMaximumHeight(20); ui->buttonDeleteTemplate->setMaximumHeight(20); @@ -668,11 +653,16 @@ void AddJobDialog::browseButtonClicked(void) void AddJobDialog::configurationChanged(void) { + if(!m_monitorConfigChanges) + { + return; + } + const OptionsModel* options = reinterpret_cast(ui->cbxTemplate->itemData(ui->cbxTemplate->currentIndex()).value()); if(options) { ui->cbxTemplate->blockSignals(true); - ui->cbxTemplate->insertItem(0, tr(""), QVariant::fromValue(NULL)); + ui->cbxTemplate->insertItem(0, tr(""), QVariant::fromValue(NULL)); ui->cbxTemplate->setCurrentIndex(0); ui->cbxTemplate->blockSignals(false); } @@ -726,7 +716,7 @@ void AddJobDialog::saveTemplateButtonClicked(void) { if(options->equals(test)) { - QMessageBox::warning (this, tr("Oups"), tr("There already is a template for the current settings!")); + QMessageBox::information (this, tr("Oups"), tr("The current settings are already saved as template:
%1
").arg(ui->cbxTemplate->itemText(i))); ui->cbxTemplate->blockSignals(true); ui->cbxTemplate->setCurrentIndex(i); ui->cbxTemplate->blockSignals(false); @@ -825,13 +815,12 @@ void AddJobDialog::deleteTemplateButtonClicked(void) return; } - int ret = QMessageBox::question (this, tr("Delete Template"), tr("Do you really want to delete the selected template?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + int ret = QMessageBox::question (this, tr("Delete Template"), tr("Do you really want to delete the selected template?
%1
").arg(name), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if(ret != QMessageBox::Yes) { return; } - - + OptionsModel::deleteTemplate(name); const OptionsModel *item = reinterpret_cast(ui->cbxTemplate->itemData(index).value()); ui->cbxTemplate->removeItem(index); @@ -977,24 +966,26 @@ void AddJobDialog::updateComboBox(QComboBox *cbox, const QString &text) void AddJobDialog::restoreOptions(const OptionsModel *options) { - BLOCK_SIGNALS(false); + //Ignore config changes while restoring template! + m_monitorConfigChanges = false; - ui->cbxEncoderType->setCurrentIndex(options->encType()); - ui->cbxEncoderArch->setCurrentIndex(options->encArch()); - ui->cbxEncoderVariant->setCurrentIndex(options->encVariant()); + ui->cbxEncoderType ->setCurrentIndex(options->encType()); + ui->cbxEncoderArch ->setCurrentIndex(options->encArch()); + ui->cbxEncoderVariant ->setCurrentIndex(options->encVariant()); ui->cbxRateControlMode->setCurrentIndex(options->rcMode()); - BLOCK_SIGNALS(true); - ui->spinQuantizer->setValue(options->quantizer()); - ui->spinBitrate->setValue(options->bitrate()); - updateComboBox(ui->cbxPreset, options->preset()); - updateComboBox(ui->cbxTuning, options->tune()); + ui->spinBitrate ->setValue(options->bitrate()); + + updateComboBox(ui->cbxPreset, options->preset()); + updateComboBox(ui->cbxTuning, options->tune()); updateComboBox(ui->cbxProfile, options->profile()); - ui->editCustomX264Params->setText(options->customEncParams()); + + ui->editCustomX264Params ->setText(options->customEncParams()); ui->editCustomAvs2YUVParams->setText(options->customAvs2YUV()); - BLOCK_SIGNALS(false); + //Make sure we will monitor config changes again! + m_monitorConfigChanges = true; } void AddJobDialog::saveOptions(OptionsModel *options) diff --git a/src/win_addJob.h b/src/win_addJob.h index 58362ad..1dac6ca 100644 --- a/src/win_addJob.h +++ b/src/win_addJob.h @@ -91,6 +91,7 @@ private slots: private: Ui::AddJobDialog *const ui; + bool m_monitorConfigChanges; void loadTemplateList(void); void restoreOptions(const OptionsModel *options);