Gui: fixes a problem that if executing a macro that requires user-interaction this is blocked

This commit is contained in:
wmayer
2023-10-11 13:42:02 +02:00
committed by wwmayer
parent f0d350f60d
commit f8936185d8
2 changed files with 6 additions and 3 deletions

View File

@@ -650,15 +650,17 @@ void PythonEditorView::executeScript()
if (EditorView::onHasMsg("Save"))
EditorView::onMsg("Save", nullptr);
try {
WaitCursor wc;
getMainWindow()->setCursor(Qt::WaitCursor);
PythonTracingLocker tracelock(watcher->getTrace());
Application::Instance->macroManager()->run(Gui::MacroManager::File,fileName().toUtf8());
getMainWindow()->unsetCursor();
}
catch (const Base::SystemExitException&) {
// handle SystemExit exceptions
Base::PyGILStateLocker locker;
Base::PyException e;
e.ReportException();
getMainWindow()->unsetCursor();
}
}