Commit 4eb628bc authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: fixed the save feature of the preferences dialog box.
* src/misc/configuration.c: added support for CONFIG_ITEM_DIRECTORY.
parent bba94275
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc * preferences.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.4 2003/03/30 11:43:38 gbazin Exp $ * $Id: preferences.cpp,v 1.5 2003/03/30 13:23:27 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -127,8 +127,6 @@ public: ...@@ -127,8 +127,6 @@ public:
void ApplyChanges(); void ApplyChanges();
private: private:
void OnFileBrowse( wxCommandEvent& WXUNUSED(event) );
void OnDirectoryBrowse( wxCommandEvent& WXUNUSED(event) );
void OnAdvanced( wxCommandEvent& WXUNUSED(event) ); void OnAdvanced( wxCommandEvent& WXUNUSED(event) );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
...@@ -201,18 +199,9 @@ BEGIN_EVENT_TABLE(PrefsTreeCtrl, wxTreeCtrl) ...@@ -201,18 +199,9 @@ BEGIN_EVENT_TABLE(PrefsTreeCtrl, wxTreeCtrl)
EVT_TREE_SEL_CHANGED(PrefsTree_Ctrl, PrefsTreeCtrl::OnSelectTreeItem) EVT_TREE_SEL_CHANGED(PrefsTree_Ctrl, PrefsTreeCtrl::OnSelectTreeItem)
END_EVENT_TABLE() END_EVENT_TABLE()
enum
{
FileBrowse_Event = wxID_HIGHEST,
DirectoryBrowse_Event,
};
BEGIN_EVENT_TABLE(PrefsPanel, wxPanel) BEGIN_EVENT_TABLE(PrefsPanel, wxPanel)
/* Button events */ /* Button events */
EVT_BUTTON(Advanced_Event, PrefsPanel::OnAdvanced) EVT_BUTTON(Advanced_Event, PrefsPanel::OnAdvanced)
EVT_BUTTON(FileBrowse_Event, PrefsPanel::OnFileBrowse)
EVT_BUTTON(DirectoryBrowse_Event, PrefsPanel::OnDirectoryBrowse)
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -380,7 +369,11 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -380,7 +369,11 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
{ {
p_module = (module_t *)p_list->p_values[i_index].p_object; p_module = (module_t *)p_list->p_values[i_index].p_object;
/* Find the capabiltiy child item */ /* Exclude the main module */
if( !strcmp( p_module->psz_object_name, "main" ) )
continue;
/* Find the capability child item */
long cookie; size_t i_child_index; long cookie; size_t i_child_index;
wxTreeItemId capability_item = GetFirstChild( plugins_item, cookie); wxTreeItemId capability_item = GetFirstChild( plugins_item, cookie);
for( i_child_index = 0; for( i_child_index = 0;
...@@ -458,9 +451,9 @@ void PrefsTreeCtrl::ApplyChanges() ...@@ -458,9 +451,9 @@ void PrefsTreeCtrl::ApplyChanges()
} }
/* Apply changes to the plugins */ /* Apply changes to the plugins */
item = GetFirstChild( plugins_item, cookie); item = GetFirstChild( plugins_item, cookie );
for( size_t i_child_index = 0; for( size_t i_child_index = 0;
i_child_index < GetChildrenCount( plugins_item, TRUE ); i_child_index < GetChildrenCount( plugins_item, FALSE );
i_child_index++ ) i_child_index++ )
{ {
wxTreeItemId item2 = GetFirstChild( item, cookie2 ); wxTreeItemId item2 = GetFirstChild( item, cookie2 );
...@@ -726,7 +719,6 @@ void PrefsPanel::ApplyChanges() ...@@ -726,7 +719,6 @@ void PrefsPanel::ApplyChanges()
{ {
ConfigData *config_data = config_array.Item(i); ConfigData *config_data = config_array.Item(i);
msg_Err( p_intf, "ApplyChanges %s", config_data->option_name.c_str() );
switch( config_data->i_config_type ) switch( config_data->i_config_type )
{ {
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
...@@ -742,7 +734,7 @@ void PrefsPanel::ApplyChanges() ...@@ -742,7 +734,7 @@ void PrefsPanel::ApplyChanges()
break; break;
case CONFIG_ITEM_BOOL: case CONFIG_ITEM_BOOL:
config_PutInt( p_intf, config_data->option_name.c_str(), config_PutInt( p_intf, config_data->option_name.c_str(),
config_data->control.checkbox->GetValue() ); config_data->control.checkbox->IsChecked() );
break; break;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
config_PutInt( p_intf, config_data->option_name.c_str(), config_PutInt( p_intf, config_data->option_name.c_str(),
...@@ -774,32 +766,6 @@ void PrefsPanel::OnAdvanced( wxCommandEvent& WXUNUSED(event) ) ...@@ -774,32 +766,6 @@ void PrefsPanel::OnAdvanced( wxCommandEvent& WXUNUSED(event) )
config_window->FitInside(); config_window->FitInside();
} }
void PrefsPanel::OnFileBrowse( wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog( this, _("Open file"), "", "", "*.*",
wxOPEN );
if( dialog.ShowModal() == wxID_OK )
{
#if 0
file_combo->SetValue( dialog.GetPath() );
#endif
}
}
void PrefsPanel::OnDirectoryBrowse( wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog( this, _("Open file"), "", "", "*.*",
wxOPEN );
if( dialog.ShowModal() == wxID_OK )
{
#if 0
file_combo->SetValue( dialog.GetPath() );
#endif
}
}
/***************************************************************************** /*****************************************************************************
* A small helper class which intercepts all events * A small helper class which intercepts all events
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.cpp : wxWindows plugin for vlc * wxwindows.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: wxwindows.cpp,v 1.13 2003/03/29 17:10:31 gbazin Exp $ * $Id: wxwindows.cpp,v 1.14 2003/03/30 13:23:28 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -79,7 +79,6 @@ private: ...@@ -79,7 +79,6 @@ private:
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
vlc_module_begin(); vlc_module_begin();
add_category_hint( N_("wxWindows"), NULL, VLC_TRUE );
set_description( (char *) _("wxWindows interface module") ); set_description( (char *) _("wxWindows interface module") );
set_capability( "interface", 50 ); set_capability( "interface", 50 );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* configuration.c management of the modules configuration * configuration.c management of the modules configuration
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: configuration.c,v 1.51 2003/02/20 01:52:47 sigmunau Exp $ * $Id: configuration.c,v 1.52 2003/03/30 13:23:27 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -117,7 +117,7 @@ float __config_GetFloat( vlc_object_t *p_this, const char *psz_name ) ...@@ -117,7 +117,7 @@ float __config_GetFloat( vlc_object_t *p_this, const char *psz_name )
***************************************************************************** *****************************************************************************
* This function is used to get the value of variables which are internally * This function is used to get the value of variables which are internally
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE, * represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
* and CONFIG_ITEM_MODULE). * CONFIG_ITEM_DIRECTORY, and CONFIG_ITEM_MODULE).
* *
* Important note: remember to free() the returned char* because it's a * Important note: remember to free() the returned char* because it's a
* duplicate of the actual value. It isn't safe to return a pointer to the * duplicate of the actual value. It isn't safe to return a pointer to the
...@@ -138,6 +138,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name ) ...@@ -138,6 +138,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name )
} }
if( (p_config->i_type!=CONFIG_ITEM_STRING) && if( (p_config->i_type!=CONFIG_ITEM_STRING) &&
(p_config->i_type!=CONFIG_ITEM_FILE) && (p_config->i_type!=CONFIG_ITEM_FILE) &&
(p_config->i_type!=CONFIG_ITEM_DIRECTORY) &&
(p_config->i_type!=CONFIG_ITEM_MODULE) ) (p_config->i_type!=CONFIG_ITEM_MODULE) )
{ {
msg_Err( p_this, "option %s does not refer to a string", psz_name ); msg_Err( p_this, "option %s does not refer to a string", psz_name );
...@@ -157,7 +158,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name ) ...@@ -157,7 +158,7 @@ char * __config_GetPsz( vlc_object_t *p_this, const char *psz_name )
***************************************************************************** *****************************************************************************
* This function is used to set the value of variables which are internally * This function is used to set the value of variables which are internally
* represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE, * represented by a string (CONFIG_ITEM_STRING, CONFIG_ITEM_FILE,
* and CONFIG_ITEM_MODULE). * CONFIG_ITEM_DIRECTORY, and CONFIG_ITEM_MODULE).
*****************************************************************************/ *****************************************************************************/
void __config_PutPsz( vlc_object_t *p_this, void __config_PutPsz( vlc_object_t *p_this,
const char *psz_name, const char *psz_value ) const char *psz_name, const char *psz_value )
...@@ -174,6 +175,7 @@ void __config_PutPsz( vlc_object_t *p_this, ...@@ -174,6 +175,7 @@ void __config_PutPsz( vlc_object_t *p_this,
} }
if( (p_config->i_type!=CONFIG_ITEM_STRING) && if( (p_config->i_type!=CONFIG_ITEM_STRING) &&
(p_config->i_type!=CONFIG_ITEM_FILE) && (p_config->i_type!=CONFIG_ITEM_FILE) &&
(p_config->i_type!=CONFIG_ITEM_DIRECTORY) &&
(p_config->i_type!=CONFIG_ITEM_MODULE) ) (p_config->i_type!=CONFIG_ITEM_MODULE) )
{ {
msg_Err( p_this, "option %s does not refer to a string", psz_name ); msg_Err( p_this, "option %s does not refer to a string", psz_name );
...@@ -1155,6 +1157,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1155,6 +1157,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
{ {
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
config_PutPsz( p_this, psz_name, optarg ); config_PutPsz( p_this, psz_name, optarg );
break; break;
...@@ -1179,6 +1182,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], ...@@ -1179,6 +1182,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
{ {
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
config_PutPsz( p_this, pp_shortopts[i_cmd]->psz_name, optarg ); config_PutPsz( p_this, pp_shortopts[i_cmd]->psz_name, optarg );
break; break;
......
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