mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 11:30:49 +02:00
Fix dynamic control widget not setting type combobox
This commit is contained in:
@@ -197,6 +197,9 @@ void DynamicControlList::controlChanged()
|
||||
Q_ASSERT( sender() && qobject_cast<DynamicControlWidget*>(sender()) );
|
||||
DynamicControlWidget* widget = qobject_cast<DynamicControlWidget*>(sender());
|
||||
|
||||
qDebug() << "control changed!";
|
||||
foreach( DynamicControlWidget* c, m_controls )
|
||||
qDebug() << c->control()->id() << c->control()->selectedType() << c->control()->match() << c->control()->input();
|
||||
emit controlChanged( widget->control() );
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,6 @@ DynamicControlWidget::DynamicControlWidget( const Tomahawk::dyncontrol_ptr& cont
|
||||
, m_layout( 0 )
|
||||
{
|
||||
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||
setMouseTracking( true );
|
||||
|
||||
m_layout = new QHBoxLayout;
|
||||
m_layout->setMargin( 0 );
|
||||
@@ -140,10 +139,18 @@ DynamicControlWidget::typeSelectorChanged( const QString& type, bool firstLoad )
|
||||
m_layout->removeWidget( m_matchSelector );
|
||||
m_layout->removeWidget( m_entryWidget );
|
||||
|
||||
if( m_control->selectedType() == type && !firstLoad )
|
||||
if( m_control->selectedType() != type && !firstLoad )
|
||||
m_control->setSelectedType( type );
|
||||
|
||||
m_typeSelector->setLabel( type );
|
||||
|
||||
QComboBox* typeSel = qobject_cast<QComboBox*>(m_typeSelector->writableWidget());
|
||||
if( m_typeSelector->writable() && m_typeSelector->writableWidget() && typeSel ) {
|
||||
int idx = typeSel->findText( type );
|
||||
if( idx > -1 )
|
||||
typeSel->setCurrentIndex( idx );
|
||||
}
|
||||
|
||||
if( m_control->matchSelector() ) {
|
||||
m_matchSelector->setWritableWidget( m_control->matchSelector() );
|
||||
m_matchSelector->setLabel( m_control->matchString() );
|
||||
|
Reference in New Issue
Block a user