1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:53:52 +00:00
openmw/apps/wizard/unshield/unshieldworker.hpp

69 lines
1.5 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 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);
2013-12-25 17:52:34 +00:00
bool mInstallMorrowind;
bool mInstallTribunal;
bool mInstallBloodmoon;
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 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