/*****************************************************************************
* preferences.cpp : "Normal preferences"
****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2007 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
for (size_t i = 0; i < p_module->confsize; i++)
{
const module_config_t *p_item = p_module->p_config + i;
- char *psz_help;
+ const char *psz_help;
QIcon icon;
switch( p_item->i_type )
{
/* Build the tree of plugins */
for( int i_index = 0; i_index < p_list->i_count; i_index++ )
{
- int i_subcategory = -1, i_category = -1, i_options = 0;
p_module = (module_t *)p_list->p_values[i_index].p_object;
// Main module excluded
if( !strcmp( p_module->psz_object_name, "main" ) ) continue;
- /* Exclude empty plugins (submodules don't have config options, they
- * are stored in the parent module) */
+ /* Exclude submodules; they have no config options of their own */
if( p_module->b_submodule ) continue;
+ unsigned i_subcategory = 0, i_category = 0;
+ bool b_options = false;
+
for (size_t i = 0; i < p_module->confsize; i++)
{
- module_config_t *p_item = p_module->p_config + i;
+ const module_config_t *p_item = p_module->p_config + i;
if( p_item->i_type == CONFIG_CATEGORY )
i_category = p_item->value.i;
else if( p_item->i_type == CONFIG_SUBCATEGORY )
i_subcategory = p_item->value.i;
+
if( p_item->i_type & CONFIG_ITEM )
- i_options++;
+ b_options = true;
- if( i_options > 0 && i_category >= 0 && i_subcategory >= 0 )
+ if( b_options && i_category && i_subcategory )
break;
}
- if( !i_options ) continue; // Nothing to display
+ if( !b_options || i_category == 0 || i_subcategory == 0 ) continue;
// Locate the category item;
QTreeWidgetItem *subcat_item = NULL;
}
}
+ /* Widgets now */
global_layout = new QVBoxLayout();
global_layout->setMargin( 2 );
QString head;
+ QString help;
+
+ help = QString( data->help );
+
if( data->i_type == TYPE_SUBCATEGORY || data->i_type == TYPE_CATSUBCAT )
{
head = QString( data->name );
head = QString( qfu(p_module->psz_longname) );
if( p_module->psz_help )
{
- head.append( "\n" );
- head.append( qfu( p_module->psz_help ) );
+ help.append( "\n" );
+ help.append( qfu( p_module->psz_help ) );
}
}
- QLabel *label = new QLabel( head );
- global_layout->addWidget( label );
- QFont myFont = QApplication::font( static_cast<QWidget*>(0) );
- myFont.setPointSize( myFont.pointSize() + 3 ); myFont.setBold( true );
+ QLabel *titleLabel = new QLabel( head );
+ QFont titleFont = QApplication::font( static_cast<QWidget*>(0) );
+ titleFont.setPointSize( titleFont.pointSize() + 6 );
+ titleFont.setFamily( "Verdana" );
+ titleLabel->setFont( titleFont );
+
+ // Title <hr>
+ QFrame *title_line = new QFrame;
+ title_line->setFrameShape(QFrame::HLine);
+ title_line->setFrameShadow(QFrame::Sunken);
- label->setFont( myFont );
- QLabel *help = new QLabel( data->help, this );
- help->setWordWrap( true );
+ QLabel *helpLabel = new QLabel( help, this );
+ helpLabel->setWordWrap( true );
- global_layout->addWidget( help );
+ global_layout->addWidget( titleLabel );
+ global_layout->addWidget( title_line );
+ global_layout->addWidget( helpLabel );
QGroupBox *box = NULL;
QGridLayout *boxlayout = NULL;