2014-01-01 21:46:29 +00:00
|
|
|
#ifndef UNSHIELDWORKER_HPP
|
|
|
|
#define UNSHIELDWORKER_HPP
|
2013-12-25 17:52:34 +00:00
|
|
|
|
2014-01-01 21:46:29 +00:00
|
|
|
#include <QObject>
|
2013-12-25 17:52:34 +00:00
|
|
|
#include <QThread>
|
|
|
|
|
|
|
|
#include <libunshield.h>
|
|
|
|
|
2014-01-01 21:46:29 +00:00
|
|
|
#include "../inisettings.hpp"
|
2013-12-26 17:02:34 +00:00
|
|
|
|
2013-12-25 17:52:34 +00:00
|
|
|
namespace Wizard
|
|
|
|
{
|
2014-01-01 21:46:29 +00:00
|
|
|
class UnshieldWorker : public QObject
|
2013-12-25 17:52:34 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2014-01-01 21:46:29 +00:00
|
|
|
|
2013-12-25 17:52:34 +00:00
|
|
|
public:
|
2014-01-01 21:46:29 +00:00
|
|
|
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
|
|
|
|
2014-01-01 16:15: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
|
|
|
|
2014-01-01 21:46:29 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void extract();
|
2013-12-25 17:52:34 +00:00
|
|
|
|
|
|
|
signals:
|
2014-01-01 21:46:29 +00:00
|
|
|
void finished();
|
2013-12-25 17:52:34 +00:00
|
|
|
void textChanged(const QString &text);
|
2014-01-01 21:46:29 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
2014-01-01 21:46:29 +00:00
|
|
|
};
|
2013-12-25 17:52:34 +00:00
|
|
|
}
|
|
|
|
|
2014-01-01 21:46:29 +00:00
|
|
|
#endif // UNSHIELDWORKER_HPP
|