From 6bf7781aea8cb1cbcc2280f017471bc5df204b4a Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Fri, 17 Mar 2023 13:40:19 -0300 Subject: [PATCH] Change running Python DPs from Edit menu To better match the new BatchProcessing dialog - Python DPs are listed together with builtin processors to be executed like parameterless built in DPs, with option to cancel. - They also appear under the Python Fixes submenu, but in this case they also can be edited. --- src/Gui/MainWindow.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index b76fc7db4..ea0c2793a 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -597,7 +597,7 @@ MainWindow::MainWindow(const QDir &home) QMenu *editMenu = menuBar()->addMenu(tr("&Edit")); // Add all the data processors to the tools menu const DataProcessorFactory &factory = DataProcessorFactory::instance(); - QMap processors = factory.getProcessors(true); + QMap processors = factory.getProcessors(); if (processors.count()) { @@ -1255,14 +1255,9 @@ void MainWindow::manualProcess(QString name) name = name.remove(0, 8); FixPyScript *script = fixPySettings->getScript(name); - if (script == nullptr) { - return; - } - - QString errText; - FixPyRunner pyRunner(currentAthleteTab->context); - if (pyRunner.run(script->source, script->iniKey, errText) != 0) { - QMessageBox::critical(this, "GoldenCheetah", errText); + if (script) { + EditFixPyScriptDialog editDlg(currentAthleteTab->context, script, this); + editDlg.exec(); } return;