void ModuleBase_Operation::activateByPreselection()
{
- ModuleBase_ModelWidget* aFilledWgt = 0;
+ if (myPreSelection.empty())
+ return;
+ ModuleBase_ModelWidget* aFilledWgt = 0;
if (myPropertyPanel && !myPreSelection.empty()) {
const QList<ModuleBase_ModelWidget*>& aWidgets = myPropertyPanel->modelWidgets();
if (!aWidgets.empty()) {
// 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
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();
}
//******************************************************