1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-18 13:12:50 +00:00
OpenMW/apps/opencs/model/tools/operation.cpp

35 lines
494 B
C++
Raw Normal View History

2012-12-08 14:25:50 +00:00
#include "operation.hpp"
#include <QTimer>
#include "../doc/state.hpp"
CSMTools::Operation::Operation (int type) : mType (type) {}
void CSMTools::Operation::run()
{
mStep = 0;
QTimer timer;
timer.connect (&timer, SIGNAL (timeout()), this, SLOT (verify()));
timer.start (0);
exec();
}
void CSMTools::Operation::abort()
{
exit();
}
void CSMTools::Operation::verify()
{
++mStep;
emit progress (mStep, 1000, mType);
if (mStep>=1000)
exit();
}