do not use doCommand without using format string, add overloaded method of runCommand
This commit is contained in:
@@ -327,7 +327,7 @@ bool TaskDlgBooleanParameters::accept()
|
||||
for (std::vector<std::string>::const_iterator it = bodies.begin(); it != bodies.end(); ++it)
|
||||
str << "App.ActiveDocument." << *it << ",";
|
||||
str << "]";
|
||||
Gui::Command::doCommand(Gui::Command::Doc,str.str().c_str());
|
||||
Gui::Command::runCommand(Gui::Command::Doc,str.str().c_str());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
QMessageBox::warning(parameter, tr("Boolean: Accept: Input error"), QString::fromLatin1(e.what()));
|
||||
|
||||
@@ -219,7 +219,7 @@ bool TaskDlgDressUpParameters::accept()
|
||||
for (std::vector<std::string>::const_iterator it = refs.begin(); it != refs.end(); ++it)
|
||||
str << "\"" << *it << "\",";
|
||||
str << "])";
|
||||
Gui::Command::doCommand(Gui::Command::Doc,str.str().c_str());
|
||||
Gui::Command::runCommand(Gui::Command::Doc,str.str().c_str());
|
||||
|
||||
return TaskDlgFeatureParameters::accept();
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user