- ModuleBase_IWorkshop* anIWorkshop = workshop();
- if (!theOperation->getDescription()->hasXmlRepresentation()) { //!< No need for property panel
- anIWorkshop->updateCommandStatus();
- }
- else {
- ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
- (theOperation);
- if (aFOperation) {
- XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(anIWorkshop);
- XGUI_PropertyPanel* aPropertyPanel = aWorkshop->propertyPanel();
- ModuleBase_ModelWidget* aFilledWidget = 0;
- bool aPostonedWidgetActivation = false;
- FeaturePtr aFeature = aFOperation->feature();
-
- std::string aGreedAttributeId = ModuleBase_Tools::findGreedAttribute(anIWorkshop, aFeature);
- // if there is a greed attribute, automatic commit by preselection for this feature is prohibited
- aWorkshop->setPropertyPanel(aFOperation);
-
- // filling the operation values by the current selection
- // if the operation can be committed after the controls filling, the method perform should
- // be stopped. Otherwise unnecessary presentations can be shown(e.g. operation prs in sketch)
- bool isOperationCommitted = false;
- if (!aFOperation->isEditOperation()) {
- aFilledWidget = aFOperation->activateByPreselection(aGreedAttributeId);
- if (currentOperation() != aFOperation)
- isOperationCommitted = true;
- else {
- if (aGreedAttributeId.empty()) {
- // a signal should be emitted before the next widget activation
- // because, the activation of the next widget will give a focus to the widget. As a result
- // the value of the widget is initialized. And commit may happens until the value is entered.
- if (aFilledWidget) {
- if (mySketchReentrantMgr->canBeCommittedByPreselection())
- isOperationCommitted = mySketchMgr->operationActivatedByPreselection();
- // activate the next obligatory widget
- if (!isOperationCommitted)
- aPropertyPanel->activateNextWidget(aFilledWidget);
- }
- }
- else { // there is a greed widget
- const QList<ModuleBase_ModelWidget*>& aWidgets = aPropertyPanel->modelWidgets();
- std::string aFirstAttributeId = aWidgets.front()->attributeID();
- // activate next widget after greeded if it is the first widget in the panel
- // else the first panel widget is already activated by operation start
- if (aFirstAttributeId == aGreedAttributeId)
- aPostonedWidgetActivation = true;
+ ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+ (theOperation);
+ if (aFOperation) {
+ XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(workshop());
+ XGUI_PropertyPanel* aPropertyPanel = aWorkshop->propertyPanel();
+
+ ModuleBase_ModelWidget* aFilledWidget = 0;
+ bool aPostonedWidgetActivation = false;
+
+ FeaturePtr aFeature = aFOperation->feature();
+ /// Restart sketcher operations automatically
+ /// it is important to call method of sketch reentrant manager before filling of PP
+ /// because it fills some created feature attributes, these new values should be used
+ /// to fill the property panel
+ mySketchReentrantMgr->operationStarted(theOperation);
+
+ aWorkshop->fillPropertyPanel(aFOperation);
+ // filling the operation values by the current selection
+ // if the operation can be committed after the controls filling, the method perform should
+ // be stopped. Otherwise unnecessary presentations can be shown(e.g. operation prs in sketch)
+ bool isOperationCommitted = false;
+ if (!aFOperation->isEditOperation()) {
+ std::string aGreedAttributeId = ModuleBase_Tools::findGreedAttribute(workshop(), aFeature);
+ // if there is a greed attribute, automatic commit by preselection
+ // for this feature is prohibited
+ aFilledWidget = aFOperation->activateByPreselection(aGreedAttributeId);
+ if (currentOperation() != aFOperation)
+ isOperationCommitted = true;
+ else {
+ if (aGreedAttributeId.empty()) {
+ // a signal should be emitted before the next widget activation
+ // because, the activation of the next widget will give a focus to the widget.
+ // As a result the value of the widget is initialized.
+ // And commit may happens until the value is entered.
+ if (aFilledWidget) {
+ if (mySketchReentrantMgr->canBeCommittedByPreselection())
+ isOperationCommitted = mySketchMgr->operationActivatedByPreselection();
+ // activate the next obligatory widget
+ if (!isOperationCommitted)
+ aPropertyPanel->activateNextWidget(aFilledWidget);