#include <vlc_config_cat.h>
#include <vlc_intf_strings.h>
+#include <vlc_modules.h>
#include <assert.h>
#define ITEM_HEIGHT 25
QTreeWidget( _parent ), p_intf( _p_intf )
{
/* General Qt options */
- setColumnCount( 1 );
setAlternatingRowColors( true );
- header()->hide();
+ setHeaderHidden( true );
setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
setTextElideMode( Qt::ElideNone );
current_item = new QTreeWidgetItem();
current_item->setText( 0, data->name );
current_item->setIcon( 0 , icon );
- current_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
+ //current_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
current_item->setData( 0, Qt::UserRole,
qVariantFromValue( data ) );
addTopLevelItem( current_item );
subcat_item->setText( 0, data_sub->name );
subcat_item->setData( 0, Qt::UserRole,
qVariantFromValue( data_sub ) );
- subcat_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
+ //subcat_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
/* Add it to the parent */
assert( current_item );
module_item->setText( 0, qtr( module_get_name( p_module, false ) ) );
module_item->setData( 0, Qt::UserRole,
QVariant::fromValue( module_data) );
- module_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
+ //module_item->setSizeHint( 0, QSize( -1, ITEM_HEIGHT ) );
subcat_item->addChild( module_item );
}
sortItems( 0, Qt::AscendingOrder );
module_list_free( p_list );
+ resizeColumnToContents( 0 );
}
PrefsTree::~PrefsTree() {}
}
QLabel *titleLabel = new QLabel( head );
- QFont titleFont = QApplication::font( static_cast<QWidget*>(0) );
+ QFont titleFont = QApplication::font();
titleFont.setPointSize( titleFont.pointSize() + 6 );
- titleFont.setFamily( "Verdana" );
titleLabel->setFont( titleFont );
// Title <hr>
( p_item->i_type == CONFIG_CATEGORY ||
p_item->i_type == CONFIG_SUBCATEGORY ) )
break;
- if( p_item->b_internal == true ) continue;
+ if( p_item->b_internal ) continue;
if( p_item->i_type == CONFIG_SECTION )
{
boxlayout = new QGridLayout();
}
/* Only one hotkey control */
- if( has_hotkey && p_item->i_type & CONFIG_ITEM && p_item->psz_name &&
- strstr( p_item->psz_name, "key-" ) )
- continue;
- if( p_item->i_type & CONFIG_ITEM && p_item->psz_name &&
- strstr( p_item->psz_name, "key-" ) )
+ if( (p_item->i_type & CONFIG_ITEM) == CONFIG_ITEM_KEY )
+ {
+ if( has_hotkey )
+ continue;
has_hotkey = true;
+ }
ConfigControl *control;
if( ! box )
void AdvPrefsPanel::apply()
{
- QList<ConfigControl *>::Iterator i;
- for( i = controls.begin() ; i != controls.end() ; i++ )
- {
- ConfigControl *c = qobject_cast<ConfigControl *>(*i);
- c->doApply( p_intf );
- }
+ foreach ( ConfigControl *cfg, controls )
+ cfg->doApply();
}
void AdvPrefsPanel::clean()