Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Attacher: fix wrong superPlacement read-onlyness
It reacted to changes to unrelated properties. Fixed.
  • Loading branch information
DeepSOIC authored and wwmayer committed May 7, 2016
1 parent abf4ddf commit c1f22cb
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/Mod/Part/App/AttachableObject.cpp
Expand Up @@ -109,30 +109,31 @@ void setReadonlyness(App::Property &prop, bool on)
void AttachableObject::onChanged(const App::Property* prop)
{
if(! this->isRestoring()){
bool bAttached = false;
try{
if ((prop == &Support
|| prop == &MapMode
|| prop == &MapPathParameter
|| prop == &MapReversed
|| prop == &superPlacement)){

if ((prop == &Support
|| prop == &MapMode
|| prop == &MapPathParameter
|| prop == &MapReversed
|| prop == &superPlacement)){

bool bAttached = false;
try{
bAttached = positionBySupport();
} catch (Base::Exception &e) {
this->setError();
Base::Console().Error("PositionBySupport: %s",e.what());
//set error message - how?
} catch (Standard_Failure &e){
this->setError();
Base::Console().Error("PositionBySupport: %s",e.GetMessageString());
}
} catch (Base::Exception &e) {
this->setError();
Base::Console().Error("PositionBySupport: %s",e.what());
//set error message - how?
} catch (Standard_Failure &e){
this->setError();
Base::Console().Error("PositionBySupport: %s",e.GetMessageString());
}

eMapMode mmode = eMapMode(this->MapMode.getValue());
setReadonlyness(this->superPlacement, !bAttached);
setReadonlyness(this->Placement, bAttached && mmode != mmTranslate); //for mmTranslate, orientation should remain editable even when attached.
eMapMode mmode = eMapMode(this->MapMode.getValue());
setReadonlyness(this->superPlacement, !bAttached);
setReadonlyness(this->Placement, bAttached && mmode != mmTranslate); //for mmTranslate, orientation should remain editable even when attached.
}

}

Part::Feature::onChanged(prop);
}

Expand Down

0 comments on commit c1f22cb

Please sign in to comment.