]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/open.cpp: added an AutoBuildPanel() that is used to construct...
authorGildas Bazin <gbazin@videolan.org>
Sun, 9 Nov 2003 20:13:46 +0000 (20:13 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 9 Nov 2003 20:13:46 +0000 (20:13 +0000)
   (It is not quite useful yet but will be shortly).

modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/wxwindows.h

index b7c243287c49c85e4b29c68b608451d053066592..205889de61bb203334b3dc6cdb2e86cef45e0107 100644 (file)
@@ -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 <gbazin@netcourrier.com>
  *
@@ -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;
 }
 
index dacb1debdcdef5cfb3eef9a73e4490594349f2b4..d97f551aac0a7b1ee98f3159b3627814d4920310 100644 (file)
@@ -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 <gbazin@netcourrier.com>
  *
@@ -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 );