mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 19:37:09 +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()) );
|
Q_ASSERT( sender() && qobject_cast<DynamicControlWidget*>(sender()) );
|
||||||
DynamicControlWidget* widget = 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() );
|
emit controlChanged( widget->control() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -42,7 +42,6 @@ DynamicControlWidget::DynamicControlWidget( const Tomahawk::dyncontrol_ptr& cont
|
|||||||
, m_layout( 0 )
|
, m_layout( 0 )
|
||||||
{
|
{
|
||||||
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||||
setMouseTracking( true );
|
|
||||||
|
|
||||||
m_layout = new QHBoxLayout;
|
m_layout = new QHBoxLayout;
|
||||||
m_layout->setMargin( 0 );
|
m_layout->setMargin( 0 );
|
||||||
@@ -140,10 +139,18 @@ DynamicControlWidget::typeSelectorChanged( const QString& type, bool firstLoad )
|
|||||||
m_layout->removeWidget( m_matchSelector );
|
m_layout->removeWidget( m_matchSelector );
|
||||||
m_layout->removeWidget( m_entryWidget );
|
m_layout->removeWidget( m_entryWidget );
|
||||||
|
|
||||||
if( m_control->selectedType() == type && !firstLoad )
|
if( m_control->selectedType() != type && !firstLoad )
|
||||||
m_control->setSelectedType( type );
|
m_control->setSelectedType( type );
|
||||||
|
|
||||||
m_typeSelector->setLabel( 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() ) {
|
if( m_control->matchSelector() ) {
|
||||||
m_matchSelector->setWritableWidget( m_control->matchSelector() );
|
m_matchSelector->setWritableWidget( m_control->matchSelector() );
|
||||||
m_matchSelector->setLabel( m_control->matchString() );
|
m_matchSelector->setLabel( m_control->matchString() );
|
||||||
|
Reference in New Issue
Block a user