Added an option to add directories recursively.

This commit is contained in:
LoRd_MuldeR 2011-03-23 23:19:31 +01:00
parent e63d462578
commit 675be99999
18 changed files with 161 additions and 55 deletions

View File

@ -11,6 +11,7 @@
<li>Added an option to manually specify the number of parallel instances
<li>Added an option to select a user-defined TEMP directory
<li>Added an option to shutdown the computer as soon as all files are completed
<li>Added an option to add directories recursively
<li>Added support for embedding cover artwork (currently works with LAME and Nero AAC only)
<li>Updated Qt runtime libraries to v4.7.2
<li>Updated LAME encoder to v3.99.0.15 (2011-03-22), compiled with ICL 12.0.2

View File

@ -773,6 +773,10 @@
<source>Help &amp;&amp; Support</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Folder Recursively...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Adding file(s), please wait...</source>
<translation type="unfinished"></translation>
@ -817,6 +821,10 @@
<source>This usually means the file is damaged or the file format is not supported.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scanning folder(s) for files, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Downloading WMA Decoder Setup, please wait...</source>
<translation type="unfinished"></translation>
@ -1058,7 +1066,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>Add folder</source>
<source>Add Folder</source>
<translation type="unfinished"></translation>
</message>
<message>

View File

@ -662,10 +662,6 @@
<source>Add file(s)</source>
<translation>Datei(en) hinzufügen</translation>
</message>
<message>
<source>Add folder</source>
<translation>Ordner hinzufügen</translation>
</message>
<message>
<source>New Folder</source>
<translation>Neuer Ordner</translation>
@ -1226,6 +1222,18 @@
<source>Help &amp;&amp; Support</source>
<translation>Hilfe und Support</translation>
</message>
<message>
<source>Open Folder Recursively...</source>
<translation>Verzeichnis rekursiv öffnen...</translation>
</message>
<message>
<source>Scanning folder(s) for files, please wait...</source>
<translation>Durchsuche Verzeichnis(se) nach Dateien, bitte warten...</translation>
</message>
<message>
<source>Add Folder</source>
<translation>Verzeichnis hinzufügen</translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -761,10 +761,6 @@
<source>Add file(s)</source>
<translation>Añadir archivo(s)</translation>
</message>
<message>
<source>Add folder</source>
<translation>Añadir carpeta</translation>
</message>
<message>
<source>Load Translation</source>
<translation>Cargar traducción</translation>
@ -1225,6 +1221,18 @@
<source>Help &amp;&amp; Support</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Folder Recursively...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scanning folder(s) for files, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Add Folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -767,10 +767,6 @@ Votre dossier TEMP est situé ici:</translation>
<source>Add file(s)</source>
<translation>Ajouter fichier(s)</translation>
</message>
<message>
<source>Add folder</source>
<translation>Ajouter dossier</translation>
</message>
<message>
<source>Load Translation</source>
<translation>Charger la traduction</translation>
@ -1234,6 +1230,18 @@ Sélection automatique (par défaut)</translation>
<source>Help &amp;&amp; Support</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Folder Recursively...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scanning folder(s) for files, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Add Folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -662,10 +662,6 @@
<source>Add file(s)</source>
<translation>Aggiungi file(s)</translation>
</message>
<message>
<source>Add folder</source>
<translation>Aggiungi cartella</translation>
</message>
<message>
<source>New Folder</source>
<translation>Nuova Cartella</translation>
@ -1226,6 +1222,18 @@
<source>Help &amp;&amp; Support</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Folder Recursively...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scanning folder(s) for files, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Add Folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -988,10 +988,6 @@
<source>Add file(s)</source>
<translation type="unfinished">Добавить файлы</translation>
</message>
<message>
<source>Add folder</source>
<translation type="unfinished">Добавить папки</translation>
</message>
<message>
<source>Load Translation</source>
<translation type="unfinished">Загрузить первод</translation>
@ -1228,6 +1224,18 @@
<source>Help &amp;&amp; Support</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Folder Recursively...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scanning folder(s) for files, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Add Folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -961,10 +961,6 @@
<source>Add file(s)</source>
<translation type="unfinished">Додати файл(и)</translation>
</message>
<message>
<source>Add folder</source>
<translation type="unfinished">Додати теку</translation>
</message>
<message>
<source>Load Translation</source>
<translation type="unfinished">Завантажити переклад</translation>
@ -1225,6 +1221,18 @@
<source>Help &amp;&amp; Support</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Folder Recursively...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Scanning folder(s) for files, please wait...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Add Folder</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1057,8 +1057,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>602</width>
<height>1088</height>
<width>604</width>
<height>1091</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
@ -2716,6 +2716,7 @@
<addaction name="separator"/>
<addaction name="actionOpen"/>
<addaction name="actionOpenFolder"/>
<addaction name="actionOpenFolderRecursively"/>
<addaction name="actionClearAll"/>
<addaction name="separator"/>
<addaction name="actionQuit"/>
@ -3072,6 +3073,15 @@
<string>Help &amp;&amp; Support</string>
</property>
</action>
<action name="actionOpenFolderRecursively">
<property name="icon">
<iconset resource="../res/Icons.qrc">
<normaloff>:/icons/folder_explore.png</normaloff>:/icons/folder_explore.png</iconset>
</property>
<property name="text">
<string>Open Folder Recursively...</string>
</property>
</action>
</widget>
<resources>
<include location="../res/Icons.qrc"/>
@ -3138,6 +3148,7 @@
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
</resources>
<connections>
<connection>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 1
#define VER_LAMEXP_BUILD 399
#define VER_LAMEXP_BUILD 400
#define VER_LAMEXP_SUFFIX Beta-12
/*

View File

@ -256,7 +256,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
customParamsChanged();
//Activate file menu actions
actionOpenFolder->setData(QVariant::fromValue<bool>(false));
actionOpenFolderRecursively->setData(QVariant::fromValue<bool>(true));
connect(actionOpenFolder, SIGNAL(triggered()), this, SLOT(openFolderActionActivated()));
connect(actionOpenFolderRecursively, SIGNAL(triggered()), this, SLOT(openFolderActionActivated()));
//Activate view menu actions
m_tabActionGroup = new QActionGroup(this);
@ -459,6 +462,46 @@ void MainWindow::addFiles(const QStringList &files)
m_banner->close();
}
/*
* Add folder to source list
*/
void MainWindow::addFolder(const QString &path, bool recursive)
{
QFileInfoList folderInfoList;
folderInfoList << QFileInfo(path);
QStringList fileList;
m_banner->show(tr("Scanning folder(s) for files, please wait..."));
QApplication::processEvents();
while(!folderInfoList.isEmpty())
{
QDir currentDir(folderInfoList.takeFirst().canonicalFilePath());
QFileInfoList fileInfoList = currentDir.entryInfoList(QDir::Files);
while(!fileInfoList.isEmpty())
{
fileList << fileInfoList.takeFirst().canonicalFilePath();
}
QApplication::processEvents();
if(recursive)
{
folderInfoList.append(currentDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks));
QApplication::processEvents();
}
}
m_banner->close();
QApplication::processEvents();
if(!fileList.isEmpty())
{
addFiles(fileList);
}
}
/*
* Download and install WMA Decoder component
*/
@ -1062,37 +1105,31 @@ void MainWindow::openFolderActionActivated(void)
ABORT_IF_BUSY;
QString selectedFolder;
TEMP_HIDE_DROPBOX
(
if(lamexp_themes_enabled())
{
selectedFolder = QFileDialog::getExistingDirectory(this, tr("Add folder"), QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
}
else
{
QFileDialog dialog(this, tr("Add folder"));
dialog.setFileMode(QFileDialog::DirectoryOnly);
dialog.setDirectory(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
if(dialog.exec())
if(QAction *action = dynamic_cast<QAction*>(QObject::sender()))
{
TEMP_HIDE_DROPBOX
(
if(lamexp_themes_enabled())
{
selectedFolder = dialog.selectedFiles().first();
selectedFolder = QFileDialog::getExistingDirectory(this, tr("Add Folder"), QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
}
}
if(!selectedFolder.isEmpty())
{
QDir sourceDir(selectedFolder);
QFileInfoList fileInfoList = sourceDir.entryInfoList(QDir::Files);
QStringList fileList;
while(!fileInfoList.isEmpty())
else
{
fileList << fileInfoList.takeFirst().canonicalFilePath();
QFileDialog dialog(this, tr("Add Folder"));
dialog.setFileMode(QFileDialog::DirectoryOnly);
dialog.setDirectory(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
if(dialog.exec())
{
selectedFolder = dialog.selectedFiles().first();
}
}
addFiles(fileList);
}
)
if(!selectedFolder.isEmpty())
{
addFolder(selectedFolder, action->data().toBool());
}
)
}
}
/*

View File

@ -130,6 +130,7 @@ protected:
private:
void addFiles(const QStringList &files);
void addFolder(const QString &path, bool recursive = false);
bool installWMADecoder(void);
bool checkForUpdates(void);