Commit 69db070f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use module_*

parent ac5d0a1e
......@@ -88,7 +88,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
assert (i < (unsigned)p_list->i_count);
const module_t *p_main = (module_t *)p_list->p_values[i].p_object;
if( strcmp( p_main->psz_object_name, "main" ) == 0 )
if( strcmp( module_GetObjName( p_main ), "main" ) == 0 )
p_module = p_main;
}
......@@ -191,7 +191,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
p_module = (module_t *)p_list->p_values[i_index].p_object;
// Main module excluded
if( !strcmp( p_module->psz_object_name, "main" ) ) continue;
if( !strcmp( module_GetObjName( p_module ), "main" ) ) continue;
/* Exclude submodules; they have no config options of their own */
if( p_module->b_submodule ) continue;
......@@ -252,15 +252,14 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
PrefsItemData *module_data = new PrefsItemData();
module_data->b_submodule = p_module->b_submodule;
module_data->i_type = TYPE_MODULE;
module_data->psz_name = strdup( p_module->psz_object_name );
module_data->psz_name = strdup( module_GetObjName( p_module ) );
module_data->i_object_id = p_module->b_submodule ?
((module_t *)p_module->p_parent)->i_object_id :
p_module->i_object_id;
module_data->help.clear();
// TODO image
QTreeWidgetItem *module_item = new QTreeWidgetItem();
module_item->setText( 0, qtr( p_module->psz_shortname ?
p_module->psz_shortname : p_module->psz_object_name) );
module_item->setText( 0, qtr( module_GetName( p_module, VLC_FALSE ) ) );
//item->setIcon( 0 , XXX );
module_item->setData( 0, Qt::UserRole,
QVariant::fromValue( module_data) );
......@@ -390,11 +389,11 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
}
else
{
head = QString( qtr(p_module->psz_longname) );
head = QString( qtr( module_GetLongName( p_module ) ) );
if( p_module->psz_help )
{
help.append( "\n" );
help.append( qtr( p_module->psz_help ) );
help.append( qtr( module_GetHelp( p_module ) ) );
}
}
......
......@@ -437,7 +437,7 @@ void ModuleConfigControl::finish( bool bycat )
if( bycat )
{
if( !strcmp( p_parser->psz_object_name, "main" ) ) continue;
if( !strcmp( module_GetObjName( p_parser ), "main" ) ) continue;
for (size_t i = 0; i < p_parser->confsize; i++)
{
......@@ -445,19 +445,19 @@ void ModuleConfigControl::finish( bool bycat )
/* Hack: required subcategory is stored in i_min */
if( p_config->i_type == CONFIG_SUBCATEGORY &&
p_config->value.i == p_item->min.i )
combo->addItem( qtr(p_parser->psz_longname),
QVariant( p_parser->psz_object_name ) );
combo->addItem( qtr( module_GetLongName( p_parser )),
QVariant( module_GetObjName( p_parser ) ) );
if( p_item->value.psz && !strcmp( p_item->value.psz,
p_parser->psz_object_name) )
module_GetObjName( p_parser ) ) )
combo->setCurrentIndex( combo->count() - 1 );
}
}
else if( module_IsCapable( p_parser, p_item->psz_type ) )
{
combo->addItem( qtr(p_parser->psz_longname),
QVariant( p_parser->psz_object_name ) );
combo->addItem( qtr(module_GetLongName( p_parser ) ),
QVariant( module_GetObjName( p_parser ) ) );
if( p_item->value.psz && !strcmp( p_item->value.psz,
p_parser->psz_object_name) )
module_GetObjName( p_parser ) ) )
combo->setCurrentIndex( combo->count() - 1 );
}
}
......@@ -529,11 +529,11 @@ ModuleListConfigControl::~ModuleListConfigControl()
#define CHECKBOX_LISTS \
{ \
QCheckBox *cb = new QCheckBox( qtr( p_parser->psz_longname ) );\
QCheckBox *cb = new QCheckBox( qtr( module_GetLongName( p_parser ) ) );\
checkBoxListItem *cbl = new checkBoxListItem; \
\
CONNECT( cb, stateChanged( int ), this, onUpdate( int ) );\
cb->setToolTip( formatTooltip( qtr(p_parser->psz_longname)) );\
cb->setToolTip( formatTooltip( qtr( module_GetLongName( p_parser ))));\
cbl->checkBox = cb; \
\
int i = -1; \
......@@ -541,7 +541,7 @@ ModuleListConfigControl::~ModuleListConfigControl()
i--; \
\
cbl->psz_module = strdup( i>=0?p_parser->pp_shortcuts[i] \
: p_parser->psz_object_name ); \
: module_GetObjName( p_parser ) ); \
modules.push_back( cbl ); \
}
......@@ -559,7 +559,7 @@ void ModuleListConfigControl::finish( bool bycat )
if( bycat )
{
if( !strcmp( p_parser->psz_object_name, "main" ) ) continue;
if( !strcmp( module_GetObjName( p_parser ), "main" ) ) continue;
for (size_t i = 0; i < p_parser->confsize; i++)
{
......
......@@ -4,7 +4,7 @@
* Copyright (C) 2006-2007 the VideoLAN team
* $Id$
*
* Authors: Clment Stenac <zorglub@videolan.org>
* Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
......@@ -437,19 +437,18 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
if( !module_IsCapable( p_parser, "services_discovery" ) )
continue;
QAction *a = new QAction( qfu( p_parser->psz_longname ), menu );
QAction *a = new QAction( qfu( module_GetLongName( p_parser ) ), menu );
a->setCheckable( true );
/* hack to handle submodules properly */
int i = -1;
while( p_parser->pp_shortcuts[++i] != NULL );
i--;
if( playlist_IsServicesDiscoveryLoaded( THEPL,
i>=0?p_parser->pp_shortcuts[i]
: p_parser->psz_object_name ) )
p_parser->pp_shortcuts[i] ?: module_GetObjName( p_parser ) ) )
a->setChecked( true );
CONNECT( a , triggered(), THEDP->SDMapper, map() );
THEDP->SDMapper->setMapping( a, i>=0? p_parser->pp_shortcuts[i] :
p_parser->psz_object_name );
module_GetObjName( p_parser ) );
menu->addAction( a );
}
vlc_list_release( p_list );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment