Commit a8855655 authored by Clément Stenac's avatar Clément Stenac

* modules/gui/wxwindows/preferences.cpp:

	- Created the "General Settings" section
	- Added help strings in the two main sections,
		in the libvlc categories,
		and in the module capabilities

* modules/gui/wxwindows/playlist.cpp & wxwindows.h
	-Implemented random, loop and repeat using variables
	-The eye candy of the dialog box is not very good
	 but I have no idea how to improve it.
	-Focus on the currently playing item

* src/libvlc.h:
	- Added help strings for the libvlc categories
	- Changed a few "advanced" flag

* include/vlc_help.h:
	- Help strings for the two main sections
	- Help string for the module capabilities (both by Anil)

* po/*: updated potfiles with the new strings
parent 03f4adcd
/*****************************************************************************
* vlc_help.h: Help strings
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vlc_help.h,v 1.1 2003/09/22 14:40:10 zorglub Exp $
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Anil Daoud <anil@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _VLC_HELP_H
#define _VLC_HELP_H 1
/*
* First, we need help strings for the General Settings and for the
* Plugins screen
*/
#define GENERAL_HELP N_( \
"VLC Preferences. \nConfigure some global options in General Settings" \
"\n and configure each VLC plugin in the Plugins section.\n" \
"Click on 'Advanced Options' to see every options." )
#define PLUGIN_HELP N_( \
"In this tree, you can set options for every plugin used by VLC.\n" \
"Plugins are sorted by type.\nHave fun tuning VLC !" )
/*
* Then, help for each module capabilities.
*/
#define ACCESS_HELP N_( \
"Access modules settings\n" \
"Settings related to the various access methods used by VLC\n" \
"Common settings you may want to alter are http proxy or\n" \
"caching settings" )
#define AUDIO_FILTER_HELP N_("Audio filters settings\n" \
"Audio filters can be set in the Audio section, and configured\n" \
"here.")
#define AOUT_HELP N_("Audio output modules settings")
#define CHROMA_HELP N_("Chroma modules settings")
#define DECODER_HELP N_( \
"Decoder modules settings\n" \
"In the Subsdec section you may want to set your preferred subtitles\n" \
"text encoding\n")
#define DEMUX_HELP N_( \
"Demuxer settings")
#define INTERFACE_HELP N_( \
"Interface plugins settings\n" \
"Interface plugins can be enabled in the Interface section and\n" \
"configured here.")
#define SOUT_HELP N_( \
"Stream output access modules settings\n" \
"In this section you can set the caching value for the UDP stream\n" \
"output access module")
#define SUBTITLE_DEMUX_HELP N_( \
"Subtitle demuxer settings\n" \
"In this section you can force the behaviour of the subtitle demuxer,\n" \
"for example by setting the subtitles type or file name.")
#define TEXT_HELP N_( \
"Text renderer settings\n" \
"Use these settings to choose the font you want VLC to use for text\n" \
"rendering (to display subtitles for example)")
#define VOUT_HELP N_( \
"Video output modules settings\n" \
"Choose your preferred video output in the Video section, \n" \
"and configure it here." )
#define VIDEO_FILTER_HELP N_( \
"Video filters settings\n" \
"Video filters can be enabled in the Video section and configured" \
"here. Configure the \"adjust\" filter to modify \n" \
"contrast/hue/saturation settings.")
/*
* A little help for modules with unknown capabilities
*/
#define UNKNOWN_HELP N_("No help available")
#endif /* VLC_HELP_H */
......@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: playlist.cpp,v 1.20 2003/09/21 18:07:51 gbazin Exp $
* $Id: playlist.cpp,v 1.21 2003/09/22 14:40:10 zorglub Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
......@@ -59,6 +59,7 @@ enum
DeleteSelection_Event,
Random_Event,
Loop_Event,
Repeat_Event,
SelectAll_Event,
SearchText_Event,
......@@ -81,6 +82,7 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection)
EVT_MENU(SelectAll_Event, Playlist::OnSelectAll)
EVT_CHECKBOX(Random_Event, Playlist::OnRandom)
EVT_CHECKBOX(Repeat_Event, Playlist::OnRepeat)
EVT_CHECKBOX(Loop_Event, Playlist::OnLoop)
/* Listview events */
......@@ -107,11 +109,19 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
{
/* Initializations */
p_intf = _p_intf;
vlc_value_t val;
i_update_counter = 0;
b_need_update = VLC_FALSE;
vlc_mutex_init( p_intf, &lock );
SetIcon( *p_intf->p_sys->p_icon );
var_Create( p_intf, "random", VLC_VAR_BOOL );
var_Change( p_intf, "random", VLC_VAR_INHERITVALUE, & val, NULL );
var_Create( p_intf, "loop", VLC_VAR_BOOL );
var_Create( p_intf, "loop", VLC_VAR_BOOL );
var_Change( p_intf, "repeat", VLC_VAR_INHERITVALUE, & val, NULL );
var_Change( p_intf, "repeat", VLC_VAR_INHERITVALUE, & val, NULL );
/* Create our "Manage" menu */
wxMenu *manage_menu = new wxMenu;
manage_menu->Append( AddFile_Event, wxU(_("&Simple Add...")) );
......@@ -147,29 +157,45 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
* themselves to the size of a listview, and with a wxDefaultSize the
* playlist window is ridiculously small */
listview = new wxListView( playlist_panel, ListView_Event,
wxDefaultPosition, wxSize( 355, 300 ),
wxDefaultPosition, wxSize( 305, 300 ),
wxLC_REPORT | wxSUNKEN_BORDER );
listview->InsertColumn( 0, wxU(_("Url")) );
listview->InsertColumn( 1, wxU(_("Duration")) );
listview->SetColumnWidth( 0, 250 );
listview->SetColumnWidth( 1, 100 );
#if 0
listview->InsertColumn( 1, wxU(_("Duration")) );
#endif
listview->SetColumnWidth( 0, 300 );
#if 0
listview->SetColumnWidth( 1, 100 );
#endif
/* Create the Random checkbox */
wxCheckBox *random_checkbox =
new wxCheckBox( playlist_panel, Random_Event, wxU(_("Random")) );
int b_random = config_GetInt( p_intf, "random") ;
random_checkbox->SetValue( b_random );
var_Get( p_intf, "random", &val);
vlc_bool_t b_random = val.b_bool;
random_checkbox->SetValue( b_random == VLC_FALSE ? 0 : 1);
/* Create the Loop Checkbox */
wxCheckBox *loop_checkbox =
new wxCheckBox( playlist_panel, Loop_Event, wxU(_("Loop")) );
int b_loop = config_GetInt( p_intf, "loop") ;
var_Get( p_intf, "loop", &val );
int b_loop = val.b_bool ;
loop_checkbox->SetValue( b_loop );
/* Create the Repeat one checkbox */
wxCheckBox *repeat_checkbox =
new wxCheckBox( playlist_panel, Repeat_Event, wxU(_("Repeat one")) );
var_Get( p_intf, "repeat", &val );
int b_repeat = val.b_bool ;
repeat_checkbox->SetValue( b_repeat );
/* Create the Search Textbox */
search_text =
new wxTextCtrl( playlist_panel, SearchText_Event, wxT(""),
wxDefaultPosition, wxSize( 100, -1),
wxDefaultPosition, wxSize( 140, -1),
wxTE_PROCESS_ENTER);
/* Create the search button */
......@@ -178,20 +204,34 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
/* Place everything in sizers */
wxBoxSizer *search_sizer = new wxBoxSizer( wxHORIZONTAL );
search_sizer->Add( search_text, 0, wxEXPAND|wxALL, 5);
search_sizer->Add( search_button, 0, wxEXPAND|wxALL, 5);
search_sizer->Add( random_checkbox, 0,
wxEXPAND|wxALIGN_RIGHT|wxALL, 5);
search_sizer->Add( loop_checkbox, 0,
wxEXPAND|wxALIGN_RIGHT|wxALL, 5);
wxBoxSizer *button_sizer = new wxBoxSizer( wxVERTICAL );
button_sizer->Add( random_checkbox, 0,
wxEXPAND|wxALIGN_RIGHT, 5);
button_sizer->Add( loop_checkbox, 0,
wxEXPAND|wxALIGN_RIGHT, 5);
button_sizer->Add( repeat_checkbox, 0,
wxEXPAND|wxALIGN_RIGHT, 5);
button_sizer->Layout();
wxBoxSizer *search_sizer = new wxBoxSizer( wxVERTICAL );
search_sizer->Add( search_text, 0, wxALL|wxALIGN_CENTER, 5);
search_sizer->Add( search_button, 0, wxALL|wxALIGN_CENTER, 5);
search_sizer->Layout();
wxBoxSizer *bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
bottom_sizer->Add( search_sizer , 0, wxALL|wxALIGN_CENTER, 5 );
bottom_sizer->Add( button_sizer , 0, wxALL|wxALIGN_CENTER, 5 );
bottom_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( search_sizer, 0 , wxALIGN_CENTRE);
panel_sizer->Add( bottom_sizer, 0 , wxALIGN_CENTRE);
panel_sizer->Layout();
playlist_panel->SetSizerAndFit( panel_sizer );
......@@ -254,7 +294,10 @@ void Playlist::Rebuild()
wxString filename = wxU(p_playlist->pp_items[i]->psz_name);
listview->InsertItem( i, filename );
/* FIXME: we should try to find the actual duration... */
listview->SetItem( i, 1, wxU(_("no info")) );
/* While we don't use it, hide it, it's ugly */
#if 0
listview->SetItem( i, 1, wxU(_("no info")) );
#endif
}
vlc_mutex_unlock( &p_playlist->object_lock );
......@@ -264,6 +307,9 @@ void Playlist::Rebuild()
listitem.SetTextColour( *wxRED );
listview->SetItem( listitem );
// listview->Select( p_playlist->i_index, TRUE );
listview->Focus( p_playlist->i_index );
vlc_object_release( p_playlist );
}
......@@ -518,14 +564,49 @@ void Playlist::OnDeleteSelection( wxCommandEvent& WXUNUSED(event) )
void Playlist::OnRandom( wxCommandEvent& event )
{
config_PutInt( p_intf , "random" ,
event.IsChecked() ? VLC_TRUE : VLC_FALSE );
vlc_value_t val;
val.b_bool = event.IsChecked();
// ? VLC_TRUE : VLC_FALSE ;
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
var_Set( p_playlist , "random", val);
vlc_object_release( p_playlist );
}
void Playlist::OnLoop ( wxCommandEvent& event )
{
config_PutInt( p_intf, "loop",
event.IsChecked() ? VLC_TRUE : VLC_FALSE );
vlc_value_t val;
val.b_bool = event.IsChecked();
// ? VLC_TRUE : VLC_FALSE ;
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
var_Set( p_playlist , "loop", val);
vlc_object_release( p_playlist );
}
void Playlist::OnRepeat ( wxCommandEvent& event )
{
vlc_value_t val;
val.b_bool = event.IsChecked();
// ? VLC_TRUE : VLC_FALSE ;
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
var_Set( p_playlist , "repeat", val);
vlc_object_release( p_playlist );
}
void Playlist::OnSelectAll( wxCommandEvent& WXUNUSED(event) )
......
......@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.27 2003/09/21 17:52:43 gbazin Exp $
* $Id: preferences.cpp,v 1.28 2003/09/22 14:40:10 zorglub Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -32,6 +32,8 @@
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc_help.h>
#include "wxwindows.h"
#include <wx/notebook.h>
#include <wx/textctrl.h>
......@@ -46,6 +48,10 @@
# define wxRB_SINGLE 0
#endif
#define GENERAL_ID 1242
#define PLUGIN_ID 1243
#define CAPABILITY_ID 1244
/*****************************************************************************
* Classes declarations.
*****************************************************************************/
......@@ -78,6 +84,7 @@ private:
vlc_bool_t b_advanced;
wxTreeItemId root_item;
wxTreeItemId general_item;
wxTreeItemId plugins_item;
};
......@@ -114,7 +121,7 @@ public:
PrefsPanel() { }
PrefsPanel( wxWindow *parent, intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog, int i_object_id, char * );
PrefsDialog *_p_prefs_dialog, int i_object_id, char *, char * );
virtual ~PrefsPanel() {}
void ApplyChanges();
......@@ -141,6 +148,8 @@ public:
vlc_bool_t b_submodule;
char *psz_help;
PrefsPanel *panel;
wxBoxSizer *sizer;
int i_object_id;
......@@ -211,7 +220,7 @@ END_EVENT_TABLE()
*****************************************************************************/
PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, wxWindow *p_parent)
: wxFrame( p_parent, -1, wxU(_("Preferences")), wxDefaultPosition,
wxSize(650,450), wxDEFAULT_FRAME_STYLE )
wxSize(700,450), wxDEFAULT_FRAME_STYLE )
{
/* Initializations */
p_intf = _p_intf;
......@@ -329,6 +338,42 @@ void PrefsDialog::OnAdvanced( wxCommandEvent& event )
prefs_tree->AddPendingEvent( newevent );
}
/*****************************************************************************
* GetCapabilityHelp: Display the help for one capability.
*****************************************************************************/
static char * GetCapabilityHelp( char *psz_capability)
{
if( psz_capability == NULL)
return NULL;
if( !strcasecmp(psz_capability,"access") )
return strdup(ACCESS_HELP);
if( !strcasecmp(psz_capability,"audio filter") )
return strdup(AUDIO_FILTER_HELP);
if( !strcasecmp(psz_capability,"audio output") )
return strdup(AOUT_HELP);
if( !strcasecmp(psz_capability,"chroma") )
return strdup(CHROMA_HELP);
if( !strcasecmp(psz_capability,"decoder") )
return strdup(DECODER_HELP);
if( !strcasecmp(psz_capability,"demux") )
return strdup(DEMUX_HELP);
if( !strcasecmp(psz_capability,"interface") )
return strdup(INTERFACE_HELP);
if( !strcasecmp(psz_capability,"sout access") )
return strdup(SOUT_HELP);
if( !strcasecmp(psz_capability,"subtitle demux") )
return strdup(SUBTITLE_DEMUX_HELP);
if( !strcasecmp(psz_capability,"text renderer") )
return strdup(TEXT_HELP);
if( !strcasecmp(psz_capability,"video output") )
return strdup(VOUT_HELP);
if( !strcasecmp(psz_capability,"video filter") )
return strdup(VIDEO_FILTER_HELP);
return strdup(UNKNOWN_HELP);
}
/*****************************************************************************
* PrefsTreeCtrl class definition.
*****************************************************************************/
......@@ -361,6 +406,14 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
/*
* Build a tree of the main options
*/
ConfigTreeData *config_data = new ConfigTreeData;
config_data->psz_section = NULL;
config_data->i_object_id = GENERAL_ID;
config_data->psz_help = strdup( GENERAL_HELP );
printf("dans pouet: %i\n",config_data->i_object_id);
general_item = AppendItem( root_item, wxU(_("General Settings")),
-1, -1, config_data );
for( i_index = 0; i_index < p_list->i_count; i_index++ )
{
p_module = (module_t *)p_list->p_values[i_index].p_object;
......@@ -382,24 +435,37 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
case CONFIG_HINT_CATEGORY:
ConfigTreeData *config_data = new ConfigTreeData;
config_data->psz_section = strdup(p_item->psz_text);
if( p_item->psz_longtext )
{
config_data->psz_help = strdup( p_item->psz_longtext);
}
else
{
config_data->psz_help = NULL;
}
config_data->i_object_id = p_module->i_object_id;
/* Add the category to the tree */
AppendItem( root_item, wxU(p_item->psz_text),
AppendItem( general_item, wxU(p_item->psz_text),
-1, -1, config_data );
break;
}
}
while( p_item->i_type != CONFIG_HINT_END && p_item++ );
SortChildren( root_item );
SortChildren( general_item );
}
/*
* Build a tree of all the plugins
*/
plugins_item = AppendItem( root_item, wxU(_("Plugins")) );
config_data = new ConfigTreeData;
config_data->psz_section = NULL;
config_data->i_object_id = PLUGIN_ID;
config_data->psz_help = strdup( PLUGIN_HELP );
plugins_item = AppendItem( root_item, wxU(_("Plugins")),
-1,-1,config_data );
for( i_index = 0; i_index < p_list->i_count; i_index++ )
{
......@@ -444,8 +510,14 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
p_module->psz_capability && *p_module->psz_capability )
{
/* We didn't find it, add it */
ConfigTreeData *config_data = new ConfigTreeData;
config_data->psz_section = NULL;
config_data->psz_help =
GetCapabilityHelp( p_module->psz_capability );
config_data->i_object_id = CAPABILITY_ID;
capability_item = AppendItem( plugins_item,
wxU(p_module->psz_capability) );
wxU(p_module->psz_capability),
-1,-1,config_data );
}
/* Add the plugin to the tree */
......@@ -454,6 +526,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
config_data->i_object_id = p_module->b_submodule ?
((module_t *)p_module->p_parent)->i_object_id :
p_module->i_object_id;
config_data->psz_help = strdup( "" );
AppendItem( capability_item, wxU(p_module->psz_object_name), -1, -1,
config_data );
}
......@@ -653,7 +726,8 @@ void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event )
config_data->panel =
new PrefsPanel( p_parent, p_intf, p_prefs_dialog,
config_data->i_object_id,
config_data->psz_section );
config_data->psz_section,
config_data->psz_help);
config_data->panel->SwitchAdvanced( b_advanced );
}
else
......@@ -691,7 +765,7 @@ void PrefsTreeCtrl::OnAdvanced( wxCommandEvent& event )
*****************************************************************************/
PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog,
int i_object_id, char *psz_section )
int i_object_id, char *psz_section, char*psz_help )
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize )
{
module_config_t *p_item;
......@@ -699,6 +773,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
module_t *p_parser;
wxStaticText *label;
wxStaticText *help;
wxComboBox *combo;
wxSpinCtrl *spin;
wxCheckBox *checkbox;
......@@ -706,6 +781,9 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
wxButton *button;
wxArrayString array;
vlc_bool_t b_has_advanced = VLC_FALSE;
module_t *p_module = NULL;
/* Initializations */
p_intf = _p_intf;
p_prefs_dialog =_p_prefs_dialog,
......@@ -715,238 +793,297 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
/* Get a pointer to the module */
module_t *p_module = (module_t *)vlc_object_get( p_intf, i_object_id );
if( p_module->i_object_type != VLC_OBJECT_MODULE )
if( i_object_id == PLUGIN_ID || i_object_id == GENERAL_ID ||
i_object_id == CAPABILITY_ID )
{
/* 0OOoo something went really bad */
return;
}
wxStaticBox *static_box = new wxStaticBox( this, -1, wxT( "" ) );
wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( static_box,
wxVERTICAL );
label = new wxStaticText( this, -1,
wxU(_( psz_help) ) );
/* 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;
box_sizer->Add( label, 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
/* Find the category if it has been specified */
if( psz_section && p_item->i_type == CONFIG_HINT_CATEGORY )
sizer->Add( box_sizer, 0, wxEXPAND | wxALL , 5 );
}
else
{
while( !p_item->i_type == CONFIG_HINT_CATEGORY ||
strcmp( psz_section, p_item->psz_text ) )
/* Get a pointer to the module */
p_module = (module_t *)vlc_object_get( p_intf, i_object_id );
if( p_module->i_object_type != VLC_OBJECT_MODULE )
{
if( p_item->i_type == CONFIG_HINT_END )
break;
p_item++;
/* 0OOoo something went really bad */
return;
}
}
/* Add a head title to the panel */
wxStaticBox *static_box = new wxStaticBox( this, -1, wxT("") );
wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( static_box,
wxHORIZONTAL );
label = new wxStaticText( this, -1,
wxU(psz_section ? p_item->psz_text :
p_module->psz_longname) );
box_sizer->Add( label, 1, wxALL, 5 );
sizer->Add( box_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, 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),
/* 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