remove Application::runPythonCode

This commit is contained in:
wmayer
2016-09-15 23:14:31 +02:00
parent 99d9fadb0a
commit 947f9575de
19 changed files with 118 additions and 140 deletions

View File

@@ -36,6 +36,7 @@
#include <Base/Tools.h>
#include <Base/Console.h>
#include <Base/Interpreter.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
@@ -44,6 +45,7 @@
#include <App/PropertyUnits.h>
#include <Gui/Application.h>
#include <Gui/Control.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/ViewProviderDocumentObject.h>
@@ -53,7 +55,7 @@
#include <Gui/QuantitySpinBox.h>
#include "PropertyItem.h"
#include <SpinBox.h>
#include <Gui/SpinBox.h>
using namespace Gui::PropertyEditor;
@@ -353,7 +355,19 @@ void PropertyItem::setPropertyValue(const QString& value)
App::PropertyContainer* parent = (*it)->getContainer();
if (parent && !parent->isReadOnly(*it) && !(*it)->testStatus(App::Property::ReadOnly)) {
QString cmd = QString::fromLatin1("%1 = %2").arg(pythonIdentifier(*it)).arg(value);
Gui::Application::Instance->runPythonCode((const char*)cmd.toUtf8());
try {
Gui::Command::runCommand(Gui::Command::App, cmd.toUtf8());
}
catch (Base::PyException &e) {
e.ReportException();
Base::Console().Error("Stack Trace: %s\n",e.getStackTrace().c_str());
}
catch (Base::Exception &e) {
e.ReportException();
}
catch (...) {
Base::Console().Error("Unknown C++ exception in PropertyItem::setPropertyValue thrown\n");
}
}
}
}