Commit c2725e1e authored by Christophe Mutricy's avatar Christophe Mutricy

Adapt to the new config_item_t.

parent c22b4529
...@@ -224,7 +224,8 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog, ...@@ -224,7 +224,8 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
p_intf( _p_intf ), p_open_dialog( dialog ), p_advanced_dialog( NULL ) p_intf( _p_intf ), p_open_dialog( dialog ), p_advanced_dialog( NULL )
{ {
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
module_config_t *p_item = p_module->p_config; module_config_t *p_item = p_module->p_config,
*p_end = p_item + p_module->confsize;
bool b_advanced = false; bool b_advanced = false;
if( p_item ) do if( p_item ) do
...@@ -247,7 +248,7 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog, ...@@ -247,7 +248,7 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
sizer->Add( control, 0, wxEXPAND | wxALL, 2 ); sizer->Add( control, 0, wxEXPAND | wxALL, 2 );
} }
while( p_item->i_type != CONFIG_HINT_END && p_item++ ); while( p_item < p_end && p_item++ );
if( b_advanced ) if( b_advanced )
{ {
...@@ -303,7 +304,7 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog, ...@@ -303,7 +304,7 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
sizer->Add( control, 0, wxEXPAND | wxALL, 2 ); sizer->Add( control, 0, wxEXPAND | wxALL, 2 );
} }
while( p_item->i_type != CONFIG_HINT_END && p_item++ ); while( p_item < p_end && p_item++ );
/* Separation */ /* Separation */
wxPanel *dummy_panel = new wxPanel( p_advanced_dialog, -1 ); wxPanel *dummy_panel = new wxPanel( p_advanced_dialog, -1 );
......
...@@ -325,7 +325,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -325,7 +325,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
{ {
vlc_list_t *p_list = NULL;; vlc_list_t *p_list = NULL;;
module_t *p_module; module_t *p_module;
module_config_t *p_item; module_config_t *p_item, *p_end;
int i_index, i_image=0; int i_index, i_image=0;
/* Initializations */ /* Initializations */
...@@ -368,6 +368,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -368,6 +368,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
/* Enumerate config categories and store a reference so we can /* Enumerate config categories and store a reference so we can
* generate their config panel them when it is asked by the user. */ * generate their config panel them when it is asked by the user. */
p_item = p_module->p_config; p_item = p_module->p_config;
p_end = p_item + p_module->confsize;
if( p_item ) do if( p_item ) do
{ {
...@@ -376,10 +377,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -376,10 +377,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
{ {
case CONFIG_CATEGORY: case CONFIG_CATEGORY:
config_data = new ConfigTreeData; config_data = new ConfigTreeData;
if( p_item->i_value == -1 ) break; // Don't display it if( p_item->value.i == -1 ) break; // Don't display it
config_data->psz_name = strdup( config_CategoryNameGet( config_data->psz_name = strdup( config_CategoryNameGet(
p_item->i_value ) ); p_item->value.i ) );
psz_help = config_CategoryHelpGet( p_item->i_value ); psz_help = config_CategoryHelpGet( p_item->value.i );
if( psz_help ) if( psz_help )
{ {
config_data->psz_help = wraptext( strdup( psz_help ), 72 ); config_data->psz_help = wraptext( strdup( psz_help ), 72 );
...@@ -389,10 +390,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -389,10 +390,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
config_data->psz_help = NULL; config_data->psz_help = NULL;
} }
config_data->i_type = TYPE_CATEGORY; config_data->i_type = TYPE_CATEGORY;
config_data->i_object_id = p_item->i_value; config_data->i_object_id = p_item->value.i;
/* Add the category to the tree */ /* Add the category to the tree */
switch( p_item->i_value ) switch( p_item->value.i )
{ {
case CAT_AUDIO: case CAT_AUDIO:
i_image = 0; break; i_image = 0; break;
...@@ -415,26 +416,26 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -415,26 +416,26 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
break; break;
case CONFIG_SUBCATEGORY: case CONFIG_SUBCATEGORY:
if( p_item->i_value == -1 ) break; // Don't display it if( p_item->value.i == -1 ) break; // Don't display it
/* Special case: move the "general" subcategories to their /* Special case: move the "general" subcategories to their
* parent category */ * parent category */
if( p_item->i_value == SUBCAT_VIDEO_GENERAL || if( p_item->value.i == SUBCAT_VIDEO_GENERAL ||
p_item->i_value == SUBCAT_ADVANCED_MISC || p_item->value.i == SUBCAT_ADVANCED_MISC ||
p_item->i_value == SUBCAT_INPUT_GENERAL || p_item->value.i == SUBCAT_INPUT_GENERAL ||
p_item->i_value == SUBCAT_INTERFACE_GENERAL || p_item->value.i == SUBCAT_INTERFACE_GENERAL ||
p_item->i_value == SUBCAT_SOUT_GENERAL|| p_item->value.i == SUBCAT_SOUT_GENERAL||
p_item->i_value == SUBCAT_PLAYLIST_GENERAL|| p_item->value.i == SUBCAT_PLAYLIST_GENERAL||
p_item->i_value == SUBCAT_AUDIO_GENERAL ) p_item->value.i == SUBCAT_AUDIO_GENERAL )
{ {
ConfigTreeData *cd = (ConfigTreeData *) ConfigTreeData *cd = (ConfigTreeData *)
GetItemData( current_item ); GetItemData( current_item );
cd->i_type = TYPE_CATSUBCAT; cd->i_type = TYPE_CATSUBCAT;
cd->i_subcat_id = p_item->i_value; cd->i_subcat_id = p_item->value.i;
if( cd->psz_name ) free( cd->psz_name ); if( cd->psz_name ) free( cd->psz_name );
cd->psz_name = strdup( config_CategoryNameGet( cd->psz_name = strdup( config_CategoryNameGet(
p_item->i_value ) ); p_item->value.i ) );
if( cd->psz_help ) free( cd->psz_help ); if( cd->psz_help ) free( cd->psz_help );
char *psz_help = config_CategoryHelpGet( p_item->i_value ); char *psz_help = config_CategoryHelpGet( p_item->value.i );
if( psz_help ) if( psz_help )
{ {
cd->psz_help = wraptext( strdup( psz_help ), 72 ); cd->psz_help = wraptext( strdup( psz_help ), 72 );
...@@ -449,8 +450,8 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -449,8 +450,8 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
config_data = new ConfigTreeData; config_data = new ConfigTreeData;
config_data->psz_name = strdup( config_CategoryNameGet( config_data->psz_name = strdup( config_CategoryNameGet(
p_item->i_value ) ); p_item->value.i ) );
psz_help = config_CategoryHelpGet( p_item->i_value ); psz_help = config_CategoryHelpGet( p_item->value.i );
if( psz_help ) if( psz_help )
{ {
config_data->psz_help = wraptext( strdup( psz_help ), 72 ); config_data->psz_help = wraptext( strdup( psz_help ), 72 );
...@@ -460,10 +461,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -460,10 +461,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
config_data->psz_help = NULL; config_data->psz_help = NULL;
} }
config_data->i_type = TYPE_SUBCATEGORY; config_data->i_type = TYPE_SUBCATEGORY;
config_data->i_object_id = p_item->i_value; config_data->i_object_id = p_item->value.i;
/* WXMSW doesn't know image -1 ... FIXME */ /* WXMSW doesn't know image -1 ... FIXME */
#ifdef __WXMSW__ #ifdef __WXMSW__
switch( p_item->i_value / 100 ) switch( p_item->value.i / 100 )
{ {
case CAT_AUDIO: case CAT_AUDIO:
i_image = 0; break; i_image = 0; break;
...@@ -488,7 +489,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -488,7 +489,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
break; break;
} }
} }
while( p_item->i_type != CONFIG_HINT_END && p_item++ ); while( p_item < p_end && p_item++ );
} }
...@@ -515,18 +516,18 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -515,18 +516,18 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
// p_item = ((module_t *)p_module->p_parent)->p_config; // p_item = ((module_t *)p_module->p_parent)->p_config;
else else
p_item = p_module->p_config; p_item = p_module->p_config;
p_end = p_item + p_module->confsize;
if( !p_item ) continue; if( !p_item ) continue;
do do
{ {
if( p_item->i_type == CONFIG_CATEGORY ) if( p_item->i_type == CONFIG_CATEGORY )
{ {
i_category = p_item->i_value; i_category = p_item->value.i;
} }
else if( p_item->i_type == CONFIG_SUBCATEGORY ) else if( p_item->i_type == CONFIG_SUBCATEGORY )
{ {
i_subcategory = p_item->i_value; i_subcategory = p_item->value.i;
} }
if( p_item->i_type & CONFIG_ITEM ) if( p_item->i_type & CONFIG_ITEM )
i_options ++; i_options ++;
...@@ -535,7 +536,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -535,7 +536,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
break; break;
} }
} }
while( p_item->i_type != CONFIG_HINT_END && p_item++ ); while( p_item < p_end && p_item++ );
if( !i_options ) continue; if( !i_options ) continue;
...@@ -857,7 +858,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -857,7 +858,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
ConfigTreeData *config_data ) ConfigTreeData *config_data )
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize ) : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize )
{ {
module_config_t *p_item; module_config_t *p_item, *p_end;
vlc_list_t *p_list = NULL;; vlc_list_t *p_list = NULL;;
wxStaticText *label; wxStaticText *label;
...@@ -940,6 +941,8 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -940,6 +941,8 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
else else
p_item = p_module->p_config; p_item = p_module->p_config;
p_end = p_item + p_module->confsize;
/* Find the category if it has been specified */ /* Find the category if it has been specified */
if( config_data->i_type == TYPE_SUBCATEGORY || if( config_data->i_type == TYPE_SUBCATEGORY ||
config_data->i_type == TYPE_CATSUBCAT ) config_data->i_type == TYPE_CATSUBCAT )
...@@ -948,13 +951,13 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -948,13 +951,13 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
{ {
if( p_item->i_type == CONFIG_SUBCATEGORY && if( p_item->i_type == CONFIG_SUBCATEGORY &&
( config_data->i_type == TYPE_SUBCATEGORY && ( config_data->i_type == TYPE_SUBCATEGORY &&
p_item->i_value == config_data->i_object_id ) || p_item->value.i == config_data->i_object_id ) ||
( config_data->i_type == TYPE_CATSUBCAT && ( config_data->i_type == TYPE_CATSUBCAT &&
p_item->i_value == config_data->i_subcat_id ) ) p_item->value.i == config_data->i_subcat_id ) )
{ {
break; break;
} }
if( p_item->i_type == CONFIG_HINT_END ) if( p_item < p_end )
break; break;
} while( p_item++ ); } while( p_item++ );
} }
...@@ -992,9 +995,9 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -992,9 +995,9 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
{ {
/* If a category has been specified, check we finished the job */ /* If a category has been specified, check we finished the job */
if( ( ( config_data->i_type == TYPE_SUBCATEGORY && if( ( ( config_data->i_type == TYPE_SUBCATEGORY &&
p_item->i_value != config_data->i_object_id ) || p_item->value.i != config_data->i_object_id ) ||
( config_data->i_type == TYPE_CATSUBCAT && ( config_data->i_type == TYPE_CATSUBCAT &&
p_item->i_value != config_data->i_subcat_id ) ) && p_item->value.i != config_data->i_subcat_id ) ) &&
(p_item->i_type == CONFIG_CATEGORY || (p_item->i_type == CONFIG_CATEGORY ||
p_item->i_type == CONFIG_SUBCATEGORY ) ) p_item->i_type == CONFIG_SUBCATEGORY ) )
break; break;
...@@ -1013,11 +1016,11 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -1013,11 +1016,11 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
config_sizer->Add( control, 0, wxEXPAND | wxALL, 2 ); config_sizer->Add( control, 0, wxEXPAND | wxALL, 2 );
} }
while( !( p_item->i_type == CONFIG_HINT_END || while( !( p_item < p_end )||
( ( config_data->i_type == TYPE_SUBCATEGORY || ( ( config_data->i_type == TYPE_SUBCATEGORY ||
config_data->i_type == TYPE_CATSUBCAT ) && config_data->i_type == TYPE_CATSUBCAT ) &&
( p_item->i_type == CONFIG_CATEGORY || ( p_item->i_type == CONFIG_CATEGORY ||
p_item->i_type == CONFIG_SUBCATEGORY ) ) ) && p_item++ ); p_item->i_type == CONFIG_SUBCATEGORY ) ) && p_item++ );
config_sizer->Layout(); config_sizer->Layout();
......
...@@ -99,7 +99,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -99,7 +99,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
wxHORIZONTAL ); wxHORIZONTAL );
wxStaticText *label = wxStaticText *label =
new wxStaticText(panel, -1, wxU(p_item->psz_text)); new wxStaticText(panel, -1, wxU(p_item->psz_text));
encoding_combo = new wxComboBox( panel, -1, wxU(p_item->psz_value), encoding_combo = new wxComboBox( panel, -1, wxU(p_item->value.psz),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY ); 0, NULL, wxCB_READONLY );
...@@ -108,13 +108,13 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -108,13 +108,13 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
i_index++ ) i_index++ )
{ {
encoding_combo->Append( wxU(p_item->ppsz_list[i_index]) ); encoding_combo->Append( wxU(p_item->ppsz_list[i_index]) );
if( p_item->psz_value && !strcmp( p_item->psz_value, if( p_item->value.psz && !strcmp( p_item->value.psz,
p_item->ppsz_list[i_index] ) ) p_item->ppsz_list[i_index] ) )
encoding_combo->SetSelection( i_index ); encoding_combo->SetSelection( i_index );
} }
if( p_item->psz_value ) if( p_item->value.psz )
encoding_combo->SetValue( wxU(p_item->psz_value) ); encoding_combo->SetValue( wxU(p_item->value.psz) );
encoding_combo->SetToolTip( wxU(p_item->psz_longtext) ); encoding_combo->SetToolTip( wxU(p_item->psz_longtext) );
enc_sizer->Add( label, 0, wxALL | wxALIGN_CENTER, 5 ); enc_sizer->Add( label, 0, wxALL | wxALIGN_CENTER, 5 );
...@@ -150,7 +150,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -150,7 +150,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
{ {
size_combo->Append( wxU(p_item->ppsz_list_text[i_index]), size_combo->Append( wxU(p_item->ppsz_list_text[i_index]),
(void *)p_item->pi_list[i_index] ); (void *)p_item->pi_list[i_index] );
if( p_item->i_value == p_item->pi_list[i_index] ) if( p_item->value.i == p_item->pi_list[i_index] )
{ {
size_combo->SetSelection( i_index ); size_combo->SetSelection( i_index );
size_combo->SetValue(wxU(p_item->ppsz_list_text[i_index])); size_combo->SetValue(wxU(p_item->ppsz_list_text[i_index]));
...@@ -180,7 +180,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -180,7 +180,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
{ {
align_combo->Append( wxU(p_item->ppsz_list_text[i_index]), align_combo->Append( wxU(p_item->ppsz_list_text[i_index]),
(void *)p_item->pi_list[i_index] ); (void *)p_item->pi_list[i_index] );
if( p_item->i_value == p_item->pi_list[i_index] ) if( p_item->value.i == p_item->pi_list[i_index] )
{ {
align_combo->SetSelection( i_index ); align_combo->SetSelection( i_index );
align_combo->SetValue(wxU(p_item->ppsz_list_text[i_index])); align_combo->SetValue(wxU(p_item->ppsz_list_text[i_index]));
......
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