*/
void x264_init_console(int argc, char* argv[])
{
- bool enableConsole = x264_is_prerelease();
+ bool enableConsole = x264_is_prerelease() || X264_DEBUG;
if(_environ)
{
labelBuildDate->setText(tr("Built on %1 at %2").arg(x264_version_date().toString(Qt::ISODate), QString::fromLatin1(x264_version_time())));
labelBuildDate->installEventFilter(this);
setWindowTitle(QString("%1 (%2 Mode)").arg(windowTitle(), m_x64supported ? "64-Bit" : "32-Bit"));
- if(x264_is_prerelease()) setWindowTitle(QString("%1 | PRE-RELEASE VERSION").arg(windowTitle()));
+ if(X264_DEBUG)
+ {
+ setWindowTitle(QString("%1 | !!! DEBUG VERSION !!!").arg(windowTitle()));
+ setStyleSheet("QMenuBar, QMainWindow { background-color: yellow }");
+ }
+ else if(x264_is_prerelease())
+ {
+ setWindowTitle(QString("%1 | PRE-RELEASE VERSION").arg(windowTitle()));
+ }
//Create model
m_jobList = new JobListModel();
QTimer::singleShot(5000, btn2, SLOT(show()));
msgBox.exec();
}
+
+ //Add files from command-line
+ bool bAddFile = false;
+ QStringList files, args = qApp->arguments();
+ while(!args.isEmpty())
+ {
+ QString current = args.takeFirst();
+ if(!bAddFile)
+ {
+ bAddFile = (current.compare("--add", Qt::CaseInsensitive) == 0);
+ continue;
+ }
+ if(QFileInfo(current).exists() && QFileInfo(current).isFile())
+ {
+ files << QFileInfo(current).canonicalFilePath();
+ }
+ }
+ if(int totalFiles = files.count())
+ {
+ bool ok = true; int n = 0;
+ while((!files.isEmpty()) && ok)
+ {
+ QString currentFile = files.takeFirst();
+ qDebug("Adding file: %s", currentFile.toUtf8().constData());
+ addButtonPressed(currentFile, n++, totalFiles, &ok);
+ }
+ }
}
void MainWindow::updateLabel(void)
bool PreferencesDialog::eventFilter(QObject *o, QEvent *e)
{
- if(o == labelRunNextJob && e->type() == QEvent::MouseButtonRelease)
- {
- QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(e);
- if(mouseEvent)
- {
- if(qApp->widgetAt(mouseEvent->globalPos()) == labelRunNextJob)
- {
- checkRunNextJob->click();
- }
- }
- }
- if(o == labelUse64BitAvs2YUV && e->type() == QEvent::MouseButtonRelease)
- {
- QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(e);
- if(mouseEvent)
- {
- if(qApp->widgetAt(mouseEvent->globalPos()) == labelUse64BitAvs2YUV)
- {
- checkUse64BitAvs2YUV->click();
- }
- }
- }
- if(o == labelShutdownComputer && e->type() == QEvent::MouseButtonRelease)
+ emulateMouseEvent(o, e, labelRunNextJob, checkRunNextJob);
+ emulateMouseEvent(o, e, labelShutdownComputer, checkShutdownComputer);
+ emulateMouseEvent(o, e, labelUse64BitAvs2YUV, checkUse64BitAvs2YUV);
+ return false;
+}
+
+void PreferencesDialog::emulateMouseEvent(QObject *object, QEvent *event, QWidget *source, QWidget *target)
+{
+ if(object == source)
{
- QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(e);
- if(mouseEvent)
+ if((event->type() == QEvent::MouseButtonPress) || (event->type() == QEvent::MouseButtonRelease))
{
- if(qApp->widgetAt(mouseEvent->globalPos()) == labelShutdownComputer)
+ if(QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event))
{
- checkShutdownComputer->click();
+ qApp->postEvent(target, new QMouseEvent
+ (
+ event->type(),
+ qApp->widgetAt(mouseEvent->globalPos()) == source ? QPoint(1, 1) : QPoint(INT_MAX, INT_MAX),
+ Qt::LeftButton,
+ 0, 0
+ ));
}
}
}
- return false;
}
void PreferencesDialog::accept(void)
virtual void showEvent(QShowEvent *event);
virtual bool eventFilter(QObject *o, QEvent *e);
+ void emulateMouseEvent(QObject *object, QEvent *event, QWidget *source, QWidget *target);
+
private:
Preferences *m_preferences;
};
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;QT_DEBUG;QT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)tmp\uic;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;QT_DEBUG;QT_DLL;QT_GUI_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtTest;$(SolutionDir)tmp\uic;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>QtMaind.lib;QtCored4.lib;QtGuid4.lib;Winmm.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
+ <PostBuildEvent>
+ <Command>rmdir /S /Q "$(SolutionDir)bin\$(Configuration)\toolset"
+mkdir "$(SolutionDir)bin\$(Configuration)\toolset"
+copy "$(SolutionDir)res\toolset\*.exe" "$(SolutionDir)bin\$(Configuration)\toolset"
+</Command>
+ </PostBuildEvent>
+ <PostBuildEvent>
+ <Message>Copy Toolset</Message>
+ </PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;QT_NO_DEBUG;QT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(SolutionDir)tmp\uic;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;QT_NO_DEBUG;QT_DLL;QT_GUI_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtTest;$(SolutionDir)tmp\uic;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>true</WholeProgramOptimization>