Improved animation control

Fixed double redraw related to update of the time step in the combo box called during use of the animation toolbar
p4#: 22098
This commit is contained in:
Magne Sjaastad 2013-08-06 11:01:14 +02:00
parent 3f61c26f0b
commit adff387d36
2 changed files with 15 additions and 1 deletions

View File

@ -172,7 +172,7 @@ void AnimationToolBar::connectAnimationControl(caf::FrameAnimationControl* anima
connect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), animationControl, SLOT(setCurrentFrame(int)));
connect(m_frameRateSlider, SIGNAL(valueChanged(int)), this, SLOT(slotFrameRateSliderChanged(int)));
connect(animationControl, SIGNAL(changeFrame(int)), m_timestepCombo, SLOT(setCurrentIndex (int)));
connect(animationControl, SIGNAL(changeFrame(int)), SLOT(slotUpdateComboBoxIndex(int)));
connect(animationControl, SIGNAL(frameCountChanged(int)), this, SLOT(slotUpdateTimestepList(int)));
int timeout = animationControl->timeout();
double initialFrameRate = 1000;
@ -318,4 +318,17 @@ void AnimationToolBar::slotFwdBwdModeToggled(bool on)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void AnimationToolBar::slotUpdateComboBoxIndex(int value)
{
// Update only the combo box index, but do not set current frame
// Disconnect the signal temporarily when updating UI
disconnect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), m_activeAnimationControl, SLOT(setCurrentFrame(int)));
m_timestepCombo->setCurrentIndex(value);
connect(m_timestepCombo, SIGNAL(currentIndexChanged(int)), m_activeAnimationControl, SLOT(setCurrentFrame(int)));
}
} // End namespace caf

View File

@ -60,6 +60,7 @@ private slots:
void slotFrameRateSliderChanged(int value);
void slotFromStartModeToggled(bool on);
void slotFwdBwdModeToggled(bool on);
void slotUpdateComboBoxIndex(int value);
private:
void init();