From 8150192bace03463f1af51cf0960640e7148c8d3 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Sun, 9 Nov 2003 20:13:46 +0000 Subject: [PATCH] * modules/gui/wxwindows/open.cpp: added an AutoBuildPanel() that is used to construct the dshow tab. (It is not quite useful yet but will be shortly). --- modules/gui/wxwindows/open.cpp | 38 +++++++++++++++++++++++++++---- modules/gui/wxwindows/wxwindows.h | 4 ++-- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/modules/gui/wxwindows/open.cpp b/modules/gui/wxwindows/open.cpp index b7c243287c..205889de61 100644 --- a/modules/gui/wxwindows/open.cpp +++ b/modules/gui/wxwindows/open.cpp @@ -2,7 +2,7 @@ * open.cpp : wxWindows plugin for vlc ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: open.cpp,v 1.40 2003/11/05 17:57:29 gbazin Exp $ + * $Id: open.cpp,v 1.41 2003/11/09 20:13:46 gbazin Exp $ * * Authors: Gildas Bazin * @@ -52,6 +52,8 @@ #include "wxwindows.h" +#include "preferences_widgets.h" + #ifndef wxRB_SINGLE # define wxRB_SINGLE 0 #endif @@ -256,13 +258,17 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, notebook->AddPage( NetPanel( notebook ), wxU(_("Network")), i_access_method == NET_ACCESS ); #ifndef WIN32 - notebook->AddPage( SatPanel( notebook ), wxU(_("Satellite")), - i_access_method == SAT_ACCESS ); - notebook->AddPage( V4LPanel( notebook ), wxU(_("Video For Linux")), i_access_method == V4L_ACCESS ); #endif + module_t *p_module = config_FindModule( VLC_OBJECT(p_intf), "dshow" ); + if( p_module ) + { + notebook->AddPage( AutoBuildPanel( notebook, p_module ), + wxU( p_module->psz_longname ) ); + } + /* Update Disc panel */ wxCommandEvent dummy_event; OnDiscTypeChange( dummy_event ); @@ -582,10 +588,32 @@ wxPanel *OpenDialog::V4LPanel( wxWindow* parent ) } #endif -wxPanel *OpenDialog::SatPanel( wxWindow* parent ) +wxPanel *OpenDialog::AutoBuildPanel( wxWindow* parent, + const module_t *p_module ) { wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition, wxSize(200, 200) ); + + wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); + + module_config_t *p_item = p_module->p_config; + + if( p_item ) do + { + if( p_item->i_type & CONFIG_HINT || p_item->b_advanced ) + continue; + + ConfigControl *control = + CreateConfigControl( VLC_OBJECT(p_intf), p_item, panel ); + + /* Don't add items that were not recognized */ + if( control == NULL ) continue; + + sizer->Add( control, 0, wxEXPAND | wxALL, 2 ); + } + while( p_item->i_type != CONFIG_HINT_END && p_item++ ); + + panel->SetSizerAndFit( sizer ); return panel; } diff --git a/modules/gui/wxwindows/wxwindows.h b/modules/gui/wxwindows/wxwindows.h index dacb1debdc..d97f551aac 100644 --- a/modules/gui/wxwindows/wxwindows.h +++ b/modules/gui/wxwindows/wxwindows.h @@ -2,7 +2,7 @@ * wxwindows.h: private wxWindows interface description ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: wxwindows.h,v 1.67 2003/11/05 17:57:29 gbazin Exp $ + * $Id: wxwindows.h,v 1.68 2003/11/09 20:13:46 gbazin Exp $ * * Authors: Gildas Bazin * @@ -314,8 +314,8 @@ private: wxPanel *FilePanel( wxWindow* parent ); wxPanel *DiscPanel( wxWindow* parent ); wxPanel *NetPanel( wxWindow* parent ); - wxPanel *SatPanel( wxWindow* parent ); wxPanel *V4LPanel( wxWindow* parent ); + wxPanel *AutoBuildPanel( wxWindow* parent, const module_t * ); void UpdateMRL( int i_access_method ); -- 2.39.2