2007-08-05 16:17:35 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 by Dominik Wenger
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-08-05 16:17:35 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef TALKFILE_H
|
|
|
|
#define TALKFILE_H
|
|
|
|
|
2008-02-10 18:25:49 +00:00
|
|
|
#include <QtCore>
|
2007-08-05 16:17:35 +00:00
|
|
|
#include "progressloggerinterface.h"
|
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
#include "talkgenerator.h"
|
2007-09-23 13:35:45 +00:00
|
|
|
|
2007-08-05 16:17:35 +00:00
|
|
|
class TalkFileCreator :public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2009-04-29 21:27:01 +00:00
|
|
|
TalkFileCreator(QObject* parent);
|
2007-08-05 16:17:35 +00:00
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
bool createTalkFiles();
|
2012-09-05 18:17:26 +00:00
|
|
|
|
|
|
|
void setDir(QString dir) {m_dir = dir;}
|
|
|
|
void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;}
|
2007-08-05 16:17:35 +00:00
|
|
|
|
2009-10-13 20:51:20 +00:00
|
|
|
void setGenerateOnlyNew(bool ov) {m_generateOnlyNew = ov;}
|
2007-08-05 16:17:35 +00:00
|
|
|
void setRecursive(bool ov) {m_recursive = ov;}
|
|
|
|
void setStripExtensions(bool ov) {m_stripExtensions = ov;}
|
2012-09-05 18:17:26 +00:00
|
|
|
void setTalkFolders(bool ov) {m_talkFolders = ov;}
|
2007-10-12 15:52:04 +00:00
|
|
|
void setTalkFiles(bool ov) {m_talkFiles = ov;}
|
2012-09-05 18:17:26 +00:00
|
|
|
void setIgnoreFiles(QStringList wildcards) {m_ignoreFiles = wildcards;}
|
2009-06-26 20:40:51 +00:00
|
|
|
public slots:
|
2007-08-29 09:27:35 +00:00
|
|
|
void abort();
|
2012-09-05 18:17:26 +00:00
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
signals:
|
|
|
|
void done(bool);
|
|
|
|
void aborted();
|
|
|
|
void logItem(QString, int); //! set logger item
|
|
|
|
void logProgress(int, int); //! set progress bar.
|
2012-09-05 18:17:26 +00:00
|
|
|
|
2007-08-05 16:17:35 +00:00
|
|
|
private:
|
2009-06-26 20:40:51 +00:00
|
|
|
bool cleanup();
|
2008-07-12 17:04:49 +00:00
|
|
|
QString stripExtension(QString filename);
|
2009-06-26 20:40:51 +00:00
|
|
|
void doAbort();
|
2008-07-12 17:04:49 +00:00
|
|
|
void resetProgress(int max);
|
2009-06-26 20:40:51 +00:00
|
|
|
bool copyTalkFiles(QString* errString);
|
2012-09-05 18:17:26 +00:00
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
bool createTalkList(QDir startDir);
|
2012-09-05 18:17:26 +00:00
|
|
|
|
|
|
|
QString m_dir;
|
2007-08-10 22:17:43 +00:00
|
|
|
QString m_mountpoint;
|
2012-09-05 18:17:26 +00:00
|
|
|
|
2009-10-13 20:51:20 +00:00
|
|
|
bool m_generateOnlyNew;
|
2007-08-05 16:17:35 +00:00
|
|
|
bool m_recursive;
|
|
|
|
bool m_stripExtensions;
|
2007-10-12 15:52:04 +00:00
|
|
|
bool m_talkFolders;
|
|
|
|
bool m_talkFiles;
|
2009-08-23 18:57:50 +00:00
|
|
|
QStringList m_ignoreFiles;
|
2012-09-05 18:17:26 +00:00
|
|
|
|
2007-08-05 16:17:35 +00:00
|
|
|
bool m_abort;
|
2012-09-05 18:17:26 +00:00
|
|
|
|
2009-06-26 20:40:51 +00:00
|
|
|
QList<TalkGenerator::TalkEntry> m_talkList;
|
2007-08-05 16:17:35 +00:00
|
|
|
};
|
|
|
|
|
2007-12-14 19:26:54 +00:00
|
|
|
|
2007-08-05 16:17:35 +00:00
|
|
|
#endif
|
2007-09-23 13:35:45 +00:00
|
|
|
|