//#define DEBUG_WITH_MESSAGE_REPORT
QString XGUI_Workshop::MOVE_TO_END_COMMAND = QObject::tr("Move to the end");
+QString XGUI_Workshop::MOVE_TO_END_SPLIT_COMMAND = QObject::tr("Move to the end and split");
//#define DEBUG_DELETE
//#define DEBUG_FEATURE_NAME
else
aMgr->redo();
- if (QString((*aIt).c_str()) == MOVE_TO_END_COMMAND)
+ if (QString((*aIt).c_str()) == MOVE_TO_END_COMMAND ||
+ QString((*aIt).c_str()) == MOVE_TO_END_SPLIT_COMMAND)
myObjectBrowser->rebuildDataTree();
}
operationMgr()->updateApplyOfOperations();
deleteObjects();
else if (theId == "CLEAN_HISTORY_CMD")
cleanHistory();
- else if (theId == "MOVE_CMD")
- moveObjects();
+ else if (theId == "MOVE_CMD" || theId == "MOVE_SPLIT_CMD")
+ moveObjects(theId == "MOVE_SPLIT_CMD");
else if (theId == "COLOR_CMD")
changeColor(aObjects);
else if (theId == "DEFLECTION_CMD")
DocumentPtr aDoc = theF1->document();
return aDoc->index(theF1) < aDoc->index(theF2);
}
-void XGUI_Workshop::moveObjects()
+void XGUI_Workshop::moveObjects(const bool theSplit)
{
if (!abortAllOperations())
return;
if (!XGUI_Tools::canRemoveOrRename(desktop(), aFeatures))
return;
- QString anActionId = "MOVE_CMD";
+ QString anActionId = theSplit ? "MOVE_CMD" : "MOVE_SPLIT_CMD";
QString aDescription = contextMenuMgr()->action(anActionId)->text();
aMgr->startOperation(aDescription.toStdString());
if (!aFeature.get() || !myModule->canApplyAction(aFeature, anActionId))
continue;
- anActiveDocument->moveFeature(aFeature, aCurrentFeature);
+ anActiveDocument->moveFeature(aFeature, aCurrentFeature, theSplit);
aCurrentFeature = anActiveDocument->currentFeature(true);
}
aMgr->finishOperation();