Commit 7587d7ef authored by Gildas Bazin's avatar Gildas Bazin

* configure.ac.in: removed the -fno-exceptions gcc option from the compilation of the skins plugin as it might be needed after all.
* modules/demux/m3u.c: upped the priority of the m3u demux as some m3u files were mistaken for ts files.
* include/configuration.h: added a CONFIG_ITEM_DIRECTORY config type.
* modules/gui/wxwindows/*: the preferences dialog should be fully useable now.
parent a79ca7b6
...@@ -2282,7 +2282,7 @@ AC_ARG_ENABLE(skins, ...@@ -2282,7 +2282,7 @@ AC_ARG_ENABLE(skins,
if test "x${enable_skins}" != "xno"; then if test "x${enable_skins}" != "xno"; then
if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
PLUGINS="${PLUGINS} skins" PLUGINS="${PLUGINS} skins"
CPPFLAGS_skins="${CPPFLAGS_skins} -O2 -fno-rtti -fno-exceptions -Imodules/gui/skins -Imodules/gui/skins/src -Imodules/gui/skins/win32 -Imodules/gui/skins/controls" CPPFLAGS_skins="${CPPFLAGS_skins} -O2 -fno-rtti -Imodules/gui/skins -Imodules/gui/skins/src -Imodules/gui/skins/win32 -Imodules/gui/skins/controls"
LDFLAGS_skins="${LDFLAGS_skins} -lstdc++ -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32 -lmsimg32" LDFLAGS_skins="${LDFLAGS_skins} -lstdc++ -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32 -lmsimg32"
fi fi
fi fi
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* It includes functions allowing to declare, get or set configuration options. * It includes functions allowing to declare, get or set configuration options.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: configuration.h,v 1.24 2003/02/20 01:52:45 sigmunau Exp $ * $Id: configuration.h,v 1.25 2003/03/30 11:43:38 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#define CONFIG_ITEM_INTEGER 0x0040 /* Integer option */ #define CONFIG_ITEM_INTEGER 0x0040 /* Integer option */
#define CONFIG_ITEM_BOOL 0x0050 /* Bool option */ #define CONFIG_ITEM_BOOL 0x0050 /* Bool option */
#define CONFIG_ITEM_FLOAT 0x0060 /* Float option */ #define CONFIG_ITEM_FLOAT 0x0060 /* Float option */
#define CONFIG_ITEM_DIRECTORY 0x0070 /* Directory option */
#define CONFIG_ITEM 0x00F0 #define CONFIG_ITEM 0x00F0
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* m3u.c: a meta demux to parse pls, m3u and asx playlists * m3u.c: a meta demux to parse pls, m3u and asx playlists
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: m3u.c,v 1.16 2003/03/22 14:35:03 gbazin Exp $ * $Id: m3u.c,v 1.17 2003/03/30 11:43:38 gbazin Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -63,7 +63,7 @@ static int Demux ( input_thread_t * ); ...@@ -63,7 +63,7 @@ static int Demux ( input_thread_t * );
*****************************************************************************/ *****************************************************************************/
vlc_module_begin(); vlc_module_begin();
set_description( _("playlist metademux") ); set_description( _("playlist metademux") );
set_capability( "demux", 10 ); set_capability( "demux", 180 );
set_callbacks( Activate, Deactivate ); set_callbacks( Activate, Deactivate );
add_shortcut( "m3u" ); add_shortcut( "m3u" );
add_shortcut( "asx" ); add_shortcut( "asx" );
......
...@@ -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.3 2003/03/30 02:58:36 gbazin Exp $ * $Id: preferences.cpp,v 1.4 2003/03/30 11:43:38 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -85,6 +85,7 @@ private: ...@@ -85,6 +85,7 @@ private:
wxWindow *p_parent; wxWindow *p_parent;
wxTreeItemId root_item; wxTreeItemId root_item;
wxTreeItemId plugins_item;
}; };
struct ConfigData struct ConfigData
...@@ -119,6 +120,7 @@ public: ...@@ -119,6 +120,7 @@ public:
PrefsPanel() { } PrefsPanel() { }
PrefsPanel( wxWindow *parent, intf_thread_t *_p_intf, PrefsPanel( wxWindow *parent, intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog,
module_t *p_module, char * ); module_t *p_module, char * );
virtual ~PrefsPanel() {} virtual ~PrefsPanel() {}
...@@ -131,6 +133,8 @@ private: ...@@ -131,6 +133,8 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
intf_thread_t *p_intf; intf_thread_t *p_intf;
PrefsDialog *p_prefs_dialog;
vlc_bool_t b_advanced; vlc_bool_t b_advanced;
wxBoxSizer *config_sizer; wxBoxSizer *config_sizer;
...@@ -153,7 +157,7 @@ public: ...@@ -153,7 +157,7 @@ public:
class ConfigEvtHandler : public wxEvtHandler class ConfigEvtHandler : public wxEvtHandler
{ {
public: public:
ConfigEvtHandler( intf_thread_t *p_intf ); ConfigEvtHandler( intf_thread_t *p_intf, PrefsDialog *p_prefs_dialog );
virtual ~ConfigEvtHandler(); virtual ~ConfigEvtHandler();
void ConfigEvtHandler::OnCommandEvent( wxCommandEvent& event ); void ConfigEvtHandler::OnCommandEvent( wxCommandEvent& event );
...@@ -163,6 +167,7 @@ private: ...@@ -163,6 +167,7 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
intf_thread_t *p_intf; intf_thread_t *p_intf;
PrefsDialog *p_prefs_dialog;
}; };
/***************************************************************************** /*****************************************************************************
...@@ -178,7 +183,7 @@ enum ...@@ -178,7 +183,7 @@ enum
Advanced_Event, Advanced_Event,
}; };
BEGIN_EVENT_TABLE(PrefsDialog, wxDialog) BEGIN_EVENT_TABLE(PrefsDialog, wxFrame)
/* Button events */ /* Button events */
EVT_BUTTON(wxID_OK, PrefsDialog::OnOk) EVT_BUTTON(wxID_OK, PrefsDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
...@@ -222,7 +227,7 @@ END_EVENT_TABLE() ...@@ -222,7 +227,7 @@ END_EVENT_TABLE()
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, Interface *_p_main_interface) PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, Interface *_p_main_interface)
: wxDialog( _p_main_interface, -1, _("Preferences"), wxDefaultPosition, : wxFrame( _p_main_interface, -1, _("Preferences"), wxDefaultPosition,
wxSize(650,450), wxDEFAULT_FRAME_STYLE ) wxSize(650,450), wxDEFAULT_FRAME_STYLE )
{ {
/* Initializations */ /* Initializations */
...@@ -351,7 +356,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -351,7 +356,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
case CONFIG_HINT_CATEGORY: case CONFIG_HINT_CATEGORY:
ConfigTreeData *config_data = new ConfigTreeData; ConfigTreeData *config_data = new ConfigTreeData;
config_data->panel = config_data->panel =
new PrefsPanel( p_parent, p_intf, new PrefsPanel( p_parent, p_intf, p_prefs_dialog,
p_module, p_item->psz_text ); p_module, p_item->psz_text );
config_data->panel->Hide(); config_data->panel->Hide();
...@@ -369,7 +374,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -369,7 +374,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
/* /*
* Build a tree of all the plugins * Build a tree of all the plugins
*/ */
wxTreeItemId plugins_item = AppendItem( root_item, _("Plugins") ); plugins_item = AppendItem( root_item, _("Plugins") );
for( i_index = 0; i_index < p_list->i_count; i_index++ ) for( i_index = 0; i_index < p_list->i_count; i_index++ )
{ {
...@@ -400,7 +405,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf, ...@@ -400,7 +405,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
/* Add the plugin to the tree */ /* Add the plugin to the tree */
ConfigTreeData *config_data = new ConfigTreeData; ConfigTreeData *config_data = new ConfigTreeData;
config_data->panel = config_data->panel =
new PrefsPanel( p_parent, p_intf, p_module, NULL ); new PrefsPanel( p_parent, p_intf, p_prefs_dialog, p_module, NULL );
config_data->panel->Hide(); config_data->panel->Hide();
AppendItem( capability_item, p_module->psz_object_name, -1, -1, AppendItem( capability_item, p_module->psz_object_name, -1, -1,
config_data ); config_data );
...@@ -434,12 +439,13 @@ PrefsTreeCtrl::~PrefsTreeCtrl() ...@@ -434,12 +439,13 @@ PrefsTreeCtrl::~PrefsTreeCtrl()
void PrefsTreeCtrl::ApplyChanges() void PrefsTreeCtrl::ApplyChanges()
{ {
long cookie; size_t i_child_index; long cookie, cookie2;
ConfigTreeData *config_data; ConfigTreeData *config_data;
wxTreeItemId item = GetFirstChild( root_item, cookie); /* Apply changes to the main module */
for( i_child_index = 0; wxTreeItemId item = GetFirstChild( root_item, cookie );
i_child_index < GetChildrenCount( root_item, TRUE ); for( size_t i_child_index = 0;
i_child_index < GetChildrenCount( root_item, FALSE );
i_child_index++ ) i_child_index++ )
{ {
config_data = (ConfigTreeData *)GetItemData( item ); config_data = (ConfigTreeData *)GetItemData( item );
...@@ -450,6 +456,29 @@ void PrefsTreeCtrl::ApplyChanges() ...@@ -450,6 +456,29 @@ void PrefsTreeCtrl::ApplyChanges()
item = GetNextChild( root_item, cookie ); item = GetNextChild( root_item, cookie );
} }
/* Apply changes to the plugins */
item = GetFirstChild( plugins_item, cookie);
for( size_t i_child_index = 0;
i_child_index < GetChildrenCount( plugins_item, TRUE );
i_child_index++ )
{
wxTreeItemId item2 = GetFirstChild( item, cookie2 );
for( size_t i_child_index = 0;
i_child_index < GetChildrenCount( item, FALSE );
i_child_index++ )
{
config_data = (ConfigTreeData *)GetItemData( item2 );
if( config_data )
{
config_data->panel->ApplyChanges();
}
item2 = GetNextChild( item, cookie2 );
}
item = GetNextChild( plugins_item, cookie );
}
} }
void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event ) void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event )
...@@ -476,6 +505,7 @@ void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event ) ...@@ -476,6 +505,7 @@ void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event )
* PrefsPanel class definition. * PrefsPanel class definition.
*****************************************************************************/ *****************************************************************************/
PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog,
module_t *p_module, char *psz_section ) module_t *p_module, char *psz_section )
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize ) : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize )
{ {
...@@ -493,6 +523,8 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -493,6 +523,8 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_prefs_dialog =_p_prefs_dialog,
b_advanced = VLC_TRUE; b_advanced = VLC_TRUE;
SetAutoLayout( TRUE ); SetAutoLayout( TRUE );
...@@ -582,6 +614,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -582,6 +614,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
label = new wxStaticText(panel, -1, p_item->psz_text); label = new wxStaticText(panel, -1, p_item->psz_text);
textctrl = new wxTextCtrl( panel, -1, p_item->psz_value, textctrl = new wxTextCtrl( panel, -1, p_item->psz_value,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
...@@ -594,6 +627,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -594,6 +627,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
{ {
button = new wxButton( panel, -1, _("Browse...") ); button = new wxButton( panel, -1, _("Browse...") );
panel_sizer->Add( button, 0, wxALL, 5 ); panel_sizer->Add( button, 0, wxALL, 5 );
button->SetClientData((void *)config_data);
} }
break; break;
...@@ -667,7 +701,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, ...@@ -667,7 +701,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
/* Intercept all menu events in our custom event handler */ /* Intercept all menu events in our custom event handler */
config_window->PushEventHandler( config_window->PushEventHandler(
new ConfigEvtHandler( p_intf ) ); new ConfigEvtHandler( p_intf, p_prefs_dialog ) );
/* Update panel */ /* Update panel */
wxCommandEvent dummy_event; wxCommandEvent dummy_event;
...@@ -702,6 +736,7 @@ void PrefsPanel::ApplyChanges() ...@@ -702,6 +736,7 @@ void PrefsPanel::ApplyChanges()
break; break;
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
config_PutPsz( p_intf, config_data->option_name.c_str(), config_PutPsz( p_intf, config_data->option_name.c_str(),
config_data->control.textctrl->GetValue() ); config_data->control.textctrl->GetValue() );
break; break;
...@@ -768,10 +803,12 @@ void PrefsPanel::OnDirectoryBrowse( wxCommandEvent& WXUNUSED(event) ) ...@@ -768,10 +803,12 @@ void PrefsPanel::OnDirectoryBrowse( wxCommandEvent& WXUNUSED(event) )
/***************************************************************************** /*****************************************************************************
* A small helper class which intercepts all events * A small helper class which intercepts all events
*****************************************************************************/ *****************************************************************************/
ConfigEvtHandler::ConfigEvtHandler( intf_thread_t *_p_intf ) ConfigEvtHandler::ConfigEvtHandler( intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_prefs_dialog = _p_prefs_dialog;
} }
ConfigEvtHandler::~ConfigEvtHandler() ConfigEvtHandler::~ConfigEvtHandler()
...@@ -795,13 +832,23 @@ void ConfigEvtHandler::OnCommandEvent( wxCommandEvent& event ) ...@@ -795,13 +832,23 @@ void ConfigEvtHandler::OnCommandEvent( wxCommandEvent& event )
return; return;
} }
msg_Err( p_intf, "%s", config_data->option_name.c_str() ); if( config_data->i_config_type == CONFIG_ITEM_FILE )
{
wxFileDialog dialog( p_prefs_dialog, _("Open file"), "", "", "*.*",
wxOPEN | wxSAVE );
if( dialog.ShowModal() == wxID_OK )
{
config_data->control.textctrl->SetValue( dialog.GetPath() );
}
}
switch( config_data->i_config_type ) switch( config_data->i_config_type )
{ {
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
break; break;
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
break;
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
break; break;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.13 2003/03/30 02:58:36 gbazin Exp $ * $Id: wxwindows.h,v 1.14 2003/03/30 11:43:38 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -155,7 +155,7 @@ private: ...@@ -155,7 +155,7 @@ private:
Timer *timer; Timer *timer;
intf_thread_t *p_intf; intf_thread_t *p_intf;
wxDialog *p_prefs_dialog; wxFrame *p_prefs_dialog;
wxFrame *p_fileinfo_window; wxFrame *p_fileinfo_window;
int i_old_playing_status; int i_old_playing_status;
...@@ -312,7 +312,7 @@ private: ...@@ -312,7 +312,7 @@ private:
/* Preferences Dialog */ /* Preferences Dialog */
class PrefsTreeCtrl; class PrefsTreeCtrl;
class PrefsDialog: public wxDialog class PrefsDialog: public wxFrame
{ {
public: public:
/* Constructor */ /* Constructor */
......
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