From: nds Date: Mon, 13 Jul 2015 06:10:19 +0000 (+0300) Subject: activate by preselection should be done at the end of the onOperationStarted slot. X-Git-Tag: V_1.3.0~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dc8be5e59d71e392c2379e07331d0fe248c2156a;p=modules%2Fshaper.git activate by preselection should be done at the end of the onOperationStarted slot. Yellow line stays in the viewer after creation a parallel constraint by preselection. --- diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index c54130b48..fd2e8f9e6 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -268,8 +268,10 @@ void ModuleBase_Operation::commitOperation() void ModuleBase_Operation::activateByPreselection() { - ModuleBase_ModelWidget* aFilledWgt = 0; + if (myPreSelection.empty()) + return; + ModuleBase_ModelWidget* aFilledWgt = 0; if (myPropertyPanel && !myPreSelection.empty()) { const QList& aWidgets = myPropertyPanel->modelWidgets(); if (!aWidgets.empty()) { @@ -387,8 +389,10 @@ void ModuleBase_Operation::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) // Do not activate widgets by default if the current operation is editing operation // Because we don't know which widget is going to be edited. - if (!isEditOperation()) - activateByPreselection(); + if (!isEditOperation()) { + // 4. activate the first obligatory widget + myPropertyPanel->activateNextWidget(NULL); + } } bool ModuleBase_Operation::isGranted(QString theId) const diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 755f4b732..b2bb15a38 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -384,6 +384,12 @@ void XGUI_Workshop::onOperationStarted(ModuleBase_Operation* theOperation) deactivateActiveObject(*anIt, false); if (anObjects.size() > 0) myDisplayer->updateViewer(); + + // filling the operation values by the selection in the viewer + // it should be perfomed at the end of the method because it can commit the operation + // if after the controls fill, the operation becomes valid + if (!theOperation->isEditOperation()) + theOperation->activateByPreselection(); } //******************************************************