Some improvements in preferences dialog.

This commit is contained in:
LoRd_MuldeR 2013-08-09 13:41:02 +02:00
parent cb554dd5eb
commit 28e82ea1a5
3 changed files with 35 additions and 19 deletions

View File

@ -22,7 +22,7 @@
#define VER_X264_MAJOR 2 #define VER_X264_MAJOR 2
#define VER_X264_MINOR 1 #define VER_X264_MINOR 1
#define VER_X264_PATCH 9 #define VER_X264_PATCH 9
#define VER_X264_BUILD 560 #define VER_X264_BUILD 564
#define VER_X264_MINIMUM_REV 2339 #define VER_X264_MINIMUM_REV 2339
#define VER_X264_CURRENT_API 135 #define VER_X264_CURRENT_API 135

View File

@ -29,10 +29,12 @@
#include <QMouseEvent> #include <QMouseEvent>
#include <QMessageBox> #include <QMessageBox>
#define UPDATE_CHECKBOX(CHKBOX, VALUE) \ #define UPDATE_CHECKBOX(CHKBOX, VALUE, BLOCK) \
{ \ { \
if((BLOCK)) { (CHKBOX)->blockSignals(true); } \
if((CHKBOX)->isChecked() != (VALUE)) (CHKBOX)->click(); \ if((CHKBOX)->isChecked() != (VALUE)) (CHKBOX)->click(); \
if((CHKBOX)->isChecked() != (VALUE)) (CHKBOX)->setChecked(VALUE); \ if((CHKBOX)->isChecked() != (VALUE)) (CHKBOX)->setChecked(VALUE); \
if((BLOCK)) { (CHKBOX)->blockSignals(false); } \
} }
PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferences, bool x64) PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferences, bool x64)
@ -61,6 +63,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferen
connect(resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed())); connect(resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed()));
connect(checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool))); connect(checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool)));
connect(checkDisableWarnings, SIGNAL(toggled(bool)), this, SLOT(disableWarningsToggled(bool)));
m_preferences = preferences; m_preferences = preferences;
} }
@ -73,17 +76,14 @@ void PreferencesDialog::showEvent(QShowEvent *event)
{ {
if(event) QDialog::showEvent(event); if(event) QDialog::showEvent(event);
UPDATE_CHECKBOX(checkRunNextJob, m_preferences->autoRunNextJob()); UPDATE_CHECKBOX(checkRunNextJob, m_preferences->autoRunNextJob(), false);
UPDATE_CHECKBOX(checkShutdownComputer, m_preferences->shutdownComputer()); UPDATE_CHECKBOX(checkShutdownComputer, m_preferences->shutdownComputer(), false);
UPDATE_CHECKBOX(checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit()); UPDATE_CHECKBOX(checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit(), false);
UPDATE_CHECKBOX(checkSaveLogFiles, m_preferences->saveLogFiles()); UPDATE_CHECKBOX(checkSaveLogFiles, m_preferences->saveLogFiles(), false);
UPDATE_CHECKBOX(checkSaveToSourceFolder, m_preferences->saveToSourcePath()); UPDATE_CHECKBOX(checkSaveToSourceFolder, m_preferences->saveToSourcePath(), false);
UPDATE_CHECKBOX(checkEnableSounds, m_preferences->enableSounds()); UPDATE_CHECKBOX(checkEnableSounds, m_preferences->enableSounds(), false);
UPDATE_CHECKBOX(checkDisableWarnings, m_preferences->disableWarnings()); UPDATE_CHECKBOX(checkDisableWarnings, m_preferences->disableWarnings(), true);
UPDATE_CHECKBOX(checkUse10BitEncoding, m_preferences->use10BitEncoding(), true);
checkUse10BitEncoding->blockSignals(true);
UPDATE_CHECKBOX(checkUse10BitEncoding, m_preferences->use10BitEncoding());
checkUse10BitEncoding->blockSignals(false);
spinBoxJobCount->setValue(m_preferences->maxRunningJobCount()); spinBoxJobCount->setValue(m_preferences->maxRunningJobCount());
comboBoxPriority->setCurrentIndex(qBound(0, m_preferences->processPriority(), comboBoxPriority->count()-1)); comboBoxPriority->setCurrentIndex(qBound(0, m_preferences->processPriority(), comboBoxPriority->count()-1));
@ -153,13 +153,28 @@ void PreferencesDialog::use10BitEncodingToggled(bool checked)
if(checked) if(checked)
{ {
QString text; QString text;
text += tr("<nobr>Please note that 10&minus;Bit H.264 streams are <b>not</b> currently supported by hardware (standalone) players!</nobr><br>"); text += QString("<nobr>%1</nobr><br>").arg(tr("Please note that 10&minus;Bit H.264 streams are <b>not</b> currently supported by hardware (standalone) players!"));
text += tr("<nobr>To play such streams, you will need an <i>up&minus;to&minus;date</i> ffdshow&minus;tryouts, CoreAVC 3.x or another supported s/w decoder.</nobr><br>"); text += QString("<nobr>%1</nobr><br>").arg(tr("To play such streams, you will need an <i>up&minus;to&minus;date</i> ffdshow&minus;tryouts, CoreAVC 3.x or another supported s/w decoder."));
text += tr("<nobr>Also be aware that hardware&minus;acceleration (CUDA, DXVA, etc) usually will <b>not</b> work with 10&minus;Bit H.264 streams.</nobr><br>"); text += QString("<nobr>%1</nobr><br>").arg(tr("Also be aware that hardware&minus;acceleration (CUDA, DXVA, etc) usually will <b>not</b> work with 10&minus;Bit H.264 streams."));
if(QMessageBox::warning(this, tr("10-Bit Encoding"), text, tr("Continue"), tr("Revert"), QString(), 1) != 0) if(QMessageBox::warning(this, tr("10-Bit Encoding"), text.replace("-", "&minus;"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
{ {
UPDATE_CHECKBOX(checkUse10BitEncoding, false); UPDATE_CHECKBOX(checkUse10BitEncoding, false, true);
}
}
}
void PreferencesDialog::disableWarningsToggled(bool checked)
{
if(checked)
{
QString text;
text += QString("<nobr>%1</nobr><br>").arg(tr("Please note that Avisynth and/or VapourSynth support might be unavailable <b>without</b> any notice!"));
text += QString("<nobr>%1</nobr><br>").arg(tr("Also note that the CLI option <tt>--console</tt> may be used to get more diagnostic infomation."));
if(QMessageBox::warning(this, tr("Avisynth/VapourSynth Warnings"), text.replace("-", "&minus;"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
{
UPDATE_CHECKBOX(checkDisableWarnings, false, true);
} }
} }
} }

View File

@ -48,4 +48,5 @@ private:
private slots: private slots:
void resetButtonPressed(void); void resetButtonPressed(void);
void use10BitEncodingToggled(bool checked); void use10BitEncodingToggled(bool checked);
void disableWarningsToggled(bool checked);
}; };