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

@@ -34,6 +34,7 @@
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
@@ -66,8 +67,8 @@ public:
LoftWidget::LoftWidget(QWidget* parent)
: d(new Private())
{
Gui::Application::Instance->runPythonCode("from FreeCAD import Base");
Gui::Application::Instance->runPythonCode("import Part");
Gui::Command::runCommand(Gui::Command::App, "from FreeCAD import Base");
Gui::Command::runCommand(Gui::Command::App, "import Part");
d->ui.setupUi(this);
d->ui.selector->setAvailableLabel(tr("Vertex/Edge/Wire/Face"));
@@ -175,7 +176,7 @@ bool LoftWidget::accept()
Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str());
if (!doc) throw Base::Exception("Document doesn't exist anymore");
doc->openCommand("Loft");
Gui::Application::Instance->runPythonCode((const char*)cmd.toLatin1(), false, false);
Gui::Command::runCommand(Gui::Command::App, cmd.toLatin1());
doc->getDocument()->recompute();
App::DocumentObject* obj = doc->getDocument()->getActiveObject();
if (obj && !obj->isValid()) {