- /* put each config option in a separate panel so we can hide advanced
- * options easily */
- wxPanel *panel = new wxPanel( config_window, -1, wxDefaultPosition,
- wxDefaultSize );
- wxBoxSizer *panel_sizer = new wxBoxSizer( wxHORIZONTAL );
- ConfigData *config_data =
- new ConfigData( panel, p_item->i_type,
- p_item->b_advanced, p_item->psz_name );
-
- switch( p_item->i_type )
- {
- case CONFIG_ITEM_MODULE:
- label = new wxStaticText(panel, -1, wxU(p_item->psz_text));
- combo = new wxComboBox( panel, -1, wxU(p_item->psz_value),
- wxDefaultPosition, wxDefaultSize,
- 0, NULL, wxCB_READONLY | wxCB_SORT );
-
- /* build a list of available modules */
- p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
- combo->Append( wxU(_("Default")), (void *)NULL );
- combo->SetSelection( 0 );
- for( int i_index = 0; i_index < p_list->i_count; i_index++ )
- {
- p_parser = (module_t *)p_list->p_values[i_index].p_object ;
-
- if( !strcmp( p_parser->psz_capability,
- p_item->psz_type ) )
- {
- combo->Append( wxU(p_parser->psz_longname),
- p_parser->psz_object_name );
- if( p_item->psz_value &&
- !strcmp(p_item->psz_value, p_parser->psz_object_name) )
- combo->SetValue( wxU(p_parser->psz_longname) );
- }
- }
- vlc_list_release( p_list );
-
- combo->SetToolTip( wxU(p_item->psz_longtext) );
- config_data->control.combobox = combo;
- panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
- panel_sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
- break;
-
- case CONFIG_ITEM_STRING:
- case CONFIG_ITEM_FILE:
- case CONFIG_ITEM_DIRECTORY:
- label = new wxStaticText(panel, -1, wxU(p_item->psz_text));
- panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
-
- if( !p_item->ppsz_list )
- {
- textctrl = new wxTextCtrl( panel, -1, wxU(p_item->psz_value),
- wxDefaultPosition, wxDefaultSize,
- wxTE_PROCESS_ENTER);
- textctrl->SetToolTip( wxU(p_item->psz_longtext) );
- config_data->control.textctrl = textctrl;
- panel_sizer->Add( textctrl, 1, wxALL, 5 );
- }
- else
- {
- combo = new wxComboBox( panel, -1, wxU(p_item->psz_value),
+ /* Enumerate config options and add corresponding config boxes
+ * (submodules don't have config options, they are stored in the
+ * parent module) */
+ if( p_module->b_submodule )
+ p_item = ((module_t *)p_module->p_parent)->p_config;
+ else
+ p_item = p_module->p_config;
+
+ /* Find the category if it has been specified */
+ if( psz_section && p_item->i_type == CONFIG_HINT_CATEGORY )
+ {
+ while( !p_item->i_type == CONFIG_HINT_CATEGORY ||
+ strcmp( psz_section, p_item->psz_text ) )
+ {
+ if( p_item->i_type == CONFIG_HINT_END )
+ break;
+ p_item++;
+ }
+ }
+ /* Add a head title to the panel */
+ wxStaticBox *static_box = new wxStaticBox( this, -1, wxT( "" ) );
+ wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( static_box,
+ wxVERTICAL );
+
+ wxStaticBox *help_box = NULL;
+ wxStaticBoxSizer *help_sizer = NULL;
+
+ label = new wxStaticText( this, -1,
+ wxU(_(psz_section ? p_item->psz_text :
+ p_module->psz_longname )));
+
+ box_sizer->Add( label, 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
+
+ sizer->Add( box_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT , 5 );
+
+ if( psz_help && psz_help[1] )
+ /* Check that we have at least something */
+ {
+ help_box = new wxStaticBox( this, -1, wxT( "" ) );
+ help_sizer = new wxStaticBoxSizer( help_box,
+ wxHORIZONTAL ) ;
+ help = new wxStaticText( this, -1,
+ wxT(_( psz_help) ),
+ wxDefaultPosition, wxDefaultSize,
+ wxST_NO_AUTORESIZE | wxALIGN_LEFT,
+ wxT("") );
+
+ help_sizer->Add( help, 1, wxALL | wxEXPAND , 5 );
+ sizer->Add( help_sizer ,0 ,wxEXPAND | wxALL, 5 );
+ }
+
+ /* Now put all the config options into a scrolled window */
+ config_sizer = new wxBoxSizer( wxVERTICAL );
+ config_window = new wxScrolledWindow( this, -1, wxDefaultPosition,
+ wxDefaultSize, wxSTATIC_BORDER | wxHSCROLL | wxVSCROLL );
+ config_window->SetAutoLayout( TRUE );
+ config_window->SetScrollRate( 5, 5 );
+
+ if( p_item ) do
+ {
+ /* If a category has been specified, check we finished the job */
+ if( psz_section && p_item->i_type == CONFIG_HINT_CATEGORY &&
+ strcmp( psz_section, p_item->psz_text ) )
+ break;
+
+ /* put each config option in a separate panel so we can hide advanced
+ * options easily */
+ wxPanel *panel = new wxPanel( config_window, -1, wxDefaultPosition,
+ wxDefaultSize );
+ wxBoxSizer *panel_sizer = new wxBoxSizer( wxHORIZONTAL );
+ ConfigData *config_data =
+ new ConfigData( panel, p_item->i_type,
+ p_item->b_advanced, p_item->psz_name );
+
+ switch( p_item->i_type )
+ {
+ case CONFIG_ITEM_MODULE:
+ label = new wxStaticText(panel, -1, wxU(p_item->psz_text));
+ combo = new wxComboBox( panel, -1, wxU(p_item->psz_value),
+ wxDefaultPosition, wxDefaultSize,
+ 0, NULL, wxCB_READONLY | wxCB_SORT );
+
+ /* build a list of available modules */
+ p_list = vlc_list_find( p_intf,
+ VLC_OBJECT_MODULE, FIND_ANYWHERE );
+ combo->Append( wxU(_("Default")), (void *)NULL );
+ combo->SetSelection( 0 );
+ for( int i_index = 0; i_index < p_list->i_count; i_index++ )
+ {
+ p_parser = (module_t *)p_list->p_values[i_index].p_object ;
+
+ if( !strcmp( p_parser->psz_capability,
+ p_item->psz_type ) )
+ {
+ combo->Append( wxU(p_parser->psz_longname),
+ p_parser->psz_object_name );
+ if( p_item->psz_value &&
+ !strcmp(p_item->psz_value,
+ p_parser->psz_object_name) )
+ combo->SetValue( wxU(p_parser->psz_longname) );
+ }
+ }
+ vlc_list_release( p_list );
+
+ combo->SetToolTip( wxU(p_item->psz_longtext) );
+ config_data->control.combobox = combo;
+ panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL
+ | wxALL, 5 );
+ panel_sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL
+ | wxALL, 5 );
+ break;
+
+ case CONFIG_ITEM_STRING:
+ case CONFIG_ITEM_FILE:
+ case CONFIG_ITEM_DIRECTORY:
+ label = new wxStaticText(panel, -1, wxU(p_item->psz_text));
+ panel_sizer->Add( label, 0, wxALIGN_CENTER_VERTICAL
+ | wxALL, 5 );
+
+ if( !p_item->ppsz_list )
+ {
+ textctrl = new wxTextCtrl( panel, -1,
+ wxU(p_item->psz_value),
+ wxDefaultPosition, wxDefaultSize,
+ wxTE_PROCESS_ENTER);
+ textctrl->SetToolTip( wxU(p_item->psz_longtext) );
+ config_data->control.textctrl = textctrl;
+ panel_sizer->Add( textctrl, 1, wxALL, 5 );
+ }
+ else
+ {
+ combo = new wxComboBox( panel, -1, wxU(p_item->psz_value),