do not use doCommand without using format string, add overloaded method of runCommand

This commit is contained in:
wmayer
2016-09-15 18:53:37 +02:00
parent 1efd9a4b4f
commit f44df3cdf0
17 changed files with 60 additions and 47 deletions

View File

@@ -588,9 +588,9 @@ void TaskBoxPrimitives::setPrimitive(QString name)
// Execute the Python block
QString prim = tr("Create primitive");
Gui::Application::Instance->activeDocument()->openCommand(prim.toUtf8());
Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toUtf8());
Gui::Command::runCommand(Gui::Command::Doc, cmd.toUtf8());
Gui::Application::Instance->activeDocument()->commitCommand();
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
Gui::Command::runCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
}
catch (const Base::PyException& e) {
QMessageBox::warning(this, tr("Create primitive"), QString::fromLatin1(e.what()));