ZynAddSubFX: only re-instantiate ZASF if m_hasGUI has changed
Do not re-instantiate ZynAddSubFX if m_hasGUI is different from the value of the according push button.
This commit is contained in:
@@ -565,7 +565,7 @@ void ZynAddSubFxView::modelChanged()
|
||||
|
||||
m_forwardMidiCC->setModel( &m->m_forwardMidiCcModel );
|
||||
|
||||
toggleUI();
|
||||
m_toggleUIButton->setChecked( m->m_hasGUI );
|
||||
}
|
||||
|
||||
|
||||
@@ -574,13 +574,16 @@ void ZynAddSubFxView::modelChanged()
|
||||
void ZynAddSubFxView::toggleUI()
|
||||
{
|
||||
ZynAddSubFxInstrument * model = castModel<ZynAddSubFxInstrument>();
|
||||
model->m_hasGUI = m_toggleUIButton->isChecked();
|
||||
model->reloadPlugin();
|
||||
|
||||
if( model->m_remotePlugin )
|
||||
if( model->m_hasGUI != m_toggleUIButton->isChecked() )
|
||||
{
|
||||
connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ),
|
||||
m_toggleUIButton, SLOT( toggle() ) );
|
||||
model->m_hasGUI = m_toggleUIButton->isChecked();
|
||||
model->reloadPlugin();
|
||||
|
||||
if( model->m_remotePlugin )
|
||||
{
|
||||
connect( model->m_remotePlugin, SIGNAL( clickedCloseButton() ),
|
||||
m_toggleUIButton, SLOT( toggle() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user