Improved queue support + some GUI redesign.
This commit is contained in:
parent
8d1c6d82ee
commit
a1e0b85787
117
gui/win_main.ui
117
gui/win_main.ui
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>512</height>
|
||||
<width>720</width>
|
||||
<height>640</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -15,31 +15,14 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="handleWidth">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="childrenCollapsible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@ -69,28 +52,72 @@
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QListView" name="logView">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Lucida Console</family>
|
||||
</font>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string> Job Details </string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<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>3</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListView" name="logView">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Lucida Console</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editDetails">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editDetails">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
@ -182,7 +209,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<width>720</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -220,6 +247,14 @@
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>buttonAddJob</tabstop>
|
||||
<tabstop>buttonStartJob</tabstop>
|
||||
<tabstop>buttonAbortJob</tabstop>
|
||||
<tabstop>jobsView</tabstop>
|
||||
<tabstop>logView</tabstop>
|
||||
<tabstop>editDetails</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../res/resources.qrc"/>
|
||||
</resources>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@ -68,7 +68,7 @@ QVariant JobListModel::headerData(int section, Qt::Orientation orientation, int
|
||||
return QVariant::fromValue<QString>(tr("Progress"));
|
||||
break;
|
||||
case 3:
|
||||
return QVariant::fromValue<QString>(tr("Progress Details"));
|
||||
return QVariant::fromValue<QString>(tr("Details"));
|
||||
break;
|
||||
default:
|
||||
return QVariant();
|
||||
@ -115,6 +115,12 @@ QVariant JobListModel::data(const QModelIndex &index, int role) const
|
||||
case EncodeThread::JobStatus_Running:
|
||||
return QVariant::fromValue<QString>(tr("Running..."));
|
||||
break;
|
||||
case EncodeThread::JobStatus_Running_Pass1:
|
||||
return QVariant::fromValue<QString>(tr("Running... (Pass 1)"));
|
||||
break;
|
||||
case EncodeThread::JobStatus_Running_Pass2:
|
||||
return QVariant::fromValue<QString>(tr("Running... (Pass 2)"));
|
||||
break;
|
||||
case EncodeThread::JobStatus_Completed:
|
||||
return QVariant::fromValue<QString>(tr("Completed."));
|
||||
break;
|
||||
@ -160,6 +166,8 @@ QVariant JobListModel::data(const QModelIndex &index, int role) const
|
||||
return QIcon(":/buttons/find.png");
|
||||
break;
|
||||
case EncodeThread::JobStatus_Running:
|
||||
case EncodeThread::JobStatus_Running_Pass1:
|
||||
case EncodeThread::JobStatus_Running_Pass2:
|
||||
return QIcon(":/buttons/play.png");
|
||||
break;
|
||||
case EncodeThread::JobStatus_Completed:
|
||||
|
@ -57,21 +57,21 @@ void EncodeThread::encode(void)
|
||||
{
|
||||
Sleep(1500);
|
||||
|
||||
for(int i = 0; i <= 100; i++)
|
||||
for(int i = 0; i <= 100; i += 5)
|
||||
{
|
||||
emit progressChanged(m_jobId, i);
|
||||
emit statusChanged(m_jobId, (i % 2) ? JobStatus_Indexing : JobStatus_Running);
|
||||
emit statusChanged(m_jobId, (i % 2) ? JobStatus_Indexing : JobStatus_Running_Pass1);
|
||||
emit messageLogged(m_jobId, QUuid::createUuid().toString());
|
||||
|
||||
for(int i = 0; i < 5; i++)
|
||||
for(int j = 0; j < 3; j++)
|
||||
{
|
||||
emit detailsChanged(m_jobId, QUuid::createUuid().toString());
|
||||
Sleep(200);
|
||||
Sleep(120);
|
||||
}
|
||||
|
||||
if(m_abort)
|
||||
{
|
||||
Sleep(1500);
|
||||
Sleep(500);
|
||||
emit statusChanged(m_jobId, JobStatus_Aborted);
|
||||
return;
|
||||
}
|
||||
@ -79,5 +79,27 @@ void EncodeThread::encode(void)
|
||||
|
||||
Sleep(1500);
|
||||
|
||||
for(int i = 0; i <= 100; i += 5)
|
||||
{
|
||||
emit progressChanged(m_jobId, i);
|
||||
emit statusChanged(m_jobId, (i % 2) ? JobStatus_Indexing : JobStatus_Running_Pass2);
|
||||
emit messageLogged(m_jobId, QUuid::createUuid().toString());
|
||||
|
||||
for(int j = 0; j < 3; j++)
|
||||
{
|
||||
emit detailsChanged(m_jobId, QUuid::createUuid().toString());
|
||||
Sleep(120);
|
||||
}
|
||||
|
||||
if(m_abort)
|
||||
{
|
||||
Sleep(500);
|
||||
emit statusChanged(m_jobId, JobStatus_Aborted);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Sleep(250);
|
||||
|
||||
emit statusChanged(m_jobId, JobStatus_Completed);
|
||||
}
|
||||
|
@ -35,10 +35,12 @@ public:
|
||||
JobStatus_Starting = 1,
|
||||
JobStatus_Indexing = 2,
|
||||
JobStatus_Running = 3,
|
||||
JobStatus_Completed = 4,
|
||||
JobStatus_Failed = 5,
|
||||
JobStatus_Aborting = 6,
|
||||
JobStatus_Aborted = 7
|
||||
JobStatus_Running_Pass1 = 4,
|
||||
JobStatus_Running_Pass2 = 5,
|
||||
JobStatus_Completed = 6,
|
||||
JobStatus_Failed = 7,
|
||||
JobStatus_Aborting = 8,
|
||||
JobStatus_Aborted = 9
|
||||
};
|
||||
|
||||
EncodeThread(void);
|
||||
|
@ -86,7 +86,7 @@ void MainWindow::addButtonPressed(void)
|
||||
{
|
||||
EncodeThread *thrd = new EncodeThread();
|
||||
QModelIndex newIndex = m_jobList->insertJob(thrd);
|
||||
jobsView->selectionModel()->setCurrentIndex(newIndex, QItemSelectionModel::ClearAndSelect);
|
||||
jobsView->selectRow(newIndex.row());
|
||||
}
|
||||
|
||||
void MainWindow::startButtonPressed(void)
|
||||
@ -98,6 +98,7 @@ void MainWindow::abortButtonPressed(void)
|
||||
{
|
||||
m_jobList->abortJob(jobsView->currentIndex());
|
||||
}
|
||||
|
||||
void MainWindow::jobSelected(const QModelIndex & current, const QModelIndex & previous)
|
||||
{
|
||||
qDebug("Job selected: %d", current.row());
|
||||
@ -124,11 +125,15 @@ void MainWindow::jobChangedData(const QModelIndex &topLeft, const QModelIndex &
|
||||
{
|
||||
for(int i = topLeft.row(); i <= bottomRight.row(); i++)
|
||||
{
|
||||
EncodeThread::JobStatus status = m_jobList->getJobStatus(m_jobList->index(i, 0, QModelIndex()));
|
||||
if(i == selected)
|
||||
{
|
||||
qDebug("Current job changed status!");
|
||||
updateButtons(m_jobList->getJobStatus(m_jobList->index(i, 0, QModelIndex())));
|
||||
break;
|
||||
updateButtons(status);
|
||||
}
|
||||
if(status == EncodeThread::JobStatus_Completed)
|
||||
{
|
||||
QTimer::singleShot(0, this, SLOT(launchNextJob()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -166,15 +171,42 @@ void MainWindow::showAbout(void)
|
||||
QString text;
|
||||
const char *url = "http://mulder.brhack.net/";
|
||||
|
||||
text += QString().sprintf("<nobr><tt>Simple x264 Launcher v%u.%02u − use 64−Bit x264 with 32−Bit Avisynth<br>", x264_version_major(), x264_version_minor());
|
||||
text += QString().sprintf("Copyright (c) 2004−%04d LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved.<br>", qMax(x264_version_date().year(),QDate::currentDate().year()));
|
||||
text += QString().sprintf("Built on %s at %s with %s for Win−%s.<br><br>", x264_version_date().toString(Qt::ISODate).toLatin1().constData(), x264_version_time(), x264_version_compiler(), x264_version_arch());
|
||||
text += QString().sprintf("<nobr><tt>Simple x264 Launcher v%u.%02u - use 64-Bit x264 with 32-Bit Avisynth<br>", x264_version_major(), x264_version_minor());
|
||||
text += QString().sprintf("Copyright (c) 2004-%04d LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved.<br>", qMax(x264_version_date().year(),QDate::currentDate().year()));
|
||||
text += QString().sprintf("Built on %s at %s with %s for Win-%s.<br><br>", x264_version_date().toString(Qt::ISODate).toLatin1().constData(), x264_version_time(), x264_version_compiler(), x264_version_arch());
|
||||
text += QString().sprintf("This program is free software: you can redistribute it and/or modify<br>");
|
||||
text += QString().sprintf("it under the terms of the GNU General Public License <http://www.gnu.org/>.<br>");
|
||||
text += QString().sprintf("Note that this program is distributed with ABSOLUTELY NO WARRANTY.<br><br>");
|
||||
text += QString().sprintf("Please check the web−site at <a href=\"%s\">%s</a> for updates !!!<br></tt></nobr>", url, url);
|
||||
text += QString().sprintf("Please check the web-site at <a href=\"%s\">%s</a> for updates !!!<br></tt></nobr>", url, url);
|
||||
|
||||
QMessageBox::information(this, tr("About..."), text);
|
||||
QMessageBox::information(this, tr("About..."), text.replace("-", "−"));
|
||||
}
|
||||
|
||||
void MainWindow::launchNextJob(void)
|
||||
{
|
||||
const int rows = m_jobList->rowCount(QModelIndex());
|
||||
|
||||
for(int i = 0; i < rows; i++)
|
||||
{
|
||||
EncodeThread::JobStatus status = m_jobList->getJobStatus(m_jobList->index(i, 0, QModelIndex()));
|
||||
if(status == EncodeThread::JobStatus_Running || status == EncodeThread::JobStatus_Running_Pass1 || status == EncodeThread::JobStatus_Running_Pass2)
|
||||
{
|
||||
qWarning("Still have a job running, won't launch next yet!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < rows; i++)
|
||||
{
|
||||
EncodeThread::JobStatus status = m_jobList->getJobStatus(m_jobList->index(i, 0, QModelIndex()));
|
||||
if(status == EncodeThread::JobStatus_Enqueued)
|
||||
{
|
||||
m_jobList->startJob(m_jobList->index(i, 0, QModelIndex()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
qWarning("No enqueued jobs left!");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -206,5 +238,6 @@ void MainWindow::updateButtons(EncodeThread::JobStatus status)
|
||||
qDebug("MainWindow::updateButtons(void)");
|
||||
|
||||
buttonStartJob->setEnabled(status == EncodeThread::JobStatus_Enqueued);
|
||||
buttonAbortJob->setEnabled(status == EncodeThread::JobStatus_Indexing || status == EncodeThread::JobStatus_Running);
|
||||
buttonAbortJob->setEnabled(status == EncodeThread::JobStatus_Indexing || status == EncodeThread::JobStatus_Running ||
|
||||
status == EncodeThread::JobStatus_Running_Pass1 || status == EncodeThread::JobStatus_Running_Pass2 );
|
||||
}
|
||||
|
@ -50,4 +50,5 @@ private slots:
|
||||
void jobChangedData(const QModelIndex &top, const QModelIndex &bottom);
|
||||
void jobLogExtended(const QModelIndex & parent, int start, int end);
|
||||
void showAbout(void);
|
||||
void launchNextJob(void);
|
||||
};
|
||||
|
@ -66,8 +66,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<Optimization>Full</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
@ -80,14 +79,17 @@
|
||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<CreateHotpatchableImage>false</CreateHotpatchableImage>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>QtMain.lib;QtCore4.lib;QtGui4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
@ -111,6 +113,7 @@
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp\qrc\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<SubType>Designer</SubType>
|
||||
</CustomBuild>
|
||||
<None Include="res\icons\movie.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="src\thread_encode.h">
|
||||
@ -121,6 +124,7 @@
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp\moc\moc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp\moc\moc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="src\global.h" />
|
||||
<CustomBuild Include="src\model_jobList.h">
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\moc\moc_%(Filename).cpp" "%(FullPath)"</Command>
|
||||
@ -162,6 +166,9 @@
|
||||
<ClCompile Include="tmp\moc\moc_win_main.cpp" />
|
||||
<ClCompile Include="tmp\qrc\qrc_resources.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="x264_launcher.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
@ -22,6 +22,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\icons\movie.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\global.h">
|
||||
@ -33,6 +36,9 @@
|
||||
<ClInclude Include="src\version.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.cpp">
|
||||
@ -89,4 +95,9 @@
|
||||
<Filter>Header Files</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="x264_launcher.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user