openmw-tes3coop/apps/wizard/unshield/unshieldworker.hpp

80 lines
1.9 KiB
C++
Raw Normal View History

#ifndef UNSHIELDWORKER_HPP
#define UNSHIELDWORKER_HPP
2013-12-25 17:52:34 +00:00
#include <QObject>
2013-12-25 17:52:34 +00:00
#include <QThread>
#include <libunshield.h>
#include "../inisettings.hpp"
2013-12-26 17:02:34 +00:00
2013-12-25 17:52:34 +00:00
namespace Wizard
{
class UnshieldWorker : public QObject
2013-12-25 17:52:34 +00:00
{
Q_OBJECT
2013-12-25 17:52:34 +00:00
public:
UnshieldWorker(QObject *parent = 0);
~UnshieldWorker();
2013-12-25 17:52:34 +00:00
void setInstallMorrowind(bool install);
void setInstallTribunal(bool install);
void setInstallBloodmoon(bool install);
void setPath(const QString &path);
2013-12-26 17:02:34 +00:00
void setIniPath(const QString &path);
void setIniCodec(QTextCodec *codec);
2013-12-25 17:52:34 +00:00
private:
2013-12-26 17:02:34 +00:00
bool removeDirectory(const QString &dirName);
bool copyFile(const QString &source, const QString &destination, bool keepSource = true);
bool copyDirectory(const QString &source, const QString &destination, bool keepSource = true);
bool moveFile(const QString &source, const QString &destination);
bool moveDirectory(const QString &source, const QString &destination);
2013-12-26 17:02:34 +00:00
void setupSettings();
2013-12-25 17:52:34 +00:00
2013-12-26 17:02:34 +00:00
void extractCab(const QString &cabFile, const QString &outputDir);
bool extractFile(Unshield *unshield, const QString &outputDir, const QString &prefix, int index, int counter);
void installDirectories(const QString &source);
2013-12-25 17:52:34 +00:00
bool mInstallMorrowind;
bool mInstallTribunal;
bool mInstallBloodmoon;
bool mMorrowindDone;
bool mTribunalDone;
bool mBloodmoonDone;
2013-12-25 17:52:34 +00:00
QString mPath;
2013-12-26 17:02:34 +00:00
QString mIniPath;
IniSettings mIniSettings;
QTextCodec *mIniCodec;
2013-12-25 17:52:34 +00:00
public slots:
void extract();
2013-12-25 17:52:34 +00:00
signals:
void finished();
2013-12-25 17:52:34 +00:00
void textChanged(const QString &text);
void logTextChanged(const QString &text);
void error(const QString &text);
2013-12-26 17:02:34 +00:00
void progressChanged(int progress);
2013-12-25 17:52:34 +00:00
};
2013-12-25 17:52:34 +00:00
}
#endif // UNSHIELDWORKER_HPP