mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -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,6 +72,7 @@ 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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>InstallTalkFrm</class>
|
<class>InstallTalkFrm</class>
|
||||||
<widget class="QDialog" name="InstallTalkFrm">
|
<widget class="QDialog" name="InstallTalkFrm">
|
||||||
|
|
@ -16,7 +17,7 @@
|
||||||
<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/>
|
||||||
|
|
@ -77,7 +78,7 @@
|
||||||
<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>
|
||||||
|
|
@ -103,75 +104,6 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</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="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">
|
<item row="4" column="2">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
@ -224,17 +156,84 @@
|
||||||
</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>
|
||||||
|
|
|
||||||
|
|
@ -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