add option to getBodyFor to suppress dialog to set workflow style to modern

This commit is contained in:
wmayer
2018-01-03 21:35:03 +01:00
parent 22b117fd83
commit d24379d822
3 changed files with 18 additions and 7 deletions

View File

@@ -163,7 +163,16 @@ void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) con
// Add move Tip Command
if ( selection.size () >= 1 ) {
App::DocumentObject *feature = selection.front().pObject;
PartDesign::Body *body = PartDesignGui::getBodyFor (feature, false, false);
PartDesign::Body *body = nullptr;
// if PD workflow is not new-style then add a command to the context-menu
bool assertModern = true;
if (feature && !isModernWorkflow(feature->getDocument())) {
assertModern = false;
*item << "PartDesign_Migrate";
}
body = PartDesignGui::getBodyFor (feature, false, false, assertModern);
// lote of assertion so feature should be marked as a tip
if ( selection.size () == 1 && feature && (
feature->isDerivedFrom ( PartDesign::Body::getClassTypeId () ) ||