<x>0</x>
<y>0</y>
<width>379</width>
- <height>260</height>
+ <height>292</height>
</rect>
</property>
<property name="windowTitle">
</property>
</widget>
</item>
- <item row="1" column="0" rowspan="8">
+ <item row="1" column="0" rowspan="10">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="1" column="6" rowspan="8">
+ <item row="1" column="6" rowspan="10">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="8" column="1">
+ <item row="10" column="1">
<widget class="QCheckBox" name="checkShutdownComputer">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
- <item row="8" column="2" colspan="4">
+ <item row="10" column="2" colspan="4">
<widget class="QLabel" name="labelShutdownComputer">
<property name="text">
<string>Shutdown computer as soon as the last job has completed</string>
</property>
</spacer>
</item>
- <item row="9" column="1" colspan="5">
+ <item row="11" column="1" colspan="5">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
+ <item row="8" column="1">
+ <widget class="QCheckBox" name="checkSaveLogFiles">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="2" colspan="4">
+ <widget class="QLabel" name="labelSaveLogFiles">
+ <property name="text">
+ <string>Automatically save output to log file when a job has finished</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="1" colspan="5">
+ <spacer name="verticalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</item>
</layout>
QDateTime startTime = QDateTime::currentDateTime();
//Print some basic info
+ log(tr("Simple x264 Launcher (Build #%1), built %2\n").arg(QString::number(x264_version_build()), x264_version_date().toString(Qt::ISODate)));
log(tr("Job started at %1, %2.\n").arg(QDate::currentDate().toString(Qt::ISODate), QTime::currentTime().toString( Qt::ISODate)));
log(tr("Source file: %1").arg(m_sourceFileName));
log(tr("Output file: %1").arg(m_outputFileName));
#define VER_X264_MAJOR 2
#define VER_X264_MINOR 0
#define VER_X264_PATCH 4
-#define VER_X264_BUILD 312
+#define VER_X264_BUILD 325
#define VER_X264_MINIMUM_REV 2189
#define VER_X264_CURRENT_API 124
#include <QProcess>
#include <QProgressDialog>
#include <QScrollBar>
+#include <QTextStream>
#include <Mmsystem.h>
{
if(m_preferences.autoRunNextJob) QTimer::singleShot(0, this, SLOT(launchNextJob()));
if(m_preferences.shutdownComputer) QTimer::singleShot(0, this, SLOT(shutdownComputer()));
+ if(m_preferences.saveLogFiles) saveLogFile(m_jobList->index(i, 1, QModelIndex()));
}
}
}
void MainWindow::launchNextJob(void)
{
qDebug("launchNextJob(void)");
-
const int rows = m_jobList->rowCount(QModelIndex());
}
/*
+ * Save log to text file
+ */
+void MainWindow::saveLogFile(const QModelIndex &index)
+{
+ if(index.isValid())
+ {
+ if(LogFileModel *log = m_jobList->getLogFile(index))
+ {
+ QDir(QString("%1/logs").arg(x264_data_path())).mkpath(".");
+ QString logFilePath = QString("%1/logs/LOG.%2.%3.txt").arg(x264_data_path(), QDate::currentDate().toString(Qt::ISODate), QTime::currentTime().toString(Qt::ISODate).replace(':', "-"));
+ QFile outFile(logFilePath);
+ if(outFile.open(QIODevice::WriteOnly))
+ {
+ QTextStream outStream(&outFile);
+ outStream.setCodec("UTF-8");
+ outStream.setGenerateByteOrderMark(true);
+
+ const int rows = log->rowCount(QModelIndex());
+ for(int i = 0; i < rows; i++)
+ {
+ outStream << log->data(log->index(i, 0, QModelIndex()), Qt::DisplayRole).toString() << QLatin1String("\r\n");
+ }
+ outFile.close();
+ }
+ else
+ {
+ qWarning("Failed to open log file for writing:\n%s", logFilePath.toUtf8().constData());
+ }
+ }
+ }
+}
+
+/*
* Shut down the computer (with countdown)
*/
void MainWindow::shutdownComputer(void)
if(val != 1) { close(); qApp->exit(-1); return; }
}
}
+ else
+ {
+ qWarning("Failed to load avisynth.dll libraray!");
+ }
if(avisynthVersion < 2.5)
{
int val = QMessageBox::warning(this, tr("Avisynth Missing"), tr("<nobr>It appears that Avisynth is <b>not</b> currently installed on your computer.<br>Therefore Avisynth (.avs) input will <b>not</b> be working at all!<br><br>Please download and install Avisynth:<br><a href=\"http://sourceforge.net/projects/avisynth2/files/AviSynth%202.5/\">http://sourceforge.net/projects/avisynth2/files/AviSynth 2.5/</a></nobr>").replace("-", "−"), tr("Quit"), tr("Ignore"));
m_avsLib->unload(); X264_DELETE(m_avsLib);
if(val != 1) { close(); qApp->exit(-1); return; }
}
+ qDebug("");
}
//Check for expiration
void launchNextJob();
void pauseButtonPressed(bool checked);
void restartButtonPressed(void);
+ void saveLogFile(const QModelIndex &index);
void showAbout(void);
void showPreferences(void);
void showWebLink(void);
labelUse10BitEncoding->installEventFilter(this);
labelUse64BitAvs2YUV->installEventFilter(this);
labelShutdownComputer->installEventFilter(this);
+ labelSaveLogFiles->installEventFilter(this);
connect(resetButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed()));
connect(checkUse10BitEncoding, SIGNAL(toggled(bool)), this, SLOT(use10BitEncodingToggled(bool)));
UPDATE_CHECKBOX(checkRunNextJob, m_preferences->autoRunNextJob);
UPDATE_CHECKBOX(checkShutdownComputer, m_preferences->shutdownComputer);
UPDATE_CHECKBOX(checkUse64BitAvs2YUV, m_preferences->useAvisyth64Bit);
+ UPDATE_CHECKBOX(checkSaveLogFiles, m_preferences->saveLogFiles);
checkUse10BitEncoding->blockSignals(true);
UPDATE_CHECKBOX(checkUse10BitEncoding, m_preferences->use10BitEncoding);
emulateMouseEvent(o, e, labelShutdownComputer, checkShutdownComputer);
emulateMouseEvent(o, e, labelUse10BitEncoding, checkUse10BitEncoding);
emulateMouseEvent(o, e, labelUse64BitAvs2YUV, checkUse64BitAvs2YUV);
+ emulateMouseEvent(o, e, labelSaveLogFiles, checkSaveLogFiles);
return false;
}
m_preferences->shutdownComputer = checkShutdownComputer->isChecked();
m_preferences->use10BitEncoding = checkUse10BitEncoding->isChecked();
m_preferences->useAvisyth64Bit = checkUse64BitAvs2YUV->isChecked();
+ m_preferences->saveLogFiles = checkSaveLogFiles->isChecked();
m_preferences->maxRunningJobCount = spinBoxJobCount->value();
savePreferences(m_preferences);
preferences->shutdownComputer = false;
preferences->use10BitEncoding = false;
preferences->useAvisyth64Bit = false;
+ preferences->saveLogFiles = false;
}
void PreferencesDialog::loadPreferences(Preferences *preferences)
preferences->shutdownComputer = settings.value("shutdown_computer_on_completion", QVariant(defaults.shutdownComputer)).toBool();
preferences->use10BitEncoding = settings.value("use_10bit_encoding", QVariant(defaults.use10BitEncoding)).toBool();
preferences->useAvisyth64Bit = settings.value("use_64bit_avisynth", QVariant(defaults.useAvisyth64Bit)).toBool();
+ preferences->saveLogFiles = settings.value("save_log_files", QVariant(defaults.saveLogFiles)).toBool();
}
void PreferencesDialog::savePreferences(Preferences *preferences)
settings.setValue("max_running_job_count", preferences->maxRunningJobCount);
settings.setValue("use_10bit_encoding", preferences->use10BitEncoding);
settings.setValue("use_64bit_avisynth", preferences->useAvisyth64Bit);
+ settings.setValue("save_log_files", preferences->saveLogFiles);
settings.sync();
}
bool shutdownComputer;
bool use10BitEncoding;
bool useAvisyth64Bit;
+ bool saveLogFiles;
}
Preferences;