Implement support for Job Objects + improve log view.
This commit is contained in:
parent
136d4a5350
commit
571df62e39
@ -10,13 +10,13 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>640</width>
|
<width>640</width>
|
||||||
<height>512</height>
|
<height>384</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>640</width>
|
<width>640</width>
|
||||||
<height>512</height>
|
<height>384</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -26,154 +26,338 @@
|
|||||||
<iconset resource="../res/Icons.qrc">
|
<iconset resource="../res/Icons.qrc">
|
||||||
<normaloff>:/icons/application_xp_terminal.png</normaloff>:/icons/application_xp_terminal.png</iconset>
|
<normaloff>:/icons/application_xp_terminal.png</normaloff>:/icons/application_xp_terminal.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item row="0" column="0">
|
<property name="spacing">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<number>0</number>
|
||||||
<item row="0" column="0" colspan="4">
|
</property>
|
||||||
<widget class="QPlainTextEdit" name="textEdit">
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="baseLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="headerFrame">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
<palette>
|
<palette>
|
||||||
<active>
|
<active>
|
||||||
<colorrole role="Text">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>170</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
<colorrole role="Base">
|
||||||
<brush brushstyle="SolidPattern">
|
<brush brushstyle="SolidPattern">
|
||||||
<color alpha="255">
|
<color alpha="255">
|
||||||
<red>0</red>
|
<red>255</red>
|
||||||
<green>31</green>
|
<green>255</green>
|
||||||
<blue>0</blue>
|
<blue>255</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Window">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>255</green>
|
||||||
|
<blue>255</blue>
|
||||||
</color>
|
</color>
|
||||||
</brush>
|
</brush>
|
||||||
</colorrole>
|
</colorrole>
|
||||||
</active>
|
</active>
|
||||||
<inactive>
|
<inactive>
|
||||||
<colorrole role="Text">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>170</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
<colorrole role="Base">
|
||||||
<brush brushstyle="SolidPattern">
|
<brush brushstyle="SolidPattern">
|
||||||
<color alpha="255">
|
<color alpha="255">
|
||||||
<red>0</red>
|
<red>255</red>
|
||||||
<green>31</green>
|
<green>255</green>
|
||||||
<blue>0</blue>
|
<blue>255</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Window">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>255</green>
|
||||||
|
<blue>255</blue>
|
||||||
</color>
|
</color>
|
||||||
</brush>
|
</brush>
|
||||||
</colorrole>
|
</colorrole>
|
||||||
</inactive>
|
</inactive>
|
||||||
<disabled>
|
<disabled>
|
||||||
<colorrole role="Text">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>120</red>
|
|
||||||
<green>120</green>
|
|
||||||
<blue>120</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
<colorrole role="Base">
|
||||||
<brush brushstyle="SolidPattern">
|
<brush brushstyle="SolidPattern">
|
||||||
<color alpha="255">
|
<color alpha="255">
|
||||||
<red>240</red>
|
<red>255</red>
|
||||||
<green>240</green>
|
<green>255</green>
|
||||||
<blue>240</blue>
|
<blue>255</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Window">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>255</green>
|
||||||
|
<blue>255</blue>
|
||||||
</color>
|
</color>
|
||||||
</brush>
|
</brush>
|
||||||
</colorrole>
|
</colorrole>
|
||||||
</disabled>
|
</disabled>
|
||||||
</palette>
|
</palette>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="autoFillBackground">
|
||||||
<font>
|
<bool>true</bool>
|
||||||
<family>Lucida Console</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="plainText">
|
<property name="frameShape">
|
||||||
<string>C:\DOS
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="headerIcon">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>56</width>
|
||||||
|
<height>56</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>56</width>
|
||||||
|
<height>56</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../res/Images.qrc">:/images/HeaderIcon_LogFile.png</pixmap>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="headerSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>15</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="headerText">
|
||||||
|
<property name="text">
|
||||||
|
<string><b>Log File</b><br>The log file shows detailed information about the selected job.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="horizontalBar">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>2</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>2</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::HLine</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Sunken</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="margin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0" colspan="4">
|
||||||
|
<widget class="QPlainTextEdit" name="textEdit">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>170</red>
|
||||||
|
<green>255</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Base">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>31</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>170</red>
|
||||||
|
<green>255</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Base">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>31</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="Text">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>120</red>
|
||||||
|
<green>120</green>
|
||||||
|
<blue>120</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
<colorrole role="Base">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>240</red>
|
||||||
|
<green>240</green>
|
||||||
|
<blue>240</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Lucida Console</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="plainText">
|
||||||
|
<string>C:\DOS
|
||||||
C:\DOS\RUN
|
C:\DOS\RUN
|
||||||
RUN\DOS\RUN
|
RUN\DOS\RUN
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
<set>Qt::NoTextInteraction</set>
|
<set>Qt::NoTextInteraction</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
<item row="1" column="3">
|
||||||
<widget class="QPushButton" name="buttonDiscard">
|
<widget class="QPushButton" name="buttonDiscard">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>90</width>
|
<width>90</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Discard</string>
|
<string>Discard</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../res/Icons.qrc">
|
<iconset resource="../res/Icons.qrc">
|
||||||
<normaloff>:/icons/cross.png</normaloff>:/icons/cross.png</iconset>
|
<normaloff>:/icons/cross.png</normaloff>:/icons/cross.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QPushButton" name="buttonSave">
|
<widget class="QPushButton" name="buttonSave">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>130</width>
|
<width>130</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save to File...</string>
|
<string>Save to File...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../res/Icons.qrc">
|
<iconset resource="../res/Icons.qrc">
|
||||||
<normaloff>:/icons/disk.png</normaloff>:/icons/disk.png</iconset>
|
<normaloff>:/icons/disk.png</normaloff>:/icons/disk.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>40</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QPushButton" name="buttonCopy">
|
<widget class="QPushButton" name="buttonCopy">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>130</width>
|
<width>130</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Copy to Clipboard</string>
|
<string>Copy to Clipboard</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../res/Icons.qrc">
|
<iconset resource="../res/Icons.qrc">
|
||||||
<normaloff>:/icons/paste_plain.png</normaloff>:/icons/paste_plain.png</iconset>
|
<normaloff>:/icons/paste_plain.png</normaloff>:/icons/paste_plain.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
@ -181,6 +365,8 @@ RUN\DOS\RUN
|
|||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../res/Icons.qrc"/>
|
<include location="../res/Icons.qrc"/>
|
||||||
|
<include location="../res/Images.qrc"/>
|
||||||
|
<include location="../res/Images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<qresource>
|
<qresource>
|
||||||
<file>images/Busy.gif</file>
|
<file>images/Busy.gif</file>
|
||||||
<file>images/HeaderIcon_MetaInfo.png</file>
|
<file>images/HeaderIcon_MetaInfo.png</file>
|
||||||
|
<file>images/HeaderIcon_LogFile.png</file>
|
||||||
<file>images/Label.png</file>
|
<file>images/Label.png</file>
|
||||||
<file>images/Loading.gif</file>
|
<file>images/Loading.gif</file>
|
||||||
<file>images/Logo.png</file>
|
<file>images/Logo.png</file>
|
||||||
|
BIN
res/images/HeaderIcon_LogFile.png
Normal file
BIN
res/images/HeaderIcon_LogFile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
@ -25,7 +25,7 @@
|
|||||||
#define VER_LAMEXP_MAJOR 4
|
#define VER_LAMEXP_MAJOR 4
|
||||||
#define VER_LAMEXP_MINOR_HI 0
|
#define VER_LAMEXP_MINOR_HI 0
|
||||||
#define VER_LAMEXP_MINOR_LO 0
|
#define VER_LAMEXP_MINOR_LO 0
|
||||||
#define VER_LAMEXP_BUILD 70
|
#define VER_LAMEXP_BUILD 74
|
||||||
#define VER_LAMEXP_SUFFIX TechPreview
|
#define VER_LAMEXP_SUFFIX TechPreview
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
LogViewDialog::LogViewDialog(QWidget *parent)
|
LogViewDialog::LogViewDialog(QWidget *parent)
|
||||||
:
|
:
|
||||||
@ -64,6 +65,7 @@ void LogViewDialog::copyButtonClicked(void)
|
|||||||
mime->setData("text/plain", textEdit->toPlainText().toUtf8().constData());
|
mime->setData("text/plain", textEdit->toPlainText().toUtf8().constData());
|
||||||
QApplication::clipboard()->setMimeData(mime);
|
QApplication::clipboard()->setMimeData(mime);
|
||||||
m_clipboardUsed = true;
|
m_clipboardUsed = true;
|
||||||
|
MessageBeep(MB_ICONINFORMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogViewDialog::saveButtonClicked(void)
|
void LogViewDialog::saveButtonClicked(void)
|
||||||
|
@ -132,6 +132,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
|
|||||||
m_fileSystemModel = new QFileSystemModel();
|
m_fileSystemModel = new QFileSystemModel();
|
||||||
m_fileSystemModel->setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
|
m_fileSystemModel->setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
m_fileSystemModel->setRootPath(m_fileSystemModel->rootPath());
|
m_fileSystemModel->setRootPath(m_fileSystemModel->rootPath());
|
||||||
|
m_fileSystemModel->installEventFilter(this);
|
||||||
outputFolderView->setModel(m_fileSystemModel);
|
outputFolderView->setModel(m_fileSystemModel);
|
||||||
outputFolderView->header()->setStretchLastSection(true);
|
outputFolderView->header()->setStretchLastSection(true);
|
||||||
outputFolderView->header()->hideSection(1);
|
outputFolderView->header()->hideSection(1);
|
||||||
@ -393,6 +394,17 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
|||||||
m_dropNoteLabel->setGeometry(0, 0, sourceFileView->width(), sourceFileView->height());
|
m_dropNoteLabel->setGeometry(0, 0, sourceFileView->width(), sourceFileView->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
|
||||||
|
{
|
||||||
|
if(obj == m_fileSystemModel)
|
||||||
|
{
|
||||||
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
|
QTimer::singleShot(0, this, SLOT(restoreCursor()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Slots
|
// Slots
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@ -1111,3 +1123,11 @@ void MainWindow::saveToSourceFolderChanged(void)
|
|||||||
{
|
{
|
||||||
m_settings->outputToSourceDir(saveToSourceFolderCheckBox->isChecked());
|
m_settings->outputToSourceDir(saveToSourceFolderCheckBox->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Restore the override cursor
|
||||||
|
*/
|
||||||
|
void MainWindow::restoreCursor(void)
|
||||||
|
{
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
}
|
||||||
|
@ -80,6 +80,7 @@ private slots:
|
|||||||
void metaTagsEnabledChanged(void);
|
void metaTagsEnabledChanged(void);
|
||||||
void playlistEnabledChanged(void);
|
void playlistEnabledChanged(void);
|
||||||
void saveToSourceFolderChanged(void);
|
void saveToSourceFolderChanged(void);
|
||||||
|
void restoreCursor(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *event);
|
void showEvent(QShowEvent *event);
|
||||||
@ -87,6 +88,7 @@ protected:
|
|||||||
void dropEvent(QDropEvent *event);
|
void dropEvent(QDropEvent *event);
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
void resizeEvent(QResizeEvent *event);
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
bool eventFilter(QObject *obj, QEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addFiles(const QStringList &files);
|
void addFiles(const QStringList &files);
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QMenu>
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
@ -90,6 +91,13 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, AudioFileModel
|
|||||||
connect(m_progressModel, SIGNAL(modelReset()), this, SLOT(progressModelChanged()));
|
connect(m_progressModel, SIGNAL(modelReset()), this, SLOT(progressModelChanged()));
|
||||||
connect(view_log, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(logViewDoubleClicked(QModelIndex)));
|
connect(view_log, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(logViewDoubleClicked(QModelIndex)));
|
||||||
|
|
||||||
|
//Create context menu
|
||||||
|
m_contextMenu = new QMenu();
|
||||||
|
QAction *contextMenuAction = m_contextMenu->addAction(QIcon(":/icons/zoom.png"), "Show details for selected job");
|
||||||
|
view_log->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
connect(view_log, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTriggered(QPoint)));
|
||||||
|
connect(contextMenuAction, SIGNAL(triggered(bool)), this, SLOT(contextMenuActionTriggered()));
|
||||||
|
|
||||||
//Enque jobs
|
//Enque jobs
|
||||||
if(fileListModel)
|
if(fileListModel)
|
||||||
{
|
{
|
||||||
@ -117,6 +125,7 @@ ProcessingDialog::~ProcessingDialog(void)
|
|||||||
if(m_progressIndicator) m_progressIndicator->stop();
|
if(m_progressIndicator) m_progressIndicator->stop();
|
||||||
LAMEXP_DELETE(m_progressIndicator);
|
LAMEXP_DELETE(m_progressIndicator);
|
||||||
LAMEXP_DELETE(m_progressModel);
|
LAMEXP_DELETE(m_progressModel);
|
||||||
|
LAMEXP_DELETE(m_contextMenu);
|
||||||
|
|
||||||
while(!m_threadList.isEmpty())
|
while(!m_threadList.isEmpty())
|
||||||
{
|
{
|
||||||
@ -194,8 +203,12 @@ void ProcessingDialog::initEncoding(void)
|
|||||||
button_AbortProcess->setEnabled(true);
|
button_AbortProcess->setEnabled(true);
|
||||||
progressBar->setRange(0, m_pendingJobs.count());
|
progressBar->setRange(0, m_pendingJobs.count());
|
||||||
|
|
||||||
startNextJob(); //TODO: Start as many jobs in parallel as processors available
|
lamexp_cpu_t cpuFeatures = lamexp_detect_cpu_features();
|
||||||
startNextJob();
|
|
||||||
|
for(int i = 0; i < min(max(cpuFeatures.count, 1), 4); i++)
|
||||||
|
{
|
||||||
|
startNextJob();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessingDialog::abortEncoding(void)
|
void ProcessingDialog::abortEncoding(void)
|
||||||
@ -292,9 +305,25 @@ void ProcessingDialog::logViewDoubleClicked(const QModelIndex &index)
|
|||||||
{
|
{
|
||||||
const QStringList &logFile = m_progressModel->getLogFile(index);
|
const QStringList &logFile = m_progressModel->getLogFile(index);
|
||||||
LogViewDialog *logView = new LogViewDialog(this);
|
LogViewDialog *logView = new LogViewDialog(this);
|
||||||
|
logView->setWindowTitle(QString("LameXP - %1").arg(m_progressModel->data(index, Qt::DisplayRole).toString()));
|
||||||
logView->exec(logFile);
|
logView->exec(logFile);
|
||||||
LAMEXP_DELETE(logView);
|
LAMEXP_DELETE(logView);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBeep(MB_ICONWARNING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcessingDialog::contextMenuTriggered(const QPoint &pos)
|
||||||
|
{
|
||||||
|
m_contextMenu->popup(view_log->mapToGlobal(pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcessingDialog::contextMenuActionTriggered(void)
|
||||||
|
{
|
||||||
|
QModelIndex index = view_log->indexAt(view_log->mapFromGlobal(m_contextMenu->pos()));
|
||||||
|
logViewDoubleClicked(index.isValid() ? index : view_log->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
|
||||||
class QMovie;
|
class QMovie;
|
||||||
|
class QMenu;
|
||||||
class ProgressModel;
|
class ProgressModel;
|
||||||
class ProcessThread;
|
class ProcessThread;
|
||||||
class FileListModel;
|
class FileListModel;
|
||||||
@ -47,6 +48,8 @@ private slots:
|
|||||||
void processFinished(const QUuid &jobId, const QString &outFileName, bool success);
|
void processFinished(const QUuid &jobId, const QString &outFileName, bool success);
|
||||||
void progressModelChanged(void);
|
void progressModelChanged(void);
|
||||||
void logViewDoubleClicked(const QModelIndex &index);
|
void logViewDoubleClicked(const QModelIndex &index);
|
||||||
|
void contextMenuTriggered(const QPoint &pos);
|
||||||
|
void contextMenuActionTriggered(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *event);
|
void showEvent(QShowEvent *event);
|
||||||
@ -66,6 +69,7 @@ private:
|
|||||||
QMovie *m_progressIndicator;
|
QMovie *m_progressIndicator;
|
||||||
ProgressModel *m_progressModel;
|
ProgressModel *m_progressModel;
|
||||||
QStringList m_playList;
|
QStringList m_playList;
|
||||||
|
QMenu *m_contextMenu;
|
||||||
unsigned int m_runningThreads;
|
unsigned int m_runningThreads;
|
||||||
unsigned int m_currentFile;
|
unsigned int m_currentFile;
|
||||||
unsigned int m_succeededFiles;
|
unsigned int m_succeededFiles;
|
||||||
|
@ -22,12 +22,36 @@
|
|||||||
#include "Encoder_Abstract.h"
|
#include "Encoder_Abstract.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <QProcess>
|
||||||
|
#include <QMutex>
|
||||||
|
#include <QMutexLocker>
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
|
QMutex *AbstractEncoder::m_mutex_startProcess = NULL;
|
||||||
|
HANDLE AbstractEncoder::m_handle_jobObject = NULL;
|
||||||
|
|
||||||
AbstractEncoder::AbstractEncoder(void)
|
AbstractEncoder::AbstractEncoder(void)
|
||||||
{
|
{
|
||||||
|
if(!m_mutex_startProcess)
|
||||||
|
{
|
||||||
|
m_mutex_startProcess = new QMutex();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!m_handle_jobObject)
|
||||||
|
{
|
||||||
|
m_handle_jobObject = CreateJobObject(NULL, NULL);
|
||||||
|
if(m_handle_jobObject)
|
||||||
|
{
|
||||||
|
JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobExtendedLimitInfo;
|
||||||
|
memset(&jobExtendedLimitInfo, 0, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION));
|
||||||
|
jobExtendedLimitInfo.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE | JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION;
|
||||||
|
SetInformationJobObject(m_handle_jobObject, JobObjectExtendedLimitInformation, &jobExtendedLimitInfo, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_configBitrate = 0;
|
m_configBitrate = 0;
|
||||||
m_configRCMode = 0;
|
m_configRCMode = 0;
|
||||||
}
|
}
|
||||||
@ -36,10 +60,40 @@ AbstractEncoder::~AbstractEncoder(void)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//Setters
|
/*
|
||||||
|
* Setters
|
||||||
|
*/
|
||||||
|
|
||||||
void AbstractEncoder::setBitrate(int bitrate) { m_configBitrate = max(0, bitrate); }
|
void AbstractEncoder::setBitrate(int bitrate) { m_configBitrate = max(0, bitrate); }
|
||||||
void AbstractEncoder::setRCMode(int mode) { m_configRCMode = max(0, mode); }
|
void AbstractEncoder::setRCMode(int mode) { m_configRCMode = max(0, mode); }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Auxiliary functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool AbstractEncoder::startProcess(QProcess &process, const QString &program, const QStringList &args)
|
||||||
|
{
|
||||||
|
QMutexLocker lock(m_mutex_startProcess);
|
||||||
|
|
||||||
|
emit messageLogged(commandline2string(program, args) + "\n");
|
||||||
|
|
||||||
|
process.setProcessChannelMode(QProcess::MergedChannels);
|
||||||
|
process.setReadChannel(QProcess::StandardOutput);
|
||||||
|
process.start(program, args);
|
||||||
|
|
||||||
|
if(process.waitForStarted())
|
||||||
|
{
|
||||||
|
|
||||||
|
AssignProcessToJobObject(m_handle_jobObject, process.pid()->hProcess);
|
||||||
|
SetPriorityClass(process.pid()->hProcess, BELOW_NORMAL_PRIORITY_CLASS);
|
||||||
|
lock.unlock();
|
||||||
|
emit statusUpdated(0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QString AbstractEncoder::commandline2string(const QString &program, const QStringList &arguments)
|
QString AbstractEncoder::commandline2string(const QString &program, const QStringList &arguments)
|
||||||
{
|
{
|
||||||
QString commandline = (program.contains(' ') ? QString("\"%1\"").arg(program) : program);
|
QString commandline = (program.contains(' ') ? QString("\"%1\"").arg(program) : program);
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
class QProcess;
|
||||||
|
class QStringList;
|
||||||
|
class QMutex;
|
||||||
|
|
||||||
class AbstractEncoder : public QObject
|
class AbstractEncoder : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -39,10 +43,18 @@ public:
|
|||||||
void setBitrate(int bitrate);
|
void setBitrate(int bitrate);
|
||||||
void setRCMode(int mode);
|
void setRCMode(int mode);
|
||||||
|
|
||||||
|
bool startProcess(QProcess &process, const QString &program, const QStringList &args);
|
||||||
static QString commandline2string(const QString &program, const QStringList &arguments);
|
static QString commandline2string(const QString &program, const QStringList &arguments);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void statusUpdated(int progress);
|
||||||
|
void messageLogged(const QString &line);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_configBitrate;
|
int m_configBitrate;
|
||||||
int m_configRCMode;
|
int m_configRCMode;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static QMutex *m_mutex_startProcess;
|
||||||
|
static void *m_handle_jobObject;
|
||||||
};
|
};
|
||||||
|
@ -45,14 +45,10 @@ MP3Encoder::~MP3Encoder(void)
|
|||||||
|
|
||||||
bool MP3Encoder::encode(const AudioFileModel &sourceFile, const QString &outputFile, volatile bool *abortFlag)
|
bool MP3Encoder::encode(const AudioFileModel &sourceFile, const QString &outputFile, volatile bool *abortFlag)
|
||||||
{
|
{
|
||||||
const QString baseName = QFileInfo(outputFile).fileName();
|
|
||||||
emit statusUpdated(0);
|
|
||||||
|
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.setProcessChannelMode(QProcess::MergedChannels);
|
const QString baseName = QFileInfo(outputFile).fileName();
|
||||||
process.setReadChannel(QProcess::StandardOutput);
|
|
||||||
|
|
||||||
QStringList args;
|
QStringList args;
|
||||||
|
|
||||||
args << "--nohist";
|
args << "--nohist";
|
||||||
args << "-h";
|
args << "-h";
|
||||||
|
|
||||||
@ -86,11 +82,7 @@ bool MP3Encoder::encode(const AudioFileModel &sourceFile, const QString &outputF
|
|||||||
args << QDir::toNativeSeparators(sourceFile.filePath());
|
args << QDir::toNativeSeparators(sourceFile.filePath());
|
||||||
args << QDir::toNativeSeparators(outputFile);
|
args << QDir::toNativeSeparators(outputFile);
|
||||||
|
|
||||||
emit messageLogged(commandline2string(m_binary, args));
|
if(!startProcess(process, m_binary, args))
|
||||||
emit messageLogged(QString());
|
|
||||||
|
|
||||||
process.start(m_binary, args);
|
|
||||||
if(!process.waitForStarted())
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -106,6 +98,7 @@ bool MP3Encoder::encode(const AudioFileModel &sourceFile, const QString &outputF
|
|||||||
{
|
{
|
||||||
process.kill();
|
process.kill();
|
||||||
bAborted = true;
|
bAborted = true;
|
||||||
|
emit messageLogged("ABORTED BY USER !!!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
process.waitForReadyRead();
|
process.waitForReadyRead();
|
||||||
@ -128,7 +121,7 @@ bool MP3Encoder::encode(const AudioFileModel &sourceFile, const QString &outputF
|
|||||||
}
|
}
|
||||||
else if(!text.isEmpty())
|
else if(!text.isEmpty())
|
||||||
{
|
{
|
||||||
emit messageLogged(text); //qDebug("%s", text.toUtf8().constData());
|
emit messageLogged(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,6 +132,8 @@ bool MP3Encoder::encode(const AudioFileModel &sourceFile, const QString &outputF
|
|||||||
process.kill();
|
process.kill();
|
||||||
process.waitForFinished(-1);
|
process.waitForFinished(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit messageLogged(QString().sprintf("\n--> Exited with code: 0x%08x", process.exitCode()));
|
||||||
|
|
||||||
if(bTimeout || bAborted || process.exitStatus() != QProcess::NormalExit)
|
if(bTimeout || bAborted || process.exitStatus() != QProcess::NormalExit)
|
||||||
{
|
{
|
||||||
|
@ -36,10 +36,6 @@ public:
|
|||||||
virtual bool encode(const AudioFileModel &sourceFile, const QString &outputFile, volatile bool *abortFlag);
|
virtual bool encode(const AudioFileModel &sourceFile, const QString &outputFile, volatile bool *abortFlag);
|
||||||
virtual QString extension(void);
|
virtual QString extension(void);
|
||||||
|
|
||||||
signals:
|
|
||||||
void statusUpdated(int progress);
|
|
||||||
void messageLogged(const QString &line);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QString m_binary;
|
const QString m_binary;
|
||||||
};
|
};
|
||||||
|
20
src/Main.cpp
20
src/Main.cpp
@ -50,24 +50,6 @@ int lamexp_main(int argc, char* argv[])
|
|||||||
|
|
||||||
//Init console
|
//Init console
|
||||||
lamexp_init_console(argc, argv);
|
lamexp_init_console(argc, argv);
|
||||||
|
|
||||||
//LPWSTR *szArglist;
|
|
||||||
//int nArgs;
|
|
||||||
//szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
|
|
||||||
//
|
|
||||||
//if(nArgs >= 2)
|
|
||||||
//{
|
|
||||||
// static HANDLE hConsole = NULL;
|
|
||||||
// hConsole = CreateFile(L"CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL);
|
|
||||||
// if(!SetConsoleCP(CP_UTF8))
|
|
||||||
// {
|
|
||||||
// wprintf(L"Failed to set CP !!!\n");
|
|
||||||
// }
|
|
||||||
// char buffer[4096];
|
|
||||||
// WideCharToMultiByte(CP_UTF8, 0, szArglist[1], -1, buffer, 4096, NULL, NULL);
|
|
||||||
// wprintf(L"%S\n", buffer);
|
|
||||||
// WriteConsoleA(hConsole, buffer, strlen(buffer), NULL, NULL);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//Print version info
|
//Print version info
|
||||||
qDebug("LameXP - Audio Encoder Front-End");
|
qDebug("LameXP - Audio Encoder Front-End");
|
||||||
@ -87,7 +69,7 @@ int lamexp_main(int argc, char* argv[])
|
|||||||
qDebug("CPU brand string : %s", cpuFeatures.brand);
|
qDebug("CPU brand string : %s", cpuFeatures.brand);
|
||||||
qDebug(" CPU signature : Family: %d, Model: %d, Stepping: %d", cpuFeatures.family, cpuFeatures.model, cpuFeatures.stepping);
|
qDebug(" CPU signature : Family: %d, Model: %d, Stepping: %d", cpuFeatures.family, cpuFeatures.model, cpuFeatures.stepping);
|
||||||
qDebug("CPU capabilities : MMX: %s, SSE: %s, SSE2: %s, SSE3: %s, SSSE3: %s, x64: %s", LAMEXP_BOOL(cpuFeatures.mmx), LAMEXP_BOOL(cpuFeatures.sse), LAMEXP_BOOL(cpuFeatures.sse2), LAMEXP_BOOL(cpuFeatures.sse3), LAMEXP_BOOL(cpuFeatures.ssse3), LAMEXP_BOOL(cpuFeatures.x64));
|
qDebug("CPU capabilities : MMX: %s, SSE: %s, SSE2: %s, SSE3: %s, SSSE3: %s, x64: %s", LAMEXP_BOOL(cpuFeatures.mmx), LAMEXP_BOOL(cpuFeatures.sse), LAMEXP_BOOL(cpuFeatures.sse2), LAMEXP_BOOL(cpuFeatures.sse3), LAMEXP_BOOL(cpuFeatures.ssse3), LAMEXP_BOOL(cpuFeatures.x64));
|
||||||
qDebug("CPU no. of cores : %d\n", cpuFeatures.count);
|
qDebug(" Number of CPU's : %d\n", cpuFeatures.count);
|
||||||
|
|
||||||
//Initialize Qt
|
//Initialize Qt
|
||||||
lamexp_init_qt(argc, argv);
|
lamexp_init_qt(argc, argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user