void ModuleBase_Operation::setRunning(bool theState)
{
- if (!theState) {
- abort();
- }
+ emit triggered(theState);
}
void ModuleBase_Operation::activateByPreselection()
ModuleBase_ModelWidget* aWgt, *aFilledWgt = 0;
QList<ModuleBase_ModelWidget*>::const_iterator aWIt;
- QList<ModuleBase_ViewerPrs>::const_iterator aPIt;
bool isSet = false;
- for (aWIt = aWidgets.constBegin(), aPIt = myPreSelection.constBegin();
- (aWIt != aWidgets.constEnd()) && (aPIt != myPreSelection.constEnd());
- ++aWIt) {
+ // 1. apply the selection to controls
+ int aCurrentPosition = 0;
+ for (aWIt = aWidgets.constBegin(); aWIt != aWidgets.constEnd(); ++aWIt) {
aWgt = (*aWIt);
- ModuleBase_ViewerPrs aValue = (*aPIt);
if (!aWgt->canSetValue())
continue;
- ++aPIt;
- if (!aWgt->setSelection(aValue)) {
+ if (!aWgt->setSelection(myPreSelection, aCurrentPosition/*aValue*/)) {
isSet = false;
break;
} else {
aFilledWgt = aWgt;
}
}
+ // 2. ignore not obligatory widgets
+ /*for (; aWIt != aWidgets.constEnd(); ++aWIt) {
+ aWgt = (*aWIt);
+ if (aWgt && aWgt->isObligatory())
+ continue;
+ aFilledWgt = aWgt;
+ }*/
+ // 3. activate the next obligatory widget
myPropertyPanel->activateNextWidget(aFilledWgt);
if (aFilledWgt)
emit activatedByPreselection();