diff --git a/src/dialogs/AsyncTaskDialog.h b/src/dialogs/AsyncTaskDialog.h index e73c68d2..314d38e0 100644 --- a/src/dialogs/AsyncTaskDialog.h +++ b/src/dialogs/AsyncTaskDialog.h @@ -21,6 +21,9 @@ public: AsyncTaskDialog(AsyncTask::Ptr task, QWidget *parent = nullptr); ~AsyncTaskDialog(); + void setInterruptOnClose(bool v) { interruptOnClose = v; } + bool getInterruptOnClose() { return interruptOnClose; } + public slots: void reject() override; @@ -36,7 +39,7 @@ private: AsyncTask::Ptr task; QTimer timer; - bool interruptOnClose; + bool interruptOnClose = false; }; #endif //ASYNCTASKDIALOG_H diff --git a/src/dialogs/OptionsDialog.cpp b/src/dialogs/OptionsDialog.cpp index f1475f7c..90d69a86 100644 --- a/src/dialogs/OptionsDialog.cpp +++ b/src/dialogs/OptionsDialog.cpp @@ -245,6 +245,7 @@ void OptionsDialog::setupAndStartAnalysis(int level, QList advanced) Core()->getAsyncTaskManager()->start(analTaskPtr); AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analTaskPtr); + taskDialog->setInterruptOnClose(true); taskDialog->setAttribute(Qt::WA_DeleteOnClose); taskDialog->show();