diff --git a/src/Gui/EditorView.cpp b/src/Gui/EditorView.cpp
index 3fc09cf801..cf031d0f61 100644
--- a/src/Gui/EditorView.cpp
+++ b/src/Gui/EditorView.cpp
@@ -50,6 +50,8 @@
#include "Macro.h"
#include "MainWindow.h"
#include "PythonEditor.h"
+#include "PythonTracing.h"
+#include "WaitCursor.h"
#include
#include
@@ -596,9 +598,13 @@ PythonEditorView::PythonEditorView(PythonEditor* editor, QWidget* parent)
{
connect(this, &PythonEditorView::changeFileName,
editor, &PythonEditor::setFileName);
+ watcher = new PythonTracingWatcher(this);
}
-PythonEditorView::~PythonEditorView() = default;
+PythonEditorView::~PythonEditorView()
+{
+ delete watcher;
+}
/**
* Runs the action specified by \a pMsg.
@@ -644,6 +650,8 @@ void PythonEditorView::executeScript()
if (EditorView::onHasMsg("Save"))
EditorView::onMsg("Save", nullptr);
try {
+ WaitCursor wc;
+ PythonTracingLocker tracelock(watcher->getTrace());
Application::Instance->macroManager()->run(Gui::MacroManager::File,fileName().toUtf8());
}
catch (const Base::SystemExitException&) {
diff --git a/src/Gui/EditorView.h b/src/Gui/EditorView.h
index 3a09321fb0..8546a94397 100644
--- a/src/Gui/EditorView.h
+++ b/src/Gui/EditorView.h
@@ -41,6 +41,7 @@ namespace Gui {
class EditorViewP;
class TextEdit;
+class PythonTracingWatcher;
/**
* A special view class which sends the messages from the application to
@@ -140,6 +141,7 @@ public Q_SLOTS:
private:
PythonEditor* _pye;
+ PythonTracingWatcher* watcher;
};
class SearchBar : public QWidget