Commit 7923cba5 authored by Matthias Möller's avatar Matthias Möller

ui updating fix

refs #2046

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18357 383ad7c9-94d9-4d36-a494-682f7c89f535
parent be7d9657
......@@ -671,6 +671,18 @@ void SkeletalAnimationPlugin::slotMethodChanged(int _index)
//------------------------------------------------------------------------------
/**
* @brief Helper Class for UpdateUI. assigns a bool value and set it to "true". after leaving the scope, set it to false
*
*/
class GuiUpdatingScopeGuard
{
bool& v_;
public:
GuiUpdatingScopeGuard(bool &_in):v_{_in}{v_ = true;}
~GuiUpdatingScopeGuard(){v_ = false;}
};
/**
* @brief Called when the active object changes and the interface needs to be updated
*/
......@@ -679,7 +691,7 @@ void SkeletalAnimationPlugin::UpdateUI()
if(bGuiUpdating_) // gui updates object -> object is updated so gui gets updated -> loop forever
return;
bGuiUpdating_ = true;
GuiUpdatingScopeGuard guard(bGuiUpdating_);
if( ! activeSkeletons_.empty() )
{
......@@ -748,8 +760,6 @@ void SkeletalAnimationPlugin::UpdateUI()
pToolbox_->pbClearSkins->setEnabled(false);
pToolbox_->skinningBox->setTitle(tr("Attached Skins"));
}
bGuiUpdating_ = false;
}
//------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment