1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/apps/wizard/unshieldthread.cpp

62 lines
1.3 KiB
C++
Raw Normal View History

2013-12-25 18:52:34 +01:00
#include "unshieldthread.hpp"
#include <QDebug>
#include <QStringList>
Wizard::UnshieldThread::UnshieldThread(QObject *parent) :
QThread(parent)
{
unshield_set_log_level(0);
mInstallMorrowind = false;
mInstallTribunal = false;
mInstallBloodmoon = false;
}
void Wizard::UnshieldThread::setInstallMorrowind(bool install)
{
mInstallMorrowind = install;
}
void Wizard::UnshieldThread::setInstallTribunal(bool install)
{
mInstallTribunal = install;
}
void Wizard::UnshieldThread::setInstallBloodmoon(bool install)
{
mInstallBloodmoon = install;
}
void Wizard::UnshieldThread::setPath(const QString &path)
{
mPath = path;
}
void Wizard::UnshieldThread::extract()
{
emit textChanged(QLatin1String("Starting installation"));
emit textChanged(QLatin1String("Installation target: ") + mPath);
QStringList components;
if (mInstallMorrowind)
components << QLatin1String("Morrowind");
if (mInstallTribunal)
components << QLatin1String("Tribunal");
if (mInstallBloodmoon)
components << QLatin1String("Bloodmoon");
emit textChanged(QLatin1String("Components: ") + components.join(QLatin1String(", ")));
}
void Wizard::UnshieldThread::run()
{
qDebug() << "From worker thread: " << currentThreadId();
extract();
}