Switched the method for including the UIC header files to "Using a Pointer Member Variable".
This commit is contained in:
parent
aca377916b
commit
2c97d55729
@ -24,7 +24,7 @@
|
|||||||
#include "taskbar7.h"
|
#include "taskbar7.h"
|
||||||
|
|
||||||
//Qt includes
|
//Qt includes
|
||||||
#include <QCoreApplication>
|
#include <QApplication>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QPlastiqueStyle>
|
#include <QPlastiqueStyle>
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ QMutex EncodeThread::m_mutex_startProcess;
|
|||||||
/*
|
/*
|
||||||
* RAII execution state handler
|
* RAII execution state handler
|
||||||
*/
|
*/
|
||||||
static class ExecutionStateHandler
|
class ExecutionStateHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ExecutionStateHandler(void)
|
ExecutionStateHandler(void)
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#define VER_X264_MAJOR 2
|
#define VER_X264_MAJOR 2
|
||||||
#define VER_X264_MINOR 2
|
#define VER_X264_MINOR 2
|
||||||
#define VER_X264_PATCH 6
|
#define VER_X264_PATCH 6
|
||||||
#define VER_X264_BUILD 630
|
#define VER_X264_BUILD 638
|
||||||
|
|
||||||
#define VER_X264_MINIMUM_REV 2363
|
#define VER_X264_MINIMUM_REV 2363
|
||||||
#define VER_X264_CURRENT_API 140
|
#define VER_X264_CURRENT_API 140
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "win_addJob.h"
|
#include "win_addJob.h"
|
||||||
|
#include "uic_win_addJob.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "model_options.h"
|
#include "model_options.h"
|
||||||
@ -47,14 +48,14 @@
|
|||||||
|
|
||||||
#define REMOVE_USAFED_ITEM \
|
#define REMOVE_USAFED_ITEM \
|
||||||
{ \
|
{ \
|
||||||
for(int i = 0; i < cbxTemplate->count(); i++) \
|
for(int i = 0; i < ui->cbxTemplate->count(); i++) \
|
||||||
{ \
|
{ \
|
||||||
OptionsModel* temp = reinterpret_cast<OptionsModel*>(cbxTemplate->itemData(i).value<void*>()); \
|
OptionsModel* temp = reinterpret_cast<OptionsModel*>(ui->cbxTemplate->itemData(i).value<void*>()); \
|
||||||
if(temp == NULL) \
|
if(temp == NULL) \
|
||||||
{ \
|
{ \
|
||||||
cbxTemplate->blockSignals(true); \
|
ui->cbxTemplate->blockSignals(true); \
|
||||||
cbxTemplate->removeItem(i); \
|
ui->cbxTemplate->removeItem(i); \
|
||||||
cbxTemplate->blockSignals(false); \
|
ui->cbxTemplate->blockSignals(false); \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -209,95 +210,97 @@ AddJobDialog::AddJobDialog(QWidget *parent, OptionsModel *options, RecentlyUsed
|
|||||||
m_x64supported(x64supported),
|
m_x64supported(x64supported),
|
||||||
m_use10BitEncoding(use10BitEncoding),
|
m_use10BitEncoding(use10BitEncoding),
|
||||||
m_saveToSourceFolder(saveToSourceFolder),
|
m_saveToSourceFolder(saveToSourceFolder),
|
||||||
m_recentlyUsed(recentlyUsed)
|
m_recentlyUsed(recentlyUsed),
|
||||||
|
ui(new Ui::AddJobDialog())
|
||||||
{
|
{
|
||||||
//Init the dialog, from the .ui file
|
//Init the dialog, from the .ui file
|
||||||
setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
||||||
|
|
||||||
//Fix dialog size
|
//Fix dialog size
|
||||||
buttonSaveTemplate->setMaximumHeight(20);
|
ui->buttonSaveTemplate->setMaximumHeight(20);
|
||||||
buttonDeleteTemplate->setMaximumHeight(20);
|
ui->buttonDeleteTemplate->setMaximumHeight(20);
|
||||||
resize(width(), minimumHeight());
|
resize(width(), minimumHeight());
|
||||||
setMinimumSize(size());
|
setMinimumSize(size());
|
||||||
setMaximumHeight(height());
|
setMaximumHeight(height());
|
||||||
|
|
||||||
//Hide optional controls
|
//Hide optional controls
|
||||||
checkBoxApplyToAll->setVisible(false);
|
ui->checkBoxApplyToAll->setVisible(false);
|
||||||
|
|
||||||
//Monitor RC mode combobox
|
//Monitor RC mode combobox
|
||||||
connect(cbxRateControlMode, SIGNAL(currentIndexChanged(int)), this, SLOT(modeIndexChanged(int)));
|
connect(ui->cbxRateControlMode, SIGNAL(currentIndexChanged(int)), this, SLOT(modeIndexChanged(int)));
|
||||||
|
|
||||||
//Activate buttons
|
//Activate buttons
|
||||||
connect(buttonBrowseSource, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
|
connect(ui->buttonBrowseSource, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
|
||||||
connect(buttonBrowseOutput, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
|
connect(ui->buttonBrowseOutput, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
|
||||||
connect(buttonSaveTemplate, SIGNAL(clicked()), this, SLOT(saveTemplateButtonClicked()));
|
connect(ui->buttonSaveTemplate, SIGNAL(clicked()), this, SLOT(saveTemplateButtonClicked()));
|
||||||
connect(buttonDeleteTemplate, SIGNAL(clicked()), this, SLOT(deleteTemplateButtonClicked()));
|
connect(ui->buttonDeleteTemplate, SIGNAL(clicked()), this, SLOT(deleteTemplateButtonClicked()));
|
||||||
|
|
||||||
//Setup validator
|
//Setup validator
|
||||||
editCustomX264Params->installEventFilter(this);
|
ui->editCustomX264Params->installEventFilter(this);
|
||||||
editCustomX264Params->setValidator(new StringValidatorX264(labelNotificationX264, iconNotificationX264));
|
ui->editCustomX264Params->setValidator(new StringValidatorX264(ui->labelNotificationX264, ui->iconNotificationX264));
|
||||||
editCustomX264Params->clear();
|
ui->editCustomX264Params->clear();
|
||||||
editCustomAvs2YUVParams->installEventFilter(this);
|
ui->editCustomAvs2YUVParams->installEventFilter(this);
|
||||||
editCustomAvs2YUVParams->setValidator(new StringValidatorAvs2YUV(labelNotificationAvs2YUV, iconNotificationAvs2YUV));
|
ui->editCustomAvs2YUVParams->setValidator(new StringValidatorAvs2YUV(ui->labelNotificationAvs2YUV, ui->iconNotificationAvs2YUV));
|
||||||
editCustomAvs2YUVParams->clear();
|
ui->editCustomAvs2YUVParams->clear();
|
||||||
|
|
||||||
//Install event filter
|
//Install event filter
|
||||||
labelHelpScreenX264->installEventFilter(this);
|
ui->labelHelpScreenX264->installEventFilter(this);
|
||||||
labelHelpScreenAvs2YUV->installEventFilter(this);
|
ui->labelHelpScreenAvs2YUV->installEventFilter(this);
|
||||||
|
|
||||||
//Monitor for options changes
|
//Monitor for options changes
|
||||||
connect(cbxRateControlMode, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
connect(ui->cbxRateControlMode, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
||||||
connect(spinQuantizer, SIGNAL(valueChanged(double)), this, SLOT(configurationChanged()));
|
connect(ui->spinQuantizer, SIGNAL(valueChanged(double)), this, SLOT(configurationChanged()));
|
||||||
connect(spinBitrate, SIGNAL(valueChanged(int)), this, SLOT(configurationChanged()));
|
connect(ui->spinBitrate, SIGNAL(valueChanged(int)), this, SLOT(configurationChanged()));
|
||||||
connect(cbxPreset, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
connect(ui->cbxPreset, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
||||||
connect(cbxTuning, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
connect(ui->cbxTuning, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
||||||
connect(cbxProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
connect(ui->cbxProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged()));
|
||||||
connect(editCustomX264Params, SIGNAL(textChanged(QString)), this, SLOT(configurationChanged()));
|
connect(ui->editCustomX264Params, SIGNAL(textChanged(QString)), this, SLOT(configurationChanged()));
|
||||||
connect(editCustomAvs2YUVParams, SIGNAL(textChanged(QString)), this, SLOT(configurationChanged()));
|
connect(ui->editCustomAvs2YUVParams, SIGNAL(textChanged(QString)), this, SLOT(configurationChanged()));
|
||||||
|
|
||||||
//Create context menus
|
//Create context menus
|
||||||
ADD_CONTEXTMENU_ACTION(editCustomX264Params, QIcon(":/buttons/page_edit.png"), tr("Open the Text-Editor"), editorActionTriggered);
|
ADD_CONTEXTMENU_ACTION(ui->editCustomX264Params, QIcon(":/buttons/page_edit.png"), tr("Open the Text-Editor"), editorActionTriggered);
|
||||||
ADD_CONTEXTMENU_ACTION(editCustomAvs2YUVParams, QIcon(":/buttons/page_edit.png"), tr("Open the Text-Editor"), editorActionTriggered);
|
ADD_CONTEXTMENU_ACTION(ui->editCustomAvs2YUVParams, QIcon(":/buttons/page_edit.png"), tr("Open the Text-Editor"), editorActionTriggered);
|
||||||
ADD_CONTEXTMENU_SEPARATOR(editCustomX264Params);
|
ADD_CONTEXTMENU_SEPARATOR(ui->editCustomX264Params);
|
||||||
ADD_CONTEXTMENU_SEPARATOR(editCustomAvs2YUVParams);
|
ADD_CONTEXTMENU_SEPARATOR(ui->editCustomAvs2YUVParams);
|
||||||
ADD_CONTEXTMENU_ACTION(editCustomX264Params, QIcon(":/buttons/page_copy.png"), tr("Copy to Clipboard"), copyActionTriggered);
|
ADD_CONTEXTMENU_ACTION(ui->editCustomX264Params, QIcon(":/buttons/page_copy.png"), tr("Copy to Clipboard"), copyActionTriggered);
|
||||||
ADD_CONTEXTMENU_ACTION(editCustomAvs2YUVParams, QIcon(":/buttons/page_copy.png"), tr("Copy to Clipboard"), copyActionTriggered);
|
ADD_CONTEXTMENU_ACTION(ui->editCustomAvs2YUVParams, QIcon(":/buttons/page_copy.png"), tr("Copy to Clipboard"), copyActionTriggered);
|
||||||
ADD_CONTEXTMENU_ACTION(editCustomX264Params, QIcon(":/buttons/page_paste.png"), tr("Paste from Clipboard"), pasteActionTriggered);
|
ADD_CONTEXTMENU_ACTION(ui->editCustomX264Params, QIcon(":/buttons/page_paste.png"), tr("Paste from Clipboard"), pasteActionTriggered);
|
||||||
ADD_CONTEXTMENU_ACTION(editCustomAvs2YUVParams, QIcon(":/buttons/page_paste.png"), tr("Paste from Clipboard"), pasteActionTriggered);
|
ADD_CONTEXTMENU_ACTION(ui->editCustomAvs2YUVParams, QIcon(":/buttons/page_paste.png"), tr("Paste from Clipboard"), pasteActionTriggered);
|
||||||
|
|
||||||
//Setup template selector
|
//Setup template selector
|
||||||
loadTemplateList();
|
loadTemplateList();
|
||||||
connect(cbxTemplate, SIGNAL(currentIndexChanged(int)), this, SLOT(templateSelected()));
|
connect(ui->cbxTemplate, SIGNAL(currentIndexChanged(int)), this, SLOT(templateSelected()));
|
||||||
}
|
}
|
||||||
|
|
||||||
AddJobDialog::~AddJobDialog(void)
|
AddJobDialog::~AddJobDialog(void)
|
||||||
{
|
{
|
||||||
//Free templates
|
//Free templates
|
||||||
for(int i = 0; i < cbxTemplate->model()->rowCount(); i++)
|
for(int i = 0; i < ui->cbxTemplate->model()->rowCount(); i++)
|
||||||
{
|
{
|
||||||
if(cbxTemplate->itemText(i).startsWith("<") || cbxTemplate->itemText(i).endsWith(">"))
|
if(ui->cbxTemplate->itemText(i).startsWith("<") || ui->cbxTemplate->itemText(i).endsWith(">"))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
OptionsModel *item = reinterpret_cast<OptionsModel*>(cbxTemplate->itemData(i).value<void*>());
|
OptionsModel *item = reinterpret_cast<OptionsModel*>(ui->cbxTemplate->itemData(i).value<void*>());
|
||||||
cbxTemplate->setItemData(i, QVariant::fromValue<void*>(NULL));
|
ui->cbxTemplate->setItemData(i, QVariant::fromValue<void*>(NULL));
|
||||||
X264_DELETE(item);
|
X264_DELETE(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Free validators
|
//Free validators
|
||||||
if(const QValidator *tmp = editCustomX264Params->validator())
|
if(const QValidator *tmp = ui->editCustomX264Params->validator())
|
||||||
{
|
{
|
||||||
editCustomX264Params->setValidator(NULL);
|
ui->editCustomX264Params->setValidator(NULL);
|
||||||
X264_DELETE(tmp);
|
X264_DELETE(tmp);
|
||||||
}
|
}
|
||||||
if(const QValidator *tmp = editCustomAvs2YUVParams->validator())
|
if(const QValidator *tmp = ui->editCustomAvs2YUVParams->validator())
|
||||||
{
|
{
|
||||||
editCustomAvs2YUVParams->setValidator(NULL);
|
ui->editCustomAvs2YUVParams->setValidator(NULL);
|
||||||
X264_DELETE(tmp);
|
X264_DELETE(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
X264_DELETE(m_defaults);
|
X264_DELETE(m_defaults);
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -309,17 +312,17 @@ void AddJobDialog::showEvent(QShowEvent *event)
|
|||||||
QDialog::showEvent(event);
|
QDialog::showEvent(event);
|
||||||
templateSelected();
|
templateSelected();
|
||||||
|
|
||||||
if((!editSource->text().isEmpty()) && editOutput->text().isEmpty())
|
if((!ui->editSource->text().isEmpty()) && ui->editOutput->text().isEmpty())
|
||||||
{
|
{
|
||||||
QString outPath = generateOutputFileName(QDir::fromNativeSeparators(editSource->text()), m_recentlyUsed->outputDirectory(), m_recentlyUsed->filterIndex(), m_saveToSourceFolder);
|
QString outPath = generateOutputFileName(QDir::fromNativeSeparators(ui->editSource->text()), m_recentlyUsed->outputDirectory(), m_recentlyUsed->filterIndex(), m_saveToSourceFolder);
|
||||||
editOutput->setText(QDir::toNativeSeparators(outPath));
|
ui->editOutput->setText(QDir::toNativeSeparators(outPath));
|
||||||
buttonAccept->setFocus();
|
ui->buttonAccept->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
labelNotificationX264->hide();
|
ui->labelNotificationX264->hide();
|
||||||
iconNotificationX264->hide();
|
ui->iconNotificationX264->hide();
|
||||||
labelNotificationAvs2YUV->hide();
|
ui->labelNotificationAvs2YUV->hide();
|
||||||
iconNotificationAvs2YUV->hide();
|
ui->iconNotificationAvs2YUV->hide();
|
||||||
|
|
||||||
//Enable drag&drop support for this window, required for Qt v4.8.4+
|
//Enable drag&drop support for this window, required for Qt v4.8.4+
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
@ -327,25 +330,25 @@ void AddJobDialog::showEvent(QShowEvent *event)
|
|||||||
|
|
||||||
bool AddJobDialog::eventFilter(QObject *o, QEvent *e)
|
bool AddJobDialog::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
if((o == labelHelpScreenX264) && (e->type() == QEvent::MouseButtonPress))
|
if((o == ui->labelHelpScreenX264) && (e->type() == QEvent::MouseButtonPress))
|
||||||
{
|
{
|
||||||
HelpDialog *helpScreen = new HelpDialog(this, false, m_x64supported, m_use10BitEncoding);
|
HelpDialog *helpScreen = new HelpDialog(this, false, m_x64supported, m_use10BitEncoding);
|
||||||
helpScreen->exec();
|
helpScreen->exec();
|
||||||
X264_DELETE(helpScreen);
|
X264_DELETE(helpScreen);
|
||||||
}
|
}
|
||||||
else if((o == labelHelpScreenAvs2YUV) && (e->type() == QEvent::MouseButtonPress))
|
else if((o == ui->labelHelpScreenAvs2YUV) && (e->type() == QEvent::MouseButtonPress))
|
||||||
{
|
{
|
||||||
HelpDialog *helpScreen = new HelpDialog(this, true, m_x64supported, m_use10BitEncoding);
|
HelpDialog *helpScreen = new HelpDialog(this, true, m_x64supported, m_use10BitEncoding);
|
||||||
helpScreen->exec();
|
helpScreen->exec();
|
||||||
X264_DELETE(helpScreen);
|
X264_DELETE(helpScreen);
|
||||||
}
|
}
|
||||||
else if((o == editCustomX264Params) && (e->type() == QEvent::FocusOut))
|
else if((o == ui->editCustomX264Params) && (e->type() == QEvent::FocusOut))
|
||||||
{
|
{
|
||||||
editCustomX264Params->setText(editCustomX264Params->text().simplified());
|
ui->editCustomX264Params->setText(ui->editCustomX264Params->text().simplified());
|
||||||
}
|
}
|
||||||
else if((o == editCustomAvs2YUVParams) && (e->type() == QEvent::FocusOut))
|
else if((o == ui->editCustomAvs2YUVParams) && (e->type() == QEvent::FocusOut))
|
||||||
{
|
{
|
||||||
editCustomAvs2YUVParams->setText(editCustomAvs2YUVParams->text().simplified());
|
ui->editCustomAvs2YUVParams->setText(ui->editCustomAvs2YUVParams->text().simplified());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -395,8 +398,8 @@ void AddJobDialog::dropEvent(QDropEvent *event)
|
|||||||
if(!droppedFile.isEmpty())
|
if(!droppedFile.isEmpty())
|
||||||
{
|
{
|
||||||
const QString outFileName = generateOutputFileName(droppedFile, currentOutputPath(), currentOutputIndx(), m_saveToSourceFolder);
|
const QString outFileName = generateOutputFileName(droppedFile, currentOutputPath(), currentOutputIndx(), m_saveToSourceFolder);
|
||||||
editSource->setText(QDir::toNativeSeparators(droppedFile));
|
ui->editSource->setText(QDir::toNativeSeparators(droppedFile));
|
||||||
editOutput->setText(QDir::toNativeSeparators(outFileName));
|
ui->editOutput->setText(QDir::toNativeSeparators(outFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,19 +409,19 @@ void AddJobDialog::dropEvent(QDropEvent *event)
|
|||||||
|
|
||||||
void AddJobDialog::modeIndexChanged(int index)
|
void AddJobDialog::modeIndexChanged(int index)
|
||||||
{
|
{
|
||||||
spinQuantizer->setEnabled(index == 0 || index == 1);
|
ui->spinQuantizer->setEnabled(index == 0 || index == 1);
|
||||||
spinBitrate->setEnabled(index == 2 || index == 3);
|
ui->spinBitrate->setEnabled(index == 2 || index == 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddJobDialog::accept(void)
|
void AddJobDialog::accept(void)
|
||||||
{
|
{
|
||||||
//Selection complete?
|
//Selection complete?
|
||||||
if(editSource->text().trimmed().isEmpty())
|
if(ui->editSource->text().trimmed().isEmpty())
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this, tr("Not Found!"), tr("Please select a valid source file first!"));
|
QMessageBox::warning(this, tr("Not Found!"), tr("Please select a valid source file first!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(editOutput->text().trimmed().isEmpty())
|
if(ui->editOutput->text().trimmed().isEmpty())
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this, tr("Not Selected!"), tr("<nobr>Please select a valid output file first!</nobr>"));
|
QMessageBox::warning(this, tr("Not Selected!"), tr("<nobr>Please select a valid output file first!</nobr>"));
|
||||||
return;
|
return;
|
||||||
@ -454,7 +457,7 @@ void AddJobDialog::accept(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Custom parameters okay?
|
//Custom parameters okay?
|
||||||
if(!editCustomX264Params->hasAcceptableInput())
|
if(!ui->editCustomX264Params->hasAcceptableInput())
|
||||||
{
|
{
|
||||||
int ret = QMessageBox::warning(this, tr("Invalid Params"), tr("<nobr>Your custom parameters are invalid and will be discarded!</nobr>"), QMessageBox::Ignore | QMessageBox::Cancel, QMessageBox::Cancel);
|
int ret = QMessageBox::warning(this, tr("Invalid Params"), tr("<nobr>Your custom parameters are invalid and will be discarded!</nobr>"), QMessageBox::Ignore | QMessageBox::Cancel, QMessageBox::Cancel);
|
||||||
if(ret != QMessageBox::Ignore) return;
|
if(ret != QMessageBox::Ignore) return;
|
||||||
@ -473,17 +476,17 @@ void AddJobDialog::accept(void)
|
|||||||
|
|
||||||
void AddJobDialog::browseButtonClicked(void)
|
void AddJobDialog::browseButtonClicked(void)
|
||||||
{
|
{
|
||||||
if(QObject::sender() == buttonBrowseSource)
|
if(QObject::sender() == ui->buttonBrowseSource)
|
||||||
{
|
{
|
||||||
QString filePath = QFileDialog::getOpenFileName(this, tr("Open Source File"), currentSourcePath(true), getInputFilterLst(), NULL, QFileDialog::DontUseNativeDialog);
|
QString filePath = QFileDialog::getOpenFileName(this, tr("Open Source File"), currentSourcePath(true), getInputFilterLst(), NULL, QFileDialog::DontUseNativeDialog);
|
||||||
if(!(filePath.isNull() || filePath.isEmpty()))
|
if(!(filePath.isNull() || filePath.isEmpty()))
|
||||||
{
|
{
|
||||||
QString destFile = generateOutputFileName(filePath, currentOutputPath(), currentOutputIndx(), m_saveToSourceFolder);
|
QString destFile = generateOutputFileName(filePath, currentOutputPath(), currentOutputIndx(), m_saveToSourceFolder);
|
||||||
editSource->setText(QDir::toNativeSeparators(filePath));
|
ui->editSource->setText(QDir::toNativeSeparators(filePath));
|
||||||
editOutput->setText(QDir::toNativeSeparators(destFile));
|
ui->editOutput->setText(QDir::toNativeSeparators(destFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(QObject::sender() == buttonBrowseOutput)
|
else if(QObject::sender() == ui->buttonBrowseOutput)
|
||||||
{
|
{
|
||||||
QString selectedType = getFilterStr(currentOutputIndx());
|
QString selectedType = getFilterStr(currentOutputIndx());
|
||||||
QString filePath = QFileDialog::getSaveFileName(this, tr("Choose Output File"), currentOutputPath(true), getFilterLst(), &selectedType, QFileDialog::DontUseNativeDialog | QFileDialog::DontConfirmOverwrite);
|
QString filePath = QFileDialog::getSaveFileName(this, tr("Choose Output File"), currentOutputPath(true), getFilterLst(), &selectedType, QFileDialog::DontUseNativeDialog | QFileDialog::DontConfirmOverwrite);
|
||||||
@ -504,26 +507,26 @@ void AddJobDialog::browseButtonClicked(void)
|
|||||||
}
|
}
|
||||||
filePath = QString("%1.%2").arg(filePath, getFilterExt(tempIndex));
|
filePath = QString("%1.%2").arg(filePath, getFilterExt(tempIndex));
|
||||||
}
|
}
|
||||||
editOutput->setText(QDir::toNativeSeparators(filePath));
|
ui->editOutput->setText(QDir::toNativeSeparators(filePath));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddJobDialog::configurationChanged(void)
|
void AddJobDialog::configurationChanged(void)
|
||||||
{
|
{
|
||||||
OptionsModel* options = reinterpret_cast<OptionsModel*>(cbxTemplate->itemData(cbxTemplate->currentIndex()).value<void*>());
|
OptionsModel* options = reinterpret_cast<OptionsModel*>(ui->cbxTemplate->itemData(ui->cbxTemplate->currentIndex()).value<void*>());
|
||||||
if(options)
|
if(options)
|
||||||
{
|
{
|
||||||
cbxTemplate->blockSignals(true);
|
ui->cbxTemplate->blockSignals(true);
|
||||||
cbxTemplate->insertItem(0, tr("<Unsaved Configuration>"), QVariant::fromValue<void*>(NULL));
|
ui->cbxTemplate->insertItem(0, tr("<Unsaved Configuration>"), QVariant::fromValue<void*>(NULL));
|
||||||
cbxTemplate->setCurrentIndex(0);
|
ui->cbxTemplate->setCurrentIndex(0);
|
||||||
cbxTemplate->blockSignals(false);
|
ui->cbxTemplate->blockSignals(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddJobDialog::templateSelected(void)
|
void AddJobDialog::templateSelected(void)
|
||||||
{
|
{
|
||||||
OptionsModel* options = reinterpret_cast<OptionsModel*>(cbxTemplate->itemData(cbxTemplate->currentIndex()).value<void*>());
|
OptionsModel* options = reinterpret_cast<OptionsModel*>(ui->cbxTemplate->itemData(ui->cbxTemplate->currentIndex()).value<void*>());
|
||||||
if(options)
|
if(options)
|
||||||
{
|
{
|
||||||
qDebug("Loading options!");
|
qDebug("Loading options!");
|
||||||
@ -531,7 +534,7 @@ void AddJobDialog::templateSelected(void)
|
|||||||
restoreOptions(options);
|
restoreOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
modeIndexChanged(cbxRateControlMode->currentIndex());
|
modeIndexChanged(ui->cbxRateControlMode->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddJobDialog::saveTemplateButtonClicked(void)
|
void AddJobDialog::saveTemplateButtonClicked(void)
|
||||||
@ -551,30 +554,30 @@ void AddJobDialog::saveTemplateButtonClicked(void)
|
|||||||
if(options->equals(m_defaults))
|
if(options->equals(m_defaults))
|
||||||
{
|
{
|
||||||
QMessageBox::warning (this, tr("Oups"), tr("<nobr>It makes no sense to save the default settings!</nobr>"));
|
QMessageBox::warning (this, tr("Oups"), tr("<nobr>It makes no sense to save the default settings!</nobr>"));
|
||||||
cbxTemplate->blockSignals(true);
|
ui->cbxTemplate->blockSignals(true);
|
||||||
cbxTemplate->setCurrentIndex(0);
|
ui->cbxTemplate->setCurrentIndex(0);
|
||||||
cbxTemplate->blockSignals(false);
|
ui->cbxTemplate->blockSignals(false);
|
||||||
REMOVE_USAFED_ITEM;
|
REMOVE_USAFED_ITEM;
|
||||||
X264_DELETE(options);
|
X264_DELETE(options);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < cbxTemplate->count(); i++)
|
for(int i = 0; i < ui->cbxTemplate->count(); i++)
|
||||||
{
|
{
|
||||||
const QString tempName = cbxTemplate->itemText(i);
|
const QString tempName = ui->cbxTemplate->itemText(i);
|
||||||
if(tempName.contains('<') || tempName.contains('>'))
|
if(tempName.contains('<') || tempName.contains('>'))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
OptionsModel* test = reinterpret_cast<OptionsModel*>(cbxTemplate->itemData(i).value<void*>());
|
OptionsModel* test = reinterpret_cast<OptionsModel*>(ui->cbxTemplate->itemData(i).value<void*>());
|
||||||
if(test != NULL)
|
if(test != NULL)
|
||||||
{
|
{
|
||||||
if(options->equals(test))
|
if(options->equals(test))
|
||||||
{
|
{
|
||||||
QMessageBox::warning (this, tr("Oups"), tr("<nobr>There already is a template for the current settings!</nobr>"));
|
QMessageBox::warning (this, tr("Oups"), tr("<nobr>There already is a template for the current settings!</nobr>"));
|
||||||
cbxTemplate->blockSignals(true);
|
ui->cbxTemplate->blockSignals(true);
|
||||||
cbxTemplate->setCurrentIndex(i);
|
ui->cbxTemplate->setCurrentIndex(i);
|
||||||
cbxTemplate->blockSignals(false);
|
ui->cbxTemplate->blockSignals(false);
|
||||||
REMOVE_USAFED_ITEM;
|
REMOVE_USAFED_ITEM;
|
||||||
X264_DELETE(options);
|
X264_DELETE(options);
|
||||||
return;
|
return;
|
||||||
@ -620,33 +623,33 @@ void AddJobDialog::saveTemplateButtonClicked(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = cbxTemplate->model()->rowCount();
|
int index = ui->cbxTemplate->model()->rowCount();
|
||||||
cbxTemplate->blockSignals(true);
|
ui->cbxTemplate->blockSignals(true);
|
||||||
for(int i = 0; i < cbxTemplate->count(); i++)
|
for(int i = 0; i < ui->cbxTemplate->count(); i++)
|
||||||
{
|
{
|
||||||
if(cbxTemplate->itemText(i).compare(name, Qt::CaseInsensitive) == 0)
|
if(ui->cbxTemplate->itemText(i).compare(name, Qt::CaseInsensitive) == 0)
|
||||||
{
|
{
|
||||||
index = -1; //Do not append new template
|
index = -1; //Do not append new template
|
||||||
OptionsModel *oldItem = reinterpret_cast<OptionsModel*>(cbxTemplate->itemData(i).value<void*>());
|
OptionsModel *oldItem = reinterpret_cast<OptionsModel*>(ui->cbxTemplate->itemData(i).value<void*>());
|
||||||
cbxTemplate->setItemData(i, QVariant::fromValue<void*>(options));
|
ui->cbxTemplate->setItemData(i, QVariant::fromValue<void*>(options));
|
||||||
cbxTemplate->setCurrentIndex(i);
|
ui->cbxTemplate->setCurrentIndex(i);
|
||||||
X264_DELETE(oldItem);
|
X264_DELETE(oldItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(index >= 0)
|
if(index >= 0)
|
||||||
{
|
{
|
||||||
cbxTemplate->insertItem(index, name, QVariant::fromValue<void*>(options));
|
ui->cbxTemplate->insertItem(index, name, QVariant::fromValue<void*>(options));
|
||||||
cbxTemplate->setCurrentIndex(index);
|
ui->cbxTemplate->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
cbxTemplate->blockSignals(false);
|
ui->cbxTemplate->blockSignals(false);
|
||||||
|
|
||||||
REMOVE_USAFED_ITEM;
|
REMOVE_USAFED_ITEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddJobDialog::deleteTemplateButtonClicked(void)
|
void AddJobDialog::deleteTemplateButtonClicked(void)
|
||||||
{
|
{
|
||||||
const int index = cbxTemplate->currentIndex();
|
const int index = ui->cbxTemplate->currentIndex();
|
||||||
QString name = cbxTemplate->itemText(index);
|
QString name = ui->cbxTemplate->itemText(index);
|
||||||
|
|
||||||
if(name.contains('<') || name.contains('>') || name.contains('\\') || name.contains('/'))
|
if(name.contains('<') || name.contains('>') || name.contains('\\') || name.contains('/'))
|
||||||
{
|
{
|
||||||
@ -662,8 +665,8 @@ void AddJobDialog::deleteTemplateButtonClicked(void)
|
|||||||
|
|
||||||
|
|
||||||
OptionsModel::deleteTemplate(name);
|
OptionsModel::deleteTemplate(name);
|
||||||
OptionsModel *item = reinterpret_cast<OptionsModel*>(cbxTemplate->itemData(index).value<void*>());
|
OptionsModel *item = reinterpret_cast<OptionsModel*>(ui->cbxTemplate->itemData(index).value<void*>());
|
||||||
cbxTemplate->removeItem(index);
|
ui->cbxTemplate->removeItem(index);
|
||||||
X264_DELETE(item);
|
X264_DELETE(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -714,12 +717,66 @@ void AddJobDialog::pasteActionTriggered(void)
|
|||||||
|
|
||||||
QString AddJobDialog::sourceFile(void)
|
QString AddJobDialog::sourceFile(void)
|
||||||
{
|
{
|
||||||
return QDir::fromNativeSeparators(editSource->text());
|
return QDir::fromNativeSeparators(ui->editSource->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AddJobDialog::outputFile(void)
|
QString AddJobDialog::outputFile(void)
|
||||||
{
|
{
|
||||||
return QDir::fromNativeSeparators(editOutput->text());
|
return QDir::fromNativeSeparators(ui->editOutput->text());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AddJobDialog::preset(void)
|
||||||
|
{
|
||||||
|
return ui->cbxPreset->itemText(ui->cbxPreset->currentIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AddJobDialog::tuning(void)
|
||||||
|
{
|
||||||
|
return ui->cbxTuning->itemText(ui->cbxTuning->currentIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AddJobDialog::profile(void)
|
||||||
|
{
|
||||||
|
return ui->cbxProfile->itemText(ui->cbxProfile->currentIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AddJobDialog::params(void)
|
||||||
|
{
|
||||||
|
return ui->editCustomX264Params->text().simplified();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AddJobDialog::runImmediately(void)
|
||||||
|
{
|
||||||
|
return ui->checkBoxRun->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AddJobDialog::applyToAll(void)
|
||||||
|
{
|
||||||
|
return ui->checkBoxApplyToAll->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddJobDialog::setRunImmediately(bool run)
|
||||||
|
{
|
||||||
|
ui->checkBoxRun->setChecked(run);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddJobDialog::setSourceFile(const QString &path)
|
||||||
|
{
|
||||||
|
ui->editSource->setText(QDir::toNativeSeparators(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddJobDialog::setOutputFile(const QString &path)
|
||||||
|
{
|
||||||
|
ui->editOutput->setText(QDir::toNativeSeparators(path));}
|
||||||
|
|
||||||
|
void AddJobDialog::setSourceEditable(const bool editable)
|
||||||
|
{
|
||||||
|
ui->buttonBrowseSource->setEnabled(editable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddJobDialog::setApplyToAllVisible(const bool visible)
|
||||||
|
{
|
||||||
|
ui->checkBoxApplyToAll->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -728,8 +785,8 @@ QString AddJobDialog::outputFile(void)
|
|||||||
|
|
||||||
void AddJobDialog::loadTemplateList(void)
|
void AddJobDialog::loadTemplateList(void)
|
||||||
{
|
{
|
||||||
cbxTemplate->addItem(tr("<Default>"), QVariant::fromValue<void*>(m_defaults));
|
ui->cbxTemplate->addItem(tr("<Default>"), QVariant::fromValue<void*>(m_defaults));
|
||||||
cbxTemplate->setCurrentIndex(0);
|
ui->cbxTemplate->setCurrentIndex(0);
|
||||||
|
|
||||||
QMap<QString, OptionsModel*> templates = OptionsModel::loadAllTemplates();
|
QMap<QString, OptionsModel*> templates = OptionsModel::loadAllTemplates();
|
||||||
QStringList templateNames = templates.keys();
|
QStringList templateNames = templates.keys();
|
||||||
@ -738,18 +795,18 @@ void AddJobDialog::loadTemplateList(void)
|
|||||||
while(!templateNames.isEmpty())
|
while(!templateNames.isEmpty())
|
||||||
{
|
{
|
||||||
QString current = templateNames.takeFirst();
|
QString current = templateNames.takeFirst();
|
||||||
cbxTemplate->addItem(current, QVariant::fromValue<void*>(templates.value(current)));
|
ui->cbxTemplate->addItem(current, QVariant::fromValue<void*>(templates.value(current)));
|
||||||
|
|
||||||
if(templates.value(current)->equals(m_options))
|
if(templates.value(current)->equals(m_options))
|
||||||
{
|
{
|
||||||
cbxTemplate->setCurrentIndex(cbxTemplate->count() - 1);
|
ui->cbxTemplate->setCurrentIndex(ui->cbxTemplate->count() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((cbxTemplate->currentIndex() == 0) && (!m_options->equals(m_defaults)))
|
if((ui->cbxTemplate->currentIndex() == 0) && (!m_options->equals(m_defaults)))
|
||||||
{
|
{
|
||||||
cbxTemplate->insertItem(1, tr("<Recently Used>"), QVariant::fromValue<void*>(m_options));
|
ui->cbxTemplate->insertItem(1, tr("<Recently Used>"), QVariant::fromValue<void*>(m_options));
|
||||||
cbxTemplate->setCurrentIndex(1);
|
ui->cbxTemplate->setCurrentIndex(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -767,44 +824,44 @@ void AddJobDialog::updateComboBox(QComboBox *cbox, const QString &text)
|
|||||||
|
|
||||||
void AddJobDialog::restoreOptions(OptionsModel *options)
|
void AddJobDialog::restoreOptions(OptionsModel *options)
|
||||||
{
|
{
|
||||||
cbxRateControlMode->blockSignals(true);
|
ui->cbxRateControlMode->blockSignals(true);
|
||||||
spinQuantizer->blockSignals(true);
|
ui->spinQuantizer->blockSignals(true);
|
||||||
spinBitrate->blockSignals(true);
|
ui->spinBitrate->blockSignals(true);
|
||||||
cbxPreset->blockSignals(true);
|
ui->cbxPreset->blockSignals(true);
|
||||||
cbxTuning->blockSignals(true);
|
ui->cbxTuning->blockSignals(true);
|
||||||
cbxProfile->blockSignals(true);
|
ui->cbxProfile->blockSignals(true);
|
||||||
editCustomX264Params->blockSignals(true);
|
ui->editCustomX264Params->blockSignals(true);
|
||||||
editCustomAvs2YUVParams->blockSignals(true);
|
ui->editCustomAvs2YUVParams->blockSignals(true);
|
||||||
|
|
||||||
cbxRateControlMode->setCurrentIndex(options->rcMode());
|
ui->cbxRateControlMode->setCurrentIndex(options->rcMode());
|
||||||
spinQuantizer->setValue(options->quantizer());
|
ui->spinQuantizer->setValue(options->quantizer());
|
||||||
spinBitrate->setValue(options->bitrate());
|
ui->spinBitrate->setValue(options->bitrate());
|
||||||
updateComboBox(cbxPreset, options->preset());
|
updateComboBox(ui->cbxPreset, options->preset());
|
||||||
updateComboBox(cbxTuning, options->tune());
|
updateComboBox(ui->cbxTuning, options->tune());
|
||||||
updateComboBox(cbxProfile, options->profile());
|
updateComboBox(ui->cbxProfile, options->profile());
|
||||||
editCustomX264Params->setText(options->customX264());
|
ui->editCustomX264Params->setText(options->customX264());
|
||||||
editCustomAvs2YUVParams->setText(options->customAvs2YUV());
|
ui->editCustomAvs2YUVParams->setText(options->customAvs2YUV());
|
||||||
|
|
||||||
cbxRateControlMode->blockSignals(false);
|
ui->cbxRateControlMode->blockSignals(false);
|
||||||
spinQuantizer->blockSignals(false);
|
ui->spinQuantizer->blockSignals(false);
|
||||||
spinBitrate->blockSignals(false);
|
ui->spinBitrate->blockSignals(false);
|
||||||
cbxPreset->blockSignals(false);
|
ui->cbxPreset->blockSignals(false);
|
||||||
cbxTuning->blockSignals(false);
|
ui->cbxTuning->blockSignals(false);
|
||||||
cbxProfile->blockSignals(false);
|
ui->cbxProfile->blockSignals(false);
|
||||||
editCustomX264Params->blockSignals(false);
|
ui->editCustomX264Params->blockSignals(false);
|
||||||
editCustomAvs2YUVParams->blockSignals(false);
|
ui->editCustomAvs2YUVParams->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddJobDialog::saveOptions(OptionsModel *options)
|
void AddJobDialog::saveOptions(OptionsModel *options)
|
||||||
{
|
{
|
||||||
options->setRCMode(static_cast<OptionsModel::RCMode>(cbxRateControlMode->currentIndex()));
|
options->setRCMode(static_cast<OptionsModel::RCMode>(ui->cbxRateControlMode->currentIndex()));
|
||||||
options->setQuantizer(spinQuantizer->value());
|
options->setQuantizer(ui->spinQuantizer->value());
|
||||||
options->setBitrate(spinBitrate->value());
|
options->setBitrate(ui->spinBitrate->value());
|
||||||
options->setPreset(cbxPreset->model()->data(cbxPreset->model()->index(cbxPreset->currentIndex(), 0)).toString());
|
options->setPreset(ui->cbxPreset->model()->data(ui->cbxPreset->model()->index(ui->cbxPreset->currentIndex(), 0)).toString());
|
||||||
options->setTune(cbxTuning->model()->data(cbxTuning->model()->index(cbxTuning->currentIndex(), 0)).toString());
|
options->setTune(ui->cbxTuning->model()->data(ui->cbxTuning->model()->index(ui->cbxTuning->currentIndex(), 0)).toString());
|
||||||
options->setProfile(cbxProfile->model()->data(cbxProfile->model()->index(cbxProfile->currentIndex(), 0)).toString());
|
options->setProfile(ui->cbxProfile->model()->data(ui->cbxProfile->model()->index(ui->cbxProfile->currentIndex(), 0)).toString());
|
||||||
options->setCustomX264(editCustomX264Params->hasAcceptableInput() ? editCustomX264Params->text().simplified() : QString());
|
options->setCustomX264(ui->editCustomX264Params->hasAcceptableInput() ? ui->editCustomX264Params->text().simplified() : QString());
|
||||||
options->setCustomAvs2YUV(editCustomAvs2YUVParams->hasAcceptableInput() ? editCustomAvs2YUVParams->text().simplified() : QString());
|
options->setCustomAvs2YUV(ui->editCustomAvs2YUVParams->hasAcceptableInput() ? ui->editCustomAvs2YUVParams->text().simplified() : QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AddJobDialog::currentSourcePath(const bool bWithName)
|
QString AddJobDialog::currentSourcePath(const bool bWithName)
|
||||||
|
@ -21,14 +21,18 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "uic_win_addJob.h"
|
#include <QDialog>
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
class OptionsModel;
|
class OptionsModel;
|
||||||
class RecentlyUsed;
|
class RecentlyUsed;
|
||||||
|
class QComboBox;
|
||||||
|
|
||||||
class AddJobDialog : public QDialog, private Ui::AddJobDialog
|
namespace Ui
|
||||||
|
{
|
||||||
|
class AddJobDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class AddJobDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -38,17 +42,17 @@ public:
|
|||||||
|
|
||||||
QString sourceFile(void);
|
QString sourceFile(void);
|
||||||
QString outputFile(void);
|
QString outputFile(void);
|
||||||
QString preset(void) { return cbxPreset->itemText(cbxPreset->currentIndex()); }
|
QString preset(void);
|
||||||
QString tuning(void) { return cbxTuning->itemText(cbxTuning->currentIndex()); }
|
QString tuning(void);
|
||||||
QString profile(void) { return cbxProfile->itemText(cbxProfile->currentIndex()); }
|
QString profile(void);
|
||||||
QString params(void) { return editCustomX264Params->text().simplified(); }
|
QString params(void);
|
||||||
bool runImmediately(void) { return checkBoxRun->isChecked(); }
|
bool runImmediately(void);
|
||||||
bool applyToAll(void) { return checkBoxApplyToAll->isChecked(); }
|
bool applyToAll(void);
|
||||||
void setRunImmediately(bool run) { checkBoxRun->setChecked(run); }
|
void setRunImmediately(bool run);
|
||||||
void setSourceFile(const QString &path) { editSource->setText(QDir::toNativeSeparators(path)); }
|
void setSourceFile(const QString &path);
|
||||||
void setOutputFile(const QString &path) { editOutput->setText(QDir::toNativeSeparators(path)); }
|
void setOutputFile(const QString &path);
|
||||||
void setSourceEditable(const bool editable) { buttonBrowseSource->setEnabled(editable); }
|
void setSourceEditable(const bool editable);
|
||||||
void setApplyToAllVisible(const bool visible) { checkBoxApplyToAll->setVisible(visible); }
|
void setApplyToAllVisible(const bool visible);
|
||||||
|
|
||||||
static QString generateOutputFileName(const QString &sourceFilePath, const QString &destinationDirectory, const int filterIndex, const bool saveToSourceDir);
|
static QString generateOutputFileName(const QString &sourceFilePath, const QString &destinationDirectory, const int filterIndex, const bool saveToSourceDir);
|
||||||
static int getFilterIdx(const QString &fileExt);
|
static int getFilterIdx(const QString &fileExt);
|
||||||
@ -85,6 +89,8 @@ private slots:
|
|||||||
virtual void accept(void);
|
virtual void accept(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Ui::AddJobDialog *const ui;
|
||||||
|
|
||||||
void loadTemplateList(void);
|
void loadTemplateList(void);
|
||||||
void restoreOptions(OptionsModel *options);
|
void restoreOptions(OptionsModel *options);
|
||||||
void saveOptions(OptionsModel *options);
|
void saveOptions(OptionsModel *options);
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "win_editor.h"
|
#include "win_editor.h"
|
||||||
|
#include "uic_win_editor.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
@ -32,10 +34,11 @@
|
|||||||
|
|
||||||
EditorDialog::EditorDialog(QWidget *parent)
|
EditorDialog::EditorDialog(QWidget *parent)
|
||||||
:
|
:
|
||||||
QDialog(parent)
|
QDialog(parent),
|
||||||
|
ui(new Ui::EditorDialog())
|
||||||
{
|
{
|
||||||
//Init the dialog, from the .ui file
|
//Init the dialog, from the .ui file
|
||||||
setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
||||||
|
|
||||||
//Fix size
|
//Fix size
|
||||||
@ -44,6 +47,22 @@ EditorDialog::EditorDialog(QWidget *parent)
|
|||||||
|
|
||||||
EditorDialog::~EditorDialog(void)
|
EditorDialog::~EditorDialog(void)
|
||||||
{
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Public Functions
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
QString EditorDialog::getEditText(void)
|
||||||
|
{
|
||||||
|
return ui->plainTextEdit->toPlainText().simplified();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditorDialog::setEditText(const QString &text)
|
||||||
|
{
|
||||||
|
ui->plainTextEdit->clear();
|
||||||
|
ui->plainTextEdit->appendPlainText(text.simplified());
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -21,11 +21,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "uic_win_editor.h"
|
#include <QDialog>
|
||||||
|
|
||||||
class QProcess;
|
namespace Ui
|
||||||
|
{
|
||||||
|
class EditorDialog;
|
||||||
|
}
|
||||||
|
|
||||||
class EditorDialog : public QDialog, private Ui::EditorDialog
|
class EditorDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -33,12 +36,10 @@ public:
|
|||||||
EditorDialog(QWidget *parent);
|
EditorDialog(QWidget *parent);
|
||||||
~EditorDialog(void);
|
~EditorDialog(void);
|
||||||
|
|
||||||
QString getEditText(void) { return plainTextEdit->toPlainText().simplified(); }
|
QString getEditText(void);
|
||||||
|
void setEditText(const QString &text);
|
||||||
|
|
||||||
void setEditText(const QString &text)
|
private:
|
||||||
{
|
Ui::EditorDialog *const ui;
|
||||||
plainTextEdit->clear();
|
|
||||||
plainTextEdit->appendPlainText(text.simplified());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "win_help.h"
|
#include "win_help.h"
|
||||||
|
#include "uic_win_help.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
@ -40,10 +42,11 @@ HelpDialog::HelpDialog(QWidget *parent, bool avs2yuv, bool x64supported, bool us
|
|||||||
m_avs2yuv(avs2yuv),
|
m_avs2yuv(avs2yuv),
|
||||||
m_x64supported(x64supported),
|
m_x64supported(x64supported),
|
||||||
m_use10BitEncoding(use10BitEncoding),
|
m_use10BitEncoding(use10BitEncoding),
|
||||||
m_process(new QProcess())
|
m_process(new QProcess()),
|
||||||
|
ui(new Ui::HelpDialog())
|
||||||
{
|
{
|
||||||
//Init the dialog, from the .ui file
|
//Init the dialog, from the .ui file
|
||||||
setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
||||||
|
|
||||||
//Fix size
|
//Fix size
|
||||||
@ -61,6 +64,7 @@ HelpDialog::HelpDialog(QWidget *parent, bool avs2yuv, bool x64supported, bool us
|
|||||||
HelpDialog::~HelpDialog(void)
|
HelpDialog::~HelpDialog(void)
|
||||||
{
|
{
|
||||||
delete m_process;
|
delete m_process;
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -69,8 +73,8 @@ HelpDialog::~HelpDialog(void)
|
|||||||
|
|
||||||
void HelpDialog::showEvent(QShowEvent *event)
|
void HelpDialog::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
logo_x264->setHidden(m_avs2yuv);
|
ui->logo_x264->setHidden(m_avs2yuv);
|
||||||
logo_avisynth->setVisible(m_avs2yuv);
|
ui->logo_avisynth->setVisible(m_avs2yuv);
|
||||||
|
|
||||||
QDialog::showEvent(event);
|
QDialog::showEvent(event);
|
||||||
|
|
||||||
@ -87,7 +91,7 @@ void HelpDialog::showEvent(QShowEvent *event)
|
|||||||
|
|
||||||
if(!m_process->waitForStarted())
|
if(!m_process->waitForStarted())
|
||||||
{
|
{
|
||||||
plainTextEdit->appendPlainText(tr("Failed to create x264 process :-("));
|
ui->plainTextEdit->appendPlainText(tr("Failed to create x264 process :-("));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +120,7 @@ void HelpDialog::readyRead(void)
|
|||||||
{
|
{
|
||||||
line = line.left(line.length() - 1);
|
line = line.left(line.length() - 1);
|
||||||
}
|
}
|
||||||
plainTextEdit->appendPlainText(line);
|
ui->plainTextEdit->appendPlainText(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,16 +132,16 @@ void HelpDialog::finished(void)
|
|||||||
if(!m_avs2yuv)
|
if(!m_avs2yuv)
|
||||||
{
|
{
|
||||||
m_process->start(X264_BINARY(m_appDir, m_use10BitEncoding, m_x64supported), QStringList() << "--fullhelp");
|
m_process->start(X264_BINARY(m_appDir, m_use10BitEncoding, m_x64supported), QStringList() << "--fullhelp");
|
||||||
plainTextEdit->appendPlainText("\n--------\n");
|
ui->plainTextEdit->appendPlainText("\n--------\n");
|
||||||
|
|
||||||
if(!m_process->waitForStarted())
|
if(!m_process->waitForStarted())
|
||||||
{
|
{
|
||||||
plainTextEdit->appendPlainText(tr("Failed to create x264 process :-("));
|
ui->plainTextEdit->appendPlainText(tr("Failed to create x264 process :-("));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
plainTextEdit->verticalScrollBar()->setSliderPosition(0);
|
ui->plainTextEdit->verticalScrollBar()->setSliderPosition(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,16 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "uic_win_help.h"
|
#include <QDialog>
|
||||||
|
|
||||||
class QProcess;
|
class QProcess;
|
||||||
|
|
||||||
class HelpDialog : public QDialog, private Ui::HelpDialog
|
namespace Ui
|
||||||
|
{
|
||||||
|
class HelpDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class HelpDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -38,6 +43,8 @@ private slots:
|
|||||||
void finished(void);
|
void finished(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Ui::HelpDialog *const ui;
|
||||||
|
|
||||||
const QString m_appDir;
|
const QString m_appDir;
|
||||||
QProcess *const m_process;
|
QProcess *const m_process;
|
||||||
|
|
||||||
|
210
src/win_main.cpp
210
src/win_main.cpp
@ -20,7 +20,10 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "win_main.h"
|
#include "win_main.h"
|
||||||
|
#include "uic_win_main.h"
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
#include "model_status.h"
|
||||||
#include "model_jobList.h"
|
#include "model_jobList.h"
|
||||||
#include "model_options.h"
|
#include "model_options.h"
|
||||||
#include "model_preferences.h"
|
#include "model_preferences.h"
|
||||||
@ -81,10 +84,11 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures)
|
|||||||
m_skipVersionTest(false),
|
m_skipVersionTest(false),
|
||||||
m_abortOnTimeout(true),
|
m_abortOnTimeout(true),
|
||||||
m_firstShow(true),
|
m_firstShow(true),
|
||||||
m_initialized(false)
|
m_initialized(false),
|
||||||
|
ui(new Ui::MainWindow())
|
||||||
{
|
{
|
||||||
//Init the dialog, from the .ui file
|
//Init the dialog, from the .ui file
|
||||||
setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() & (~Qt::WindowMaximizeButtonHint));
|
setWindowFlags(windowFlags() & (~Qt::WindowMaximizeButtonHint));
|
||||||
|
|
||||||
//Register meta types
|
//Register meta types
|
||||||
@ -110,11 +114,11 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures)
|
|||||||
|
|
||||||
//Freeze minimum size
|
//Freeze minimum size
|
||||||
setMinimumSize(size());
|
setMinimumSize(size());
|
||||||
splitter->setSizes(QList<int>() << 16 << 196);
|
ui->splitter->setSizes(QList<int>() << 16 << 196);
|
||||||
|
|
||||||
//Update title
|
//Update title
|
||||||
labelBuildDate->setText(tr("Built on %1 at %2").arg(x264_version_date().toString(Qt::ISODate), QString::fromLatin1(x264_version_time())));
|
ui->labelBuildDate->setText(tr("Built on %1 at %2").arg(x264_version_date().toString(Qt::ISODate), QString::fromLatin1(x264_version_time())));
|
||||||
labelBuildDate->installEventFilter(this);
|
ui->labelBuildDate->installEventFilter(this);
|
||||||
setWindowTitle(QString("%1 (%2 Mode)").arg(windowTitle(), m_cpuFeatures->x64 ? "64-Bit" : "32-Bit"));
|
setWindowTitle(QString("%1 (%2 Mode)").arg(windowTitle(), m_cpuFeatures->x64 ? "64-Bit" : "32-Bit"));
|
||||||
if(X264_DEBUG)
|
if(X264_DEBUG)
|
||||||
{
|
{
|
||||||
@ -129,63 +133,63 @@ MainWindow::MainWindow(const x264_cpu_t *const cpuFeatures)
|
|||||||
//Create model
|
//Create model
|
||||||
m_jobList = new JobListModel(m_preferences);
|
m_jobList = new JobListModel(m_preferences);
|
||||||
connect(m_jobList, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(jobChangedData(QModelIndex, QModelIndex)));
|
connect(m_jobList, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(jobChangedData(QModelIndex, QModelIndex)));
|
||||||
jobsView->setModel(m_jobList);
|
ui->jobsView->setModel(m_jobList);
|
||||||
|
|
||||||
//Setup view
|
//Setup view
|
||||||
jobsView->horizontalHeader()->setSectionHidden(3, true);
|
ui->jobsView->horizontalHeader()->setSectionHidden(3, true);
|
||||||
jobsView->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
|
ui->jobsView->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
|
||||||
jobsView->horizontalHeader()->setResizeMode(1, QHeaderView::Fixed);
|
ui->jobsView->horizontalHeader()->setResizeMode(1, QHeaderView::Fixed);
|
||||||
jobsView->horizontalHeader()->setResizeMode(2, QHeaderView::Fixed);
|
ui->jobsView->horizontalHeader()->setResizeMode(2, QHeaderView::Fixed);
|
||||||
jobsView->horizontalHeader()->resizeSection(1, 150);
|
ui->jobsView->horizontalHeader()->resizeSection(1, 150);
|
||||||
jobsView->horizontalHeader()->resizeSection(2, 90);
|
ui->jobsView->horizontalHeader()->resizeSection(2, 90);
|
||||||
jobsView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
ui->jobsView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||||
connect(jobsView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(jobSelected(QModelIndex, QModelIndex)));
|
connect(ui->jobsView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(jobSelected(QModelIndex, QModelIndex)));
|
||||||
|
|
||||||
//Create context menu
|
//Create context menu
|
||||||
QAction *actionClipboard = new QAction(QIcon(":/buttons/page_paste.png"), tr("Copy to Clipboard"), logView);
|
QAction *actionClipboard = new QAction(QIcon(":/buttons/page_paste.png"), tr("Copy to Clipboard"), ui->logView);
|
||||||
actionClipboard->setEnabled(false);
|
actionClipboard->setEnabled(false);
|
||||||
logView->addAction(actionClipboard);
|
ui->logView->addAction(actionClipboard);
|
||||||
connect(actionClipboard, SIGNAL(triggered(bool)), this, SLOT(copyLogToClipboard(bool)));
|
connect(actionClipboard, SIGNAL(triggered(bool)), this, SLOT(copyLogToClipboard(bool)));
|
||||||
jobsView->addActions(menuJob->actions());
|
ui->jobsView->addActions(ui->menuJob->actions());
|
||||||
|
|
||||||
//Enable buttons
|
//Enable buttons
|
||||||
connect(buttonAddJob, SIGNAL(clicked()), this, SLOT(addButtonPressed()));
|
connect(ui->buttonAddJob, SIGNAL(clicked()), this, SLOT(addButtonPressed()));
|
||||||
connect(buttonStartJob, SIGNAL(clicked()), this, SLOT(startButtonPressed()));
|
connect(ui->buttonStartJob, SIGNAL(clicked()), this, SLOT(startButtonPressed()));
|
||||||
connect(buttonAbortJob, SIGNAL(clicked()), this, SLOT(abortButtonPressed()));
|
connect(ui->buttonAbortJob, SIGNAL(clicked()), this, SLOT(abortButtonPressed()));
|
||||||
connect(buttonPauseJob, SIGNAL(toggled(bool)), this, SLOT(pauseButtonPressed(bool)));
|
connect(ui->buttonPauseJob, SIGNAL(toggled(bool)), this, SLOT(pauseButtonPressed(bool)));
|
||||||
connect(actionJob_Delete, SIGNAL(triggered()), this, SLOT(deleteButtonPressed()));
|
connect(ui->actionJob_Delete, SIGNAL(triggered()), this, SLOT(deleteButtonPressed()));
|
||||||
connect(actionJob_Restart, SIGNAL(triggered()), this, SLOT(restartButtonPressed()));
|
connect(ui->actionJob_Restart, SIGNAL(triggered()), this, SLOT(restartButtonPressed()));
|
||||||
connect(actionJob_Browse, SIGNAL(triggered()), this, SLOT(browseButtonPressed()));
|
connect(ui->actionJob_Browse, SIGNAL(triggered()), this, SLOT(browseButtonPressed()));
|
||||||
|
|
||||||
//Enable menu
|
//Enable menu
|
||||||
connect(actionOpen, SIGNAL(triggered()), this, SLOT(openActionTriggered()));
|
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openActionTriggered()));
|
||||||
connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAbout()));
|
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAbout()));
|
||||||
connect(actionWebMulder, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebMulder, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebX264, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebX264, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebKomisar, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebKomisar, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebVideoLAN, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebVideoLAN, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebJEEB, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebJEEB, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebAvisynth32, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebAvisynth32, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebAvisynth64, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebAvisynth64, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebVapourSynth, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebVapourSynth, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebVapourSynthDocs, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebVapourSynthDocs, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebWiki, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebWiki, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebBluRay, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebBluRay, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebAvsWiki, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebAvsWiki, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebSecret, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebSecret, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionWebSupport, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
connect(ui->actionWebSupport, SIGNAL(triggered()), this, SLOT(showWebLink()));
|
||||||
connect(actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences()));
|
connect(ui->actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences()));
|
||||||
|
|
||||||
//Create floating label
|
//Create floating label
|
||||||
m_label = new QLabel(jobsView->viewport());
|
m_label = new QLabel(ui->jobsView->viewport());
|
||||||
m_label->setText(tr("No job created yet. Please click the 'Add New Job' button!"));
|
m_label->setText(tr("No job created yet. Please click the 'Add New Job' button!"));
|
||||||
m_label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
m_label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
SET_TEXT_COLOR(m_label, Qt::darkGray);
|
SET_TEXT_COLOR(m_label, Qt::darkGray);
|
||||||
SET_FONT_BOLD(m_label, true);
|
SET_FONT_BOLD(m_label, true);
|
||||||
m_label->setVisible(true);
|
m_label->setVisible(true);
|
||||||
m_label->setContextMenuPolicy(Qt::ActionsContextMenu);
|
m_label->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||||
m_label->addActions(jobsView->actions());
|
m_label->addActions(ui->jobsView->actions());
|
||||||
connect(splitter, SIGNAL(splitterMoved(int, int)), this, SLOT(updateLabelPos()));
|
connect(ui->splitter, SIGNAL(splitterMoved(int, int)), this, SLOT(updateLabelPos()));
|
||||||
updateLabelPos();
|
updateLabelPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,6 +226,8 @@ MainWindow::~MainWindow(void)
|
|||||||
X264_DELETE(m_recentlyUsed);
|
X264_DELETE(m_recentlyUsed);
|
||||||
VapourSynthCheckThread::unload();
|
VapourSynthCheckThread::unload();
|
||||||
AvisynthCheckThread::unload();
|
AvisynthCheckThread::unload();
|
||||||
|
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -273,7 +279,7 @@ void MainWindow::openActionTriggered()
|
|||||||
*/
|
*/
|
||||||
void MainWindow::startButtonPressed(void)
|
void MainWindow::startButtonPressed(void)
|
||||||
{
|
{
|
||||||
m_jobList->startJob(jobsView->currentIndex());
|
m_jobList->startJob(ui->jobsView->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -281,7 +287,7 @@ void MainWindow::startButtonPressed(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::abortButtonPressed(void)
|
void MainWindow::abortButtonPressed(void)
|
||||||
{
|
{
|
||||||
m_jobList->abortJob(jobsView->currentIndex());
|
m_jobList->abortJob(ui->jobsView->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -289,7 +295,7 @@ void MainWindow::abortButtonPressed(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::deleteButtonPressed(void)
|
void MainWindow::deleteButtonPressed(void)
|
||||||
{
|
{
|
||||||
m_jobList->deleteJob(jobsView->currentIndex());
|
m_jobList->deleteJob(ui->jobsView->currentIndex());
|
||||||
m_label->setVisible(m_jobList->rowCount(QModelIndex()) == 0);
|
m_label->setVisible(m_jobList->rowCount(QModelIndex()) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +304,7 @@ void MainWindow::deleteButtonPressed(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::browseButtonPressed(void)
|
void MainWindow::browseButtonPressed(void)
|
||||||
{
|
{
|
||||||
QString outputFile = m_jobList->getJobOutputFile(jobsView->currentIndex());
|
QString outputFile = m_jobList->getJobOutputFile(ui->jobsView->currentIndex());
|
||||||
if((!outputFile.isEmpty()) && QFileInfo(outputFile).exists() && QFileInfo(outputFile).isFile())
|
if((!outputFile.isEmpty()) && QFileInfo(outputFile).exists() && QFileInfo(outputFile).isFile())
|
||||||
{
|
{
|
||||||
QProcess::startDetached(QString::fromLatin1("explorer.exe"), QStringList() << QString::fromLatin1("/select,") << QDir::toNativeSeparators(outputFile), QFileInfo(outputFile).path());
|
QProcess::startDetached(QString::fromLatin1("explorer.exe"), QStringList() << QString::fromLatin1("/select,") << QDir::toNativeSeparators(outputFile), QFileInfo(outputFile).path());
|
||||||
@ -316,11 +322,11 @@ void MainWindow::pauseButtonPressed(bool checked)
|
|||||||
{
|
{
|
||||||
if(checked)
|
if(checked)
|
||||||
{
|
{
|
||||||
m_jobList->pauseJob(jobsView->currentIndex());
|
m_jobList->pauseJob(ui->jobsView->currentIndex());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_jobList->resumeJob(jobsView->currentIndex());
|
m_jobList->resumeJob(ui->jobsView->currentIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,7 +335,7 @@ void MainWindow::pauseButtonPressed(bool checked)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::restartButtonPressed(void)
|
void MainWindow::restartButtonPressed(void)
|
||||||
{
|
{
|
||||||
const QModelIndex index = jobsView->currentIndex();
|
const QModelIndex index = ui->jobsView->currentIndex();
|
||||||
const OptionsModel *options = m_jobList->getJobOptions(index);
|
const OptionsModel *options = m_jobList->getJobOptions(index);
|
||||||
QString sourceFileName = m_jobList->getJobSourceFile(index);
|
QString sourceFileName = m_jobList->getJobSourceFile(index);
|
||||||
QString outputFileName = m_jobList->getJobOutputFile(index);
|
QString outputFileName = m_jobList->getJobOutputFile(index);
|
||||||
@ -353,34 +359,34 @@ void MainWindow::jobSelected(const QModelIndex & current, const QModelIndex & pr
|
|||||||
{
|
{
|
||||||
qDebug("Job selected: %d", current.row());
|
qDebug("Job selected: %d", current.row());
|
||||||
|
|
||||||
if(logView->model())
|
if(ui->logView->model())
|
||||||
{
|
{
|
||||||
disconnect(logView->model(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(jobLogExtended(QModelIndex, int, int)));
|
disconnect(ui->logView->model(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(jobLogExtended(QModelIndex, int, int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(current.isValid())
|
if(current.isValid())
|
||||||
{
|
{
|
||||||
logView->setModel(m_jobList->getLogFile(current));
|
ui->logView->setModel(m_jobList->getLogFile(current));
|
||||||
connect(logView->model(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(jobLogExtended(QModelIndex, int, int)));
|
connect(ui->logView->model(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(jobLogExtended(QModelIndex, int, int)));
|
||||||
logView->actions().first()->setEnabled(true);
|
ui->logView->actions().first()->setEnabled(true);
|
||||||
QTimer::singleShot(0, logView, SLOT(scrollToBottom()));
|
QTimer::singleShot(0, ui->logView, SLOT(scrollToBottom()));
|
||||||
|
|
||||||
progressBar->setValue(m_jobList->getJobProgress(current));
|
ui->progressBar->setValue(m_jobList->getJobProgress(current));
|
||||||
editDetails->setText(m_jobList->data(m_jobList->index(current.row(), 3, QModelIndex()), Qt::DisplayRole).toString());
|
ui->editDetails->setText(m_jobList->data(m_jobList->index(current.row(), 3, QModelIndex()), Qt::DisplayRole).toString());
|
||||||
updateButtons(m_jobList->getJobStatus(current));
|
updateButtons(m_jobList->getJobStatus(current));
|
||||||
updateTaskbar(m_jobList->getJobStatus(current), m_jobList->data(m_jobList->index(current.row(), 0, QModelIndex()), Qt::DecorationRole).value<QIcon>());
|
updateTaskbar(m_jobList->getJobStatus(current), m_jobList->data(m_jobList->index(current.row(), 0, QModelIndex()), Qt::DecorationRole).value<QIcon>());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logView->setModel(NULL);
|
ui->logView->setModel(NULL);
|
||||||
logView->actions().first()->setEnabled(false);
|
ui->logView->actions().first()->setEnabled(false);
|
||||||
progressBar->setValue(0);
|
ui->progressBar->setValue(0);
|
||||||
editDetails->clear();
|
ui->editDetails->clear();
|
||||||
updateButtons(JobStatus_Undefined);
|
updateButtons(JobStatus_Undefined);
|
||||||
updateTaskbar(JobStatus_Undefined, QIcon());
|
updateTaskbar(JobStatus_Undefined, QIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
progressBar->repaint();
|
ui->progressBar->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -388,7 +394,7 @@ void MainWindow::jobSelected(const QModelIndex & current, const QModelIndex & pr
|
|||||||
*/
|
*/
|
||||||
void MainWindow::jobChangedData(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
void MainWindow::jobChangedData(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
||||||
{
|
{
|
||||||
int selected = jobsView->currentIndex().row();
|
int selected = ui->jobsView->currentIndex().row();
|
||||||
|
|
||||||
if(topLeft.column() <= 1 && bottomRight.column() >= 1) /*STATUS*/
|
if(topLeft.column() <= 1 && bottomRight.column() >= 1) /*STATUS*/
|
||||||
{
|
{
|
||||||
@ -415,8 +421,8 @@ void MainWindow::jobChangedData(const QModelIndex &topLeft, const QModelIndex &
|
|||||||
{
|
{
|
||||||
if(i == selected)
|
if(i == selected)
|
||||||
{
|
{
|
||||||
progressBar->setValue(m_jobList->getJobProgress(m_jobList->index(i, 0, QModelIndex())));
|
ui->progressBar->setValue(m_jobList->getJobProgress(m_jobList->index(i, 0, QModelIndex())));
|
||||||
WinSevenTaskbar::setTaskbarProgress(this, progressBar->value(), progressBar->maximum());
|
WinSevenTaskbar::setTaskbarProgress(this, ui->progressBar->value(), ui->progressBar->maximum());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -427,7 +433,7 @@ void MainWindow::jobChangedData(const QModelIndex &topLeft, const QModelIndex &
|
|||||||
{
|
{
|
||||||
if(i == selected)
|
if(i == selected)
|
||||||
{
|
{
|
||||||
editDetails->setText(m_jobList->data(m_jobList->index(i, 3, QModelIndex()), Qt::DisplayRole).toString());
|
ui->editDetails->setText(m_jobList->data(m_jobList->index(i, 3, QModelIndex()), Qt::DisplayRole).toString());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,7 +445,7 @@ void MainWindow::jobChangedData(const QModelIndex &topLeft, const QModelIndex &
|
|||||||
*/
|
*/
|
||||||
void MainWindow::jobLogExtended(const QModelIndex & parent, int start, int end)
|
void MainWindow::jobLogExtended(const QModelIndex & parent, int start, int end)
|
||||||
{
|
{
|
||||||
QTimer::singleShot(0, logView, SLOT(scrollToBottom()));
|
QTimer::singleShot(0, ui->logView, SLOT(scrollToBottom()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -540,20 +546,20 @@ void MainWindow::showAbout(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::showWebLink(void)
|
void MainWindow::showWebLink(void)
|
||||||
{
|
{
|
||||||
if(QObject::sender() == actionWebMulder) QDesktopServices::openUrl(QUrl(home_url));
|
if(QObject::sender() == ui->actionWebMulder) QDesktopServices::openUrl(QUrl(home_url));
|
||||||
if(QObject::sender() == actionWebX264) QDesktopServices::openUrl(QUrl("http://www.x264.com/"));
|
if(QObject::sender() == ui->actionWebX264) QDesktopServices::openUrl(QUrl("http://www.x264.com/"));
|
||||||
if(QObject::sender() == actionWebKomisar) QDesktopServices::openUrl(QUrl("http://komisar.gin.by/"));
|
if(QObject::sender() == ui->actionWebKomisar) QDesktopServices::openUrl(QUrl("http://komisar.gin.by/"));
|
||||||
if(QObject::sender() == actionWebVideoLAN) QDesktopServices::openUrl(QUrl("http://download.videolan.org/pub/x264/binaries/"));
|
if(QObject::sender() == ui->actionWebVideoLAN) QDesktopServices::openUrl(QUrl("http://download.videolan.org/pub/x264/binaries/"));
|
||||||
if(QObject::sender() == actionWebJEEB) QDesktopServices::openUrl(QUrl("http://x264.fushizen.eu/"));
|
if(QObject::sender() == ui->actionWebJEEB) QDesktopServices::openUrl(QUrl("http://x264.fushizen.eu/"));
|
||||||
if(QObject::sender() == actionWebAvisynth32) QDesktopServices::openUrl(QUrl("http://sourceforge.net/projects/avisynth2/files/AviSynth%202.5/"));
|
if(QObject::sender() == ui->actionWebAvisynth32) QDesktopServices::openUrl(QUrl("http://sourceforge.net/projects/avisynth2/files/AviSynth%202.5/"));
|
||||||
if(QObject::sender() == actionWebAvisynth64) QDesktopServices::openUrl(QUrl("http://code.google.com/p/avisynth64/downloads/list"));
|
if(QObject::sender() == ui->actionWebAvisynth64) QDesktopServices::openUrl(QUrl("http://code.google.com/p/avisynth64/downloads/list"));
|
||||||
if(QObject::sender() == actionWebVapourSynth) QDesktopServices::openUrl(QUrl("http://www.vapoursynth.com/"));
|
if(QObject::sender() == ui->actionWebVapourSynth) QDesktopServices::openUrl(QUrl("http://www.vapoursynth.com/"));
|
||||||
if(QObject::sender() == actionWebVapourSynthDocs) QDesktopServices::openUrl(QUrl("http://www.vapoursynth.com/doc/"));
|
if(QObject::sender() == ui->actionWebVapourSynthDocs) QDesktopServices::openUrl(QUrl("http://www.vapoursynth.com/doc/"));
|
||||||
if(QObject::sender() == actionWebWiki) QDesktopServices::openUrl(QUrl("http://mewiki.project357.com/wiki/X264_Settings"));
|
if(QObject::sender() == ui->actionWebWiki) QDesktopServices::openUrl(QUrl("http://mewiki.project357.com/wiki/X264_Settings"));
|
||||||
if(QObject::sender() == actionWebBluRay) QDesktopServices::openUrl(QUrl("http://www.x264bluray.com/"));
|
if(QObject::sender() == ui->actionWebBluRay) QDesktopServices::openUrl(QUrl("http://www.x264bluray.com/"));
|
||||||
if(QObject::sender() == actionWebAvsWiki) QDesktopServices::openUrl(QUrl("http://avisynth.nl/index.php/Main_Page#Usage"));
|
if(QObject::sender() == ui->actionWebAvsWiki) QDesktopServices::openUrl(QUrl("http://avisynth.nl/index.php/Main_Page#Usage"));
|
||||||
if(QObject::sender() == actionWebSupport) QDesktopServices::openUrl(QUrl("http://forum.doom9.org/showthread.php?t=144140"));
|
if(QObject::sender() == ui->actionWebSupport) QDesktopServices::openUrl(QUrl("http://forum.doom9.org/showthread.php?t=144140"));
|
||||||
if(QObject::sender() == actionWebSecret) QDesktopServices::openUrl(QUrl("http://www.youtube.com/watch_popup?v=AXIeHY-OYNI"));
|
if(QObject::sender() == ui->actionWebSecret) QDesktopServices::openUrl(QUrl("http://www.youtube.com/watch_popup?v=AXIeHY-OYNI"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -581,7 +587,7 @@ void MainWindow::launchNextJob(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int startIdx= jobsView->currentIndex().isValid() ? qBound(0, jobsView->currentIndex().row(), rows-1) : 0;
|
int startIdx= ui->jobsView->currentIndex().isValid() ? qBound(0, ui->jobsView->currentIndex().row(), rows-1) : 0;
|
||||||
|
|
||||||
for(int i = 0; i < rows; i++)
|
for(int i = 0; i < rows; i++)
|
||||||
{
|
{
|
||||||
@ -591,7 +597,7 @@ void MainWindow::launchNextJob(void)
|
|||||||
{
|
{
|
||||||
if(m_jobList->startJob(m_jobList->index(currentIdx, 0, QModelIndex())))
|
if(m_jobList->startJob(m_jobList->index(currentIdx, 0, QModelIndex())))
|
||||||
{
|
{
|
||||||
jobsView->selectRow(currentIdx);
|
ui->jobsView->selectRow(currentIdx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -910,7 +916,7 @@ void MainWindow::init(void)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::updateLabelPos(void)
|
void MainWindow::updateLabelPos(void)
|
||||||
{
|
{
|
||||||
const QWidget *const viewPort = jobsView->viewport();
|
const QWidget *const viewPort = ui->jobsView->viewport();
|
||||||
m_label->setGeometry(0, 0, viewPort->width(), viewPort->height());
|
m_label->setGeometry(0, 0, viewPort->width(), viewPort->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -921,7 +927,7 @@ void MainWindow::copyLogToClipboard(bool checked)
|
|||||||
{
|
{
|
||||||
qDebug("copyLogToClipboard");
|
qDebug("copyLogToClipboard");
|
||||||
|
|
||||||
if(LogFileModel *log = dynamic_cast<LogFileModel*>(logView->model()))
|
if(LogFileModel *log = dynamic_cast<LogFileModel*>(ui->logView->model()))
|
||||||
{
|
{
|
||||||
log->copyToClipboard();
|
log->copyToClipboard();
|
||||||
x264_beep(x264_beep_info);
|
x264_beep(x264_beep_info);
|
||||||
@ -1028,7 +1034,7 @@ void MainWindow::resizeEvent(QResizeEvent *e)
|
|||||||
*/
|
*/
|
||||||
bool MainWindow::eventFilter(QObject *o, QEvent *e)
|
bool MainWindow::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
if((o == labelBuildDate) && (e->type() == QEvent::MouseButtonPress))
|
if((o == ui->labelBuildDate) && (e->type() == QEvent::MouseButtonPress))
|
||||||
{
|
{
|
||||||
QTimer::singleShot(0, this, SLOT(showAbout()));
|
QTimer::singleShot(0, this, SLOT(showAbout()));
|
||||||
return true;
|
return true;
|
||||||
@ -1204,7 +1210,7 @@ bool MainWindow::appendJob(const QString &sourceFileName, const QString &outputF
|
|||||||
{
|
{
|
||||||
if(runImmediately)
|
if(runImmediately)
|
||||||
{
|
{
|
||||||
jobsView->selectRow(newIndex.row());
|
ui->jobsView->selectRow(newIndex.row());
|
||||||
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
m_jobList->startJob(newIndex);
|
m_jobList->startJob(newIndex);
|
||||||
}
|
}
|
||||||
@ -1263,21 +1269,21 @@ void MainWindow::updateButtons(JobStatus status)
|
|||||||
{
|
{
|
||||||
qDebug("MainWindow::updateButtons(void)");
|
qDebug("MainWindow::updateButtons(void)");
|
||||||
|
|
||||||
buttonStartJob->setEnabled(status == JobStatus_Enqueued);
|
ui->buttonStartJob->setEnabled(status == JobStatus_Enqueued);
|
||||||
buttonAbortJob->setEnabled(status == JobStatus_Indexing || status == JobStatus_Running || status == JobStatus_Running_Pass1 || status == JobStatus_Running_Pass2 || status == JobStatus_Paused);
|
ui->buttonAbortJob->setEnabled(status == JobStatus_Indexing || status == JobStatus_Running || status == JobStatus_Running_Pass1 || status == JobStatus_Running_Pass2 || status == JobStatus_Paused);
|
||||||
buttonPauseJob->setEnabled(status == JobStatus_Indexing || status == JobStatus_Running || status == JobStatus_Paused || status == JobStatus_Running_Pass1 || status == JobStatus_Running_Pass2);
|
ui->buttonPauseJob->setEnabled(status == JobStatus_Indexing || status == JobStatus_Running || status == JobStatus_Paused || status == JobStatus_Running_Pass1 || status == JobStatus_Running_Pass2);
|
||||||
buttonPauseJob->setChecked(status == JobStatus_Paused || status == JobStatus_Pausing);
|
ui->buttonPauseJob->setChecked(status == JobStatus_Paused || status == JobStatus_Pausing);
|
||||||
|
|
||||||
actionJob_Delete->setEnabled(status == JobStatus_Completed || status == JobStatus_Aborted || status == JobStatus_Failed || status == JobStatus_Enqueued);
|
ui->actionJob_Delete->setEnabled(status == JobStatus_Completed || status == JobStatus_Aborted || status == JobStatus_Failed || status == JobStatus_Enqueued);
|
||||||
actionJob_Restart->setEnabled(status == JobStatus_Completed || status == JobStatus_Aborted || status == JobStatus_Failed || status == JobStatus_Enqueued);
|
ui->actionJob_Restart->setEnabled(status == JobStatus_Completed || status == JobStatus_Aborted || status == JobStatus_Failed || status == JobStatus_Enqueued);
|
||||||
actionJob_Browse->setEnabled(status == JobStatus_Completed);
|
ui->actionJob_Browse->setEnabled(status == JobStatus_Completed);
|
||||||
|
|
||||||
actionJob_Start->setEnabled(buttonStartJob->isEnabled());
|
ui->actionJob_Start->setEnabled(ui->buttonStartJob->isEnabled());
|
||||||
actionJob_Abort->setEnabled(buttonAbortJob->isEnabled());
|
ui->actionJob_Abort->setEnabled(ui->buttonAbortJob->isEnabled());
|
||||||
actionJob_Pause->setEnabled(buttonPauseJob->isEnabled());
|
ui->actionJob_Pause->setEnabled(ui->buttonPauseJob->isEnabled());
|
||||||
actionJob_Pause->setChecked(buttonPauseJob->isChecked());
|
ui->actionJob_Pause->setChecked(ui->buttonPauseJob->isChecked());
|
||||||
|
|
||||||
editDetails->setEnabled(status != JobStatus_Paused);
|
ui->editDetails->setEnabled(status != JobStatus_Paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1318,7 +1324,7 @@ void MainWindow::updateTaskbar(JobStatus status, const QIcon &icon)
|
|||||||
case JobStatus_Resuming:
|
case JobStatus_Resuming:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WinSevenTaskbar::setTaskbarProgress(this, progressBar->value(), progressBar->maximum());
|
WinSevenTaskbar::setTaskbarProgress(this, ui->progressBar->value(), ui->progressBar->maximum());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "uic_win_main.h"
|
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "model_status.h"
|
#include <QMainWindow>
|
||||||
|
|
||||||
class JobListModel;
|
class JobListModel;
|
||||||
class OptionsModel;
|
class OptionsModel;
|
||||||
@ -33,8 +31,16 @@ class QLibrary;
|
|||||||
class PreferencesModel;
|
class PreferencesModel;
|
||||||
class RecentlyUsed;
|
class RecentlyUsed;
|
||||||
class IPCThread;
|
class IPCThread;
|
||||||
|
class QModelIndex;
|
||||||
|
class QLabel;
|
||||||
|
enum JobStatus;
|
||||||
|
|
||||||
class MainWindow: public QMainWindow, private Ui::MainWindow
|
namespace Ui
|
||||||
|
{
|
||||||
|
class MainWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
class MainWindow: public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -52,6 +58,8 @@ protected:
|
|||||||
virtual bool winEvent(MSG *message, long *result);
|
virtual bool winEvent(MSG *message, long *result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Ui::MainWindow *const ui;
|
||||||
|
|
||||||
bool m_firstShow;
|
bool m_firstShow;
|
||||||
bool m_skipVersionTest;
|
bool m_skipVersionTest;
|
||||||
bool m_abortOnTimeout;
|
bool m_abortOnTimeout;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "win_preferences.h"
|
#include "win_preferences.h"
|
||||||
|
#include "uic_win_preferences.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "model_preferences.h"
|
#include "model_preferences.h"
|
||||||
@ -29,98 +30,96 @@
|
|||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#define UPDATE_CHECKBOX(CHKBOX, VALUE, BLOCK) do \
|
static inline void UPDATE_CHECKBOX(QCheckBox *const chkbox, const bool value, const bool block)
|
||||||
{ \
|
{
|
||||||
if((BLOCK)) { (CHKBOX)->blockSignals(true); } \
|
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); } \
|
if(block) { chkbox->blockSignals(false); }
|
||||||
} \
|
}
|
||||||
while(0)
|
|
||||||
|
|
||||||
#define UPDATE_COMBOBOX(COBOX, VALUE, DEFAULT) do \
|
static inline void UPDATE_COMBOBOX(QComboBox *const cobox, const int value, const int defVal)
|
||||||
{ \
|
{
|
||||||
const int _cnt = (COBOX)->count(); \
|
const int count = cobox->count();
|
||||||
const int _val = (VALUE); \
|
for(int i = 0; i < count; i++)
|
||||||
const int _def = (DEFAULT); \
|
{
|
||||||
for(int _i = 0; _i < _cnt; _i++) \
|
const int current = cobox->itemData(i).toInt();
|
||||||
{ \
|
if((current == value) || (current == defVal))
|
||||||
const int _current = (COBOX)->itemData(_i).toInt(); \
|
{
|
||||||
if((_current == _val) || (_current == _def)) \
|
cobox->setCurrentIndex(i);
|
||||||
{ \
|
if((current == value)) break;
|
||||||
(COBOX)->setCurrentIndex(_i); \
|
}
|
||||||
if((_current == _val)) break; \
|
}
|
||||||
} \
|
}
|
||||||
} \
|
|
||||||
} \
|
|
||||||
while(0)
|
|
||||||
|
|
||||||
PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferences, bool x64)
|
PreferencesDialog::PreferencesDialog(QWidget *parent, PreferencesModel *preferences, bool x64)
|
||||||
:
|
:
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
m_x64(x64)
|
m_x64(x64),
|
||||||
|
ui(new Ui::PreferencesDialog())
|
||||||
{
|
{
|
||||||
setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
||||||
setFixedSize(minimumSize());
|
setFixedSize(minimumSize());
|
||||||
x264_enable_close_button(this, false);
|
x264_enable_close_button(this, false);
|
||||||
|
|
||||||
comboBoxPriority->setItemData(0, QVariant::fromValue( 1)); //Above Normal
|
ui->comboBoxPriority->setItemData(0, QVariant::fromValue( 1)); //Above Normal
|
||||||
comboBoxPriority->setItemData(1, QVariant::fromValue( 0)); //Normal
|
ui->comboBoxPriority->setItemData(1, QVariant::fromValue( 0)); //Normal
|
||||||
comboBoxPriority->setItemData(2, QVariant::fromValue(-1)); //Below Normal
|
ui->comboBoxPriority->setItemData(2, QVariant::fromValue(-1)); //Below Normal
|
||||||
comboBoxPriority->setItemData(3, QVariant::fromValue(-2)); //Idle
|
ui->comboBoxPriority->setItemData(3, QVariant::fromValue(-2)); //Idle
|
||||||
|
|
||||||
labelRunNextJob->installEventFilter(this);
|
ui->labelRunNextJob->installEventFilter(this);
|
||||||
labelUse10BitEncoding->installEventFilter(this);
|
ui->labelUse10BitEncoding->installEventFilter(this);
|
||||||
labelUse64BitAvs2YUV->installEventFilter(this);
|
ui->labelUse64BitAvs2YUV->installEventFilter(this);
|
||||||
labelShutdownComputer->installEventFilter(this);
|
ui->labelShutdownComputer->installEventFilter(this);
|
||||||
labelSaveLogFiles->installEventFilter(this);
|
ui->labelSaveLogFiles->installEventFilter(this);
|
||||||
labelSaveToSourceFolder->installEventFilter(this);
|
ui->labelSaveToSourceFolder->installEventFilter(this);
|
||||||
labelEnableSounds->installEventFilter(this);
|
ui->labelEnableSounds->installEventFilter(this);
|
||||||
labelDisableWarnings->installEventFilter(this);
|
ui->labelDisableWarnings->installEventFilter(this);
|
||||||
|
|
||||||
connect(resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed()));
|
connect(ui->resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed()));
|
||||||
connect(checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool)));
|
connect(ui->checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool)));
|
||||||
connect(checkDisableWarnings, SIGNAL(toggled(bool)), this, SLOT(disableWarningsToggled(bool)));
|
connect(ui->checkDisableWarnings, SIGNAL(toggled(bool)), this, SLOT(disableWarningsToggled(bool)));
|
||||||
|
|
||||||
m_preferences = preferences;
|
m_preferences = preferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferencesDialog::~PreferencesDialog(void)
|
PreferencesDialog::~PreferencesDialog(void)
|
||||||
{
|
{
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::showEvent(QShowEvent *event)
|
void PreferencesDialog::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
if(event) QDialog::showEvent(event);
|
if(event) QDialog::showEvent(event);
|
||||||
|
|
||||||
UPDATE_CHECKBOX(checkRunNextJob, m_preferences->autoRunNextJob(), false);
|
UPDATE_CHECKBOX(ui->checkRunNextJob, m_preferences->autoRunNextJob(), false);
|
||||||
UPDATE_CHECKBOX(checkShutdownComputer, m_preferences->shutdownComputer(), false);
|
UPDATE_CHECKBOX(ui->checkShutdownComputer, m_preferences->shutdownComputer(), false);
|
||||||
UPDATE_CHECKBOX(checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit(), false);
|
UPDATE_CHECKBOX(ui->checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit(), false);
|
||||||
UPDATE_CHECKBOX(checkSaveLogFiles, m_preferences->saveLogFiles(), false);
|
UPDATE_CHECKBOX(ui->checkSaveLogFiles, m_preferences->saveLogFiles(), false);
|
||||||
UPDATE_CHECKBOX(checkSaveToSourceFolder, m_preferences->saveToSourcePath(), false);
|
UPDATE_CHECKBOX(ui->checkSaveToSourceFolder, m_preferences->saveToSourcePath(), false);
|
||||||
UPDATE_CHECKBOX(checkEnableSounds, m_preferences->enableSounds(), false);
|
UPDATE_CHECKBOX(ui->checkEnableSounds, m_preferences->enableSounds(), false);
|
||||||
UPDATE_CHECKBOX(checkDisableWarnings, m_preferences->disableWarnings(), true);
|
UPDATE_CHECKBOX(ui->checkDisableWarnings, m_preferences->disableWarnings(), true);
|
||||||
UPDATE_CHECKBOX(checkUse10BitEncoding, m_preferences->use10BitEncoding(), true);
|
UPDATE_CHECKBOX(ui->checkUse10BitEncoding, m_preferences->use10BitEncoding(), true);
|
||||||
|
|
||||||
spinBoxJobCount->setValue(m_preferences->maxRunningJobCount());
|
ui->spinBoxJobCount->setValue(m_preferences->maxRunningJobCount());
|
||||||
|
|
||||||
UPDATE_COMBOBOX(comboBoxPriority, qBound(-2, m_preferences->processPriority(), 1), 0);
|
UPDATE_COMBOBOX(ui->comboBoxPriority, qBound(-2, m_preferences->processPriority(), 1), 0);
|
||||||
|
|
||||||
checkUse64BitAvs2YUV->setEnabled(m_x64);
|
ui->checkUse64BitAvs2YUV->setEnabled(m_x64);
|
||||||
labelUse64BitAvs2YUV->setEnabled(m_x64);
|
ui->labelUse64BitAvs2YUV->setEnabled(m_x64);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PreferencesDialog::eventFilter(QObject *o, QEvent *e)
|
bool PreferencesDialog::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
emulateMouseEvent(o, e, labelRunNextJob, checkRunNextJob);
|
emulateMouseEvent(o, e, ui->labelRunNextJob, ui->checkRunNextJob);
|
||||||
emulateMouseEvent(o, e, labelShutdownComputer, checkShutdownComputer);
|
emulateMouseEvent(o, e, ui->labelShutdownComputer, ui->checkShutdownComputer);
|
||||||
emulateMouseEvent(o, e, labelUse10BitEncoding, checkUse10BitEncoding);
|
emulateMouseEvent(o, e, ui->labelUse10BitEncoding, ui->checkUse10BitEncoding);
|
||||||
emulateMouseEvent(o, e, labelUse64BitAvs2YUV, checkUse64BitAvs2YUV);
|
emulateMouseEvent(o, e, ui->labelUse64BitAvs2YUV, ui->checkUse64BitAvs2YUV);
|
||||||
emulateMouseEvent(o, e, labelSaveLogFiles, checkSaveLogFiles);
|
emulateMouseEvent(o, e, ui->labelSaveLogFiles, ui->checkSaveLogFiles);
|
||||||
emulateMouseEvent(o, e, labelSaveToSourceFolder, checkSaveToSourceFolder);
|
emulateMouseEvent(o, e, ui->labelSaveToSourceFolder, ui->checkSaveToSourceFolder);
|
||||||
emulateMouseEvent(o, e, labelEnableSounds, checkEnableSounds);
|
emulateMouseEvent(o, e, ui->labelEnableSounds, ui->checkEnableSounds);
|
||||||
emulateMouseEvent(o, e, labelDisableWarnings, checkDisableWarnings);
|
emulateMouseEvent(o, e, ui->labelDisableWarnings, ui->checkDisableWarnings);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,16 +145,16 @@ void PreferencesDialog::emulateMouseEvent(QObject *object, QEvent *event, QWidge
|
|||||||
|
|
||||||
void PreferencesDialog::done(int n)
|
void PreferencesDialog::done(int n)
|
||||||
{
|
{
|
||||||
m_preferences->setAutoRunNextJob(checkRunNextJob->isChecked());
|
m_preferences->setAutoRunNextJob(ui->checkRunNextJob->isChecked());
|
||||||
m_preferences->setShutdownComputer(checkShutdownComputer->isChecked());
|
m_preferences->setShutdownComputer(ui->checkShutdownComputer->isChecked());
|
||||||
m_preferences->setUse10BitEncoding(checkUse10BitEncoding->isChecked());
|
m_preferences->setUse10BitEncoding(ui->checkUse10BitEncoding->isChecked());
|
||||||
m_preferences->setUseAvisyth64Bit(checkUse64BitAvs2YUV->isChecked());
|
m_preferences->setUseAvisyth64Bit(ui->checkUse64BitAvs2YUV->isChecked());
|
||||||
m_preferences->setSaveLogFiles(checkSaveLogFiles->isChecked());
|
m_preferences->setSaveLogFiles(ui->checkSaveLogFiles->isChecked());
|
||||||
m_preferences->setSaveToSourcePath(checkSaveToSourceFolder->isChecked());
|
m_preferences->setSaveToSourcePath(ui->checkSaveToSourceFolder->isChecked());
|
||||||
m_preferences->setMaxRunningJobCount(spinBoxJobCount->value());
|
m_preferences->setMaxRunningJobCount(ui->spinBoxJobCount->value());
|
||||||
m_preferences->setProcessPriority(comboBoxPriority->itemData(comboBoxPriority->currentIndex()).toInt());
|
m_preferences->setProcessPriority(ui->comboBoxPriority->itemData(ui->comboBoxPriority->currentIndex()).toInt());
|
||||||
m_preferences->setEnableSounds(checkEnableSounds->isChecked());
|
m_preferences->setEnableSounds(ui->checkEnableSounds->isChecked());
|
||||||
m_preferences->setDisableWarnings(checkDisableWarnings->isChecked());
|
m_preferences->setDisableWarnings(ui->checkDisableWarnings->isChecked());
|
||||||
|
|
||||||
PreferencesModel::savePreferences(m_preferences);
|
PreferencesModel::savePreferences(m_preferences);
|
||||||
QDialog::done(n);
|
QDialog::done(n);
|
||||||
@ -178,7 +177,7 @@ void PreferencesDialog::use10BitEncodingToggled(bool checked)
|
|||||||
|
|
||||||
if(QMessageBox::warning(this, tr("10-Bit Encoding"), text.replace("-", "−"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
|
if(QMessageBox::warning(this, tr("10-Bit Encoding"), text.replace("-", "−"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
|
||||||
{
|
{
|
||||||
UPDATE_CHECKBOX(checkUse10BitEncoding, false, true);
|
UPDATE_CHECKBOX(ui->checkUse10BitEncoding, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,7 +192,7 @@ void PreferencesDialog::disableWarningsToggled(bool checked)
|
|||||||
|
|
||||||
if(QMessageBox::warning(this, tr("Avisynth/VapourSynth Warnings"), text.replace("-", "−"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
|
if(QMessageBox::warning(this, tr("Avisynth/VapourSynth Warnings"), text.replace("-", "−"), tr("Continue"), tr("Revert"), QString(), 1) != 0)
|
||||||
{
|
{
|
||||||
UPDATE_CHECKBOX(checkDisableWarnings, false, true);
|
UPDATE_CHECKBOX(ui->checkDisableWarnings, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,11 +21,16 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "uic_win_preferences.h"
|
#include <QDialog>
|
||||||
|
|
||||||
class PreferencesModel;
|
class PreferencesModel;
|
||||||
|
|
||||||
class PreferencesDialog : public QDialog, private Ui::PreferencesDialog
|
namespace Ui
|
||||||
|
{
|
||||||
|
class PreferencesDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class PreferencesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -43,6 +48,7 @@ protected:
|
|||||||
void emulateMouseEvent(QObject *object, QEvent *event, QWidget *source, QWidget *target);
|
void emulateMouseEvent(QObject *object, QEvent *event, QWidget *source, QWidget *target);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Ui::PreferencesDialog *const ui;
|
||||||
PreferencesModel *m_preferences;
|
PreferencesModel *m_preferences;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
Loading…
Reference in New Issue
Block a user