Commit 4ec518d3 authored by Christophe Mutricy's avatar Christophe Mutricy

Partial fix of the wx prefs. The modules settings are shown but not the libvlc...

Partial fix of the wx prefs. The modules settings are shown but not the libvlc ones. refs #918. (yes there is lots of debugs left)
parent 204952ec
...@@ -367,11 +367,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -367,11 +367,10 @@ 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_end = p_item + p_module->confsize;
if( p_item ) do for (size_t i = 0; i < p_module->confsize; i++)
{ {
module_config_t *p_item = p_module->p_config + i;
ConfigTreeData *config_data; ConfigTreeData *config_data;
switch( p_item->i_type ) switch( p_item->i_type )
{ {
...@@ -434,6 +433,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -434,6 +433,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
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->value.i ) ); p_item->value.i ) );
msg_Err(p_intf, "found a subcategory %s", cd->psz_name );
if( cd->psz_help ) free( cd->psz_help ); if( cd->psz_help ) free( cd->psz_help );
char *psz_help = config_CategoryHelpGet( p_item->value.i ); char *psz_help = config_CategoryHelpGet( p_item->value.i );
if( psz_help ) if( psz_help )
...@@ -489,7 +489,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -489,7 +489,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
break; break;
} }
} }
while( p_item < p_end && p_item++ );
} }
...@@ -508,19 +507,18 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -508,19 +507,18 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
/* Exclude the main module */ /* Exclude the main module */
if( !strcmp( p_module->psz_object_name, "main" ) ) if( !strcmp( p_module->psz_object_name, "main" ) )
continue; continue;
msg_Err(p_intf, "processing %s", p_module->psz_object_name);
/* Exclude empty plugins (submodules don't have config options, they /* Exclude empty plugins (submodules don't have config options, they
* are stored in the parent module) */ * are stored in the parent module) */
if( p_module->b_submodule ) if( p_module->b_submodule )
continue; continue;
// 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; //msg_Err(p_intf,"1p_item=0x%x, p_end=0x%x, i_optoin=%i", p_item, p_end, i_options);
p_end = p_item + p_module->confsize; for (size_t i = 0; i < p_module->confsize; i++)
if( !p_item ) continue;
do
{ {
module_config_t *p_item = p_module->p_config + i;
msg_Err(p_intf,"i_type=0x%x, value=%i", p_item->i_type, p_item->value.i);
if( p_item->i_type == CONFIG_CATEGORY ) if( p_item->i_type == CONFIG_CATEGORY )
{ {
i_category = p_item->value.i; i_category = p_item->value.i;
...@@ -533,10 +531,11 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -533,10 +531,11 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
i_options ++; i_options ++;
if( i_options > 0 && i_category >= 0 && i_subcategory >= 0 ) if( i_options > 0 && i_category >= 0 && i_subcategory >= 0 )
{ {
msg_Err(p_intf,"break");
break; break;
} }
} }
while( p_item < p_end && p_item++ ); msg_Err(p_intf,"p_item=0x%x, p_end=0x%x, i_optoin=%i, i_category=%i", p_item, p_end, i_options, i_category);
if( !i_options ) continue; if( !i_options ) continue;
...@@ -549,6 +548,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -549,6 +548,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
{ {
ConfigTreeData *config_data = ConfigTreeData *config_data =
(ConfigTreeData *)GetItemData( category_item ); (ConfigTreeData *)GetItemData( category_item );
// msg_Err(p_intf,"%i, %i", config_data->i_object_id, i_category);
if( config_data->i_object_id == i_category ) if( config_data->i_object_id == i_category )
{ {
b_found = VLC_TRUE; b_found = VLC_TRUE;
...@@ -556,7 +556,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -556,7 +556,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
} }
category_item = GetNextChild( root_item, cookie ); category_item = GetNextChild( root_item, cookie );
} }
msg_Err(p_intf, "found=%i", b_found);
if( !b_found ) continue; if( !b_found ) continue;
/* Find subcategory item */ /* Find subcategory item */
...@@ -610,6 +610,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -610,6 +610,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
#else #else
i_image = -1; i_image = -1;
#endif #endif
msg_Err(p_intf, "adding %s with image %i ", p_module->psz_shortname ? p_module->psz_shortname : p_module->psz_object_name, i_image);
AppendItem( subcategory_item, wxU( p_module->psz_shortname ? AppendItem( subcategory_item, wxU( p_module->psz_shortname ?
p_module->psz_shortname : p_module->psz_object_name ) p_module->psz_shortname : p_module->psz_object_name )
, i_image, -1, , i_image, -1,
...@@ -1016,11 +1017,10 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -1016,11 +1017,10 @@ 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 < p_end )|| while( !( ( 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 < p_end) );
config_sizer->Layout(); config_sizer->Layout();
......
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