cutter/src/RunScriptTask.cpp
Gaurav Kumar Ghildiyal 57231192f4 Added dialog to show infinite progress-bar while running script (#1145)
* Added dialog to show infinite progress-bar while running script

* Replaced loadScript with cmdTask for thread safe execution.
2019-01-28 15:37:20 +02:00

30 lines
502 B
C++

#include "Cutter.h"
#include "RunScriptTask.h"
#include "MainWindow.h"
RunScriptTask::RunScriptTask() :
AsyncTask()
{
}
RunScriptTask::~RunScriptTask()
{
}
void RunScriptTask::interrupt()
{
AsyncTask::interrupt();
r_cons_singleton()->context->breaked = true;
}
void RunScriptTask::runTask()
{
if (!this->fileName.isNull()) {
log(tr("Executing script..."));
Core()->cmdTask(". " + this->fileName);
if (isInterrupted()) {
return;
}
}
}