mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
rbutil: add a option to ignore specific files for .talk file generation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22478 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
139127217a
commit
7feb639938
4 changed files with 152 additions and 138 deletions
|
|
@ -159,6 +159,19 @@ bool TalkFileCreator::createTalkList(QDir startDir)
|
||||||
// insert into List
|
// insert into List
|
||||||
if( !fileInf.fileName().isEmpty() && !fileInf.fileName().endsWith(".talk") && m_talkFiles)
|
if( !fileInf.fileName().isEmpty() && !fileInf.fileName().endsWith(".talk") && m_talkFiles)
|
||||||
{
|
{
|
||||||
|
//test if we should ignore this file
|
||||||
|
bool match = false;
|
||||||
|
for(int i=0; i < m_ignoreFiles.size();i++)
|
||||||
|
{
|
||||||
|
QRegExp rx(m_ignoreFiles[i].trimmed());
|
||||||
|
rx.setPatternSyntax(QRegExp::Wildcard);
|
||||||
|
if(rx.exactMatch(fileInf.fileName()))
|
||||||
|
match = true;
|
||||||
|
}
|
||||||
|
if(match)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//generate entry
|
||||||
TalkGenerator::TalkEntry entry;
|
TalkGenerator::TalkEntry entry;
|
||||||
if(m_stripExtensions)
|
if(m_stripExtensions)
|
||||||
entry.toSpeak = stripExtension(fileInf.fileName());
|
entry.toSpeak = stripExtension(fileInf.fileName());
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public:
|
||||||
void setStripExtensions(bool ov) {m_stripExtensions = ov;}
|
void setStripExtensions(bool ov) {m_stripExtensions = ov;}
|
||||||
void setTalkFolders(bool ov) {m_talkFolders = ov;}
|
void setTalkFolders(bool ov) {m_talkFolders = ov;}
|
||||||
void setTalkFiles(bool ov) {m_talkFiles = ov;}
|
void setTalkFiles(bool ov) {m_talkFiles = ov;}
|
||||||
|
void setIgnoreFiles(QStringList wildcards) {m_ignoreFiles=wildcards;}
|
||||||
public slots:
|
public slots:
|
||||||
void abort();
|
void abort();
|
||||||
|
|
||||||
|
|
@ -72,7 +72,8 @@ private:
|
||||||
bool m_stripExtensions;
|
bool m_stripExtensions;
|
||||||
bool m_talkFolders;
|
bool m_talkFolders;
|
||||||
bool m_talkFiles;
|
bool m_talkFiles;
|
||||||
|
QStringList m_ignoreFiles;
|
||||||
|
|
||||||
bool m_abort;
|
bool m_abort;
|
||||||
|
|
||||||
QList<TalkGenerator::TalkEntry> m_talkList;
|
QList<TalkGenerator::TalkEntry> m_talkList;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
<ui version="4.0" >
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
<class>InstallTalkFrm</class>
|
<class>InstallTalkFrm</class>
|
||||||
<widget class="QDialog" name="InstallTalkFrm" >
|
<widget class="QDialog" name="InstallTalkFrm">
|
||||||
<property name="windowModality" >
|
<property name="windowModality">
|
||||||
<enum>Qt::WindowModal</enum>
|
<enum>Qt::WindowModal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
|
|
@ -12,87 +13,87 @@
|
||||||
<height>450</height>
|
<height>450</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string>Install Talk Files</string>
|
<string>Install Talk Files</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2" >
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item rowspan="6" row="0" column="0" >
|
<item row="0" column="0" rowspan="6">
|
||||||
<widget class="QLabel" name="label" >
|
<widget class="QLabel" name="label">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="pixmap" >
|
<property name="pixmap">
|
||||||
<pixmap resource="rbutilqt.qrc" >:/icons/wizard.xpm</pixmap>
|
<pixmap resource="rbutilqt.qrc">:/icons/wizard.xpm</pixmap>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment" >
|
<property name="alignment">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" colspan="3" >
|
<item row="0" column="1" colspan="3">
|
||||||
<widget class="QLabel" name="label_2" >
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Select the Folder to generate Talkfiles for.</string>
|
<string>Select the Folder to generate Talkfiles for.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" colspan="2" >
|
<item row="1" column="1" colspan="2">
|
||||||
<widget class="QLineEdit" name="lineTalkFolder" >
|
<widget class="QLineEdit" name="lineTalkFolder">
|
||||||
<property name="accessibleName" >
|
<property name="accessibleName">
|
||||||
<string>Talkfile Folder</string>
|
<string>Talkfile Folder</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3" >
|
<item row="1" column="3">
|
||||||
<widget class="QPushButton" name="buttonBrowse" >
|
<widget class="QPushButton" name="buttonBrowse">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&Browse</string>
|
<string>&Browse</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="rbutilqt.qrc" >
|
<iconset resource="rbutilqt.qrc">
|
||||||
<normaloff>:/icons/system-search.png</normaloff>:/icons/system-search.png</iconset>
|
<normaloff>:/icons/system-search.png</normaloff>:/icons/system-search.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" colspan="3" >
|
<item row="2" column="1" colspan="3">
|
||||||
<widget class="QGroupBox" name="groupBox_2" >
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title" >
|
<property name="title">
|
||||||
<string>Generation settings</string>
|
<string>Generation settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout">
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="labelEncProfile" >
|
<widget class="QLabel" name="labelEncProfile">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Encoder profile:</string>
|
<string>Encoder profile:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="labelTtsProfile" >
|
<widget class="QLabel" name="labelTtsProfile">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>TTS profile:</string>
|
<string>TTS profile:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" >
|
<item row="2" column="0">
|
||||||
<widget class="QPushButton" name="change" >
|
<widget class="QPushButton" name="change">
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Change</string>
|
<string>Change</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" >
|
<item row="2" column="1">
|
||||||
<spacer>
|
<spacer>
|
||||||
<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>
|
||||||
|
|
@ -103,81 +104,12 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1" colspan="3" >
|
<item row="4" column="2">
|
||||||
<widget class="QGroupBox" name="groupBox" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>Generation options</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout" >
|
|
||||||
<item row="2" column="0" colspan="2" >
|
|
||||||
<widget class="QCheckBox" name="recursive" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Run recursive</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2" >
|
|
||||||
<widget class="QCheckBox" name="StripExtensions" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Strip Extensions</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="2" >
|
|
||||||
<widget class="QCheckBox" name="OverwriteTalk" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Overwrite Talkfiles</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2" >
|
|
||||||
<widget class="QCheckBox" name="talkFolders" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Generate .talk files for Folders</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2" >
|
|
||||||
<widget class="QCheckBox" name="talkFiles" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Generate .talk files for Files</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="tristate" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
<zorder>recursive</zorder>
|
|
||||||
<zorder>StripExtensions</zorder>
|
|
||||||
<zorder>OverwriteTalk</zorder>
|
|
||||||
<zorder>talkFolders</zorder>
|
|
||||||
<zorder>talkFiles</zorder>
|
|
||||||
<zorder>label_3</zorder>
|
|
||||||
<zorder>fileFilter</zorder>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2" >
|
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
|
|
@ -185,12 +117,12 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1" >
|
<item row="5" column="1">
|
||||||
<spacer>
|
<spacer>
|
||||||
<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>
|
||||||
|
|
@ -198,48 +130,115 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="2" colspan="2" >
|
<item row="5" column="2" colspan="2">
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="buttonOk" >
|
<widget class="QPushButton" name="buttonOk">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&Install</string>
|
<string>&Install</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="rbutilqt.qrc" >
|
<iconset resource="rbutilqt.qrc">
|
||||||
<normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
|
<normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="buttonCancel" >
|
<widget class="QPushButton" name="buttonCancel">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&Cancel</string>
|
<string>&Cancel</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon" >
|
<property name="icon">
|
||||||
<iconset resource="rbutilqt.qrc" >
|
<iconset resource="rbutilqt.qrc">
|
||||||
<normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset>
|
<normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="1" colspan="3">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Generation options</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="ignoreFiles"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore files (comma seperated Wildcards):</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="talkFiles">
|
||||||
|
<property name="text">
|
||||||
|
<string>Generate .talk files for Files</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="tristate">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="talkFolders">
|
||||||
|
<property name="text">
|
||||||
|
<string>Generate .talk files for Folders</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QCheckBox" name="recursive">
|
||||||
|
<property name="text">
|
||||||
|
<string>Run recursive</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QCheckBox" name="StripExtensions">
|
||||||
|
<property name="text">
|
||||||
|
<string>Strip Extensions</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QCheckBox" name="OverwriteTalk">
|
||||||
|
<property name="text">
|
||||||
|
<string>Overwrite Talkfiles</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>lineTalkFolder</tabstop>
|
<tabstop>lineTalkFolder</tabstop>
|
||||||
<tabstop>buttonBrowse</tabstop>
|
<tabstop>buttonBrowse</tabstop>
|
||||||
<tabstop>change</tabstop>
|
<tabstop>change</tabstop>
|
||||||
<tabstop>talkFiles</tabstop>
|
|
||||||
<tabstop>talkFolders</tabstop>
|
|
||||||
<tabstop>recursive</tabstop>
|
|
||||||
<tabstop>StripExtensions</tabstop>
|
|
||||||
<tabstop>OverwriteTalk</tabstop>
|
|
||||||
<tabstop>buttonOk</tabstop>
|
<tabstop>buttonOk</tabstop>
|
||||||
<tabstop>buttonCancel</tabstop>
|
<tabstop>buttonCancel</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="rbutilqt.qrc" />
|
<include location="rbutilqt.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
|
@ -248,11 +247,11 @@
|
||||||
<receiver>InstallTalkFrm</receiver>
|
<receiver>InstallTalkFrm</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel">
|
||||||
<x>472</x>
|
<x>472</x>
|
||||||
<y>418</y>
|
<y>418</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel">
|
||||||
<x>382</x>
|
<x>382</x>
|
||||||
<y>328</y>
|
<y>328</y>
|
||||||
</hint>
|
</hint>
|
||||||
|
|
@ -264,11 +263,11 @@
|
||||||
<receiver>InstallTalkFrm</receiver>
|
<receiver>InstallTalkFrm</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel">
|
||||||
<x>561</x>
|
<x>561</x>
|
||||||
<y>428</y>
|
<y>428</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel">
|
||||||
<x>522</x>
|
<x>522</x>
|
||||||
<y>332</y>
|
<y>332</y>
|
||||||
</hint>
|
</hint>
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ void InstallTalkWindow::accept()
|
||||||
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
||||||
talkcreator->setTalkFolders(ui.talkFolders->isChecked());
|
talkcreator->setTalkFolders(ui.talkFolders->isChecked());
|
||||||
talkcreator->setTalkFiles(ui.talkFiles->isChecked());
|
talkcreator->setTalkFiles(ui.talkFiles->isChecked());
|
||||||
|
talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",",QString::SkipEmptyParts));
|
||||||
|
|
||||||
connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished()));
|
connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished()));
|
||||||
connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
|
connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue