OpenMW
apps/launcher/unshieldthread.hpp
Go to the documentation of this file.
00001 #ifndef UNSHIELD_THREAD_H
00002 #define UNSHIELD_THREAD_H
00003 
00004 #include <QThread>
00005 
00006 #include <boost/filesystem.hpp>
00007 
00008 #include <libunshield.h>
00009 
00010 namespace Launcher
00011 {
00012     class UnshieldThread : public QThread
00013     {
00014        Q_OBJECT
00015 
00016         public:
00017             bool SetMorrowindPath(const std::string& path);
00018             bool SetTribunalPath(const std::string& path);
00019             bool SetBloodmoonPath(const std::string& path);
00020 
00021             void SetOutputPath(const std::string& path);
00022 
00023             bool extract();
00024 
00025             bool TribunalDone();
00026             bool BloodmoonDone();
00027 
00028             void Done();
00029 
00030             std::string GetMWEsmPath();
00031 
00032             UnshieldThread();
00033 
00034         private:
00035 
00036             void extract_cab(const boost::filesystem::path& cab, const boost::filesystem::path& output_dir, bool extract_ini = false);
00037             bool extract_file(Unshield* unshield, boost::filesystem::path output_dir, const char* prefix, int index);
00038 
00039             boost::filesystem::path mMorrowindPath;
00040             boost::filesystem::path mTribunalPath;
00041             boost::filesystem::path mBloodmoonPath;
00042 
00043             bool mMorrowindDone;
00044             bool mTribunalDone;
00045             bool mBloodmoonDone;
00046 
00047             boost::filesystem::path mOutputPath;
00048 
00049 
00050         protected:
00051             virtual void run();
00052 
00053         signals:
00054             void signalGUI(QString);
00055             void close();
00056     };
00057 }
00058 #endif