[vlc-commits] Qt: StringListConfigControl: use signals instead of public members.

Francois Cartegnie git at videolan.org
Mon Mar 26 16:26:06 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 26 16:22:54 2012 +0200| [37c3895820b17a1ff51a5768e05659eee208d6a2] | committer: Francois Cartegnie

Qt: StringListConfigControl: use signals instead of public members.

Fixes combo visibility in open_panel

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=37c3895820b17a1ff51a5768e05659eee208d6a2
---

 modules/gui/qt4/components/open_panels.cpp         |    4 ++--
 modules/gui/qt4/components/preferences_widgets.cpp |    7 +++++++
 modules/gui/qt4/components/preferences_widgets.hpp |    5 +++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index f05de38..c4e5fb2 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -741,8 +741,8 @@ void CaptureOpenPanel::initialize()
             1, 0, 3, 1 );
 
     /* dshow CONNECTs */
-    CuMRL( vdevDshowW->combo, currentIndexChanged ( int ) );
-    CuMRL( adevDshowW->combo, currentIndexChanged ( int ) );
+    CuMRL( vdevDshowW, changed() );
+    CuMRL( adevDshowW, changed() );
     CuMRL( dshowVSizeLine, textChanged( const QString& ) );
     configList << "dshow-vdev" << "dshow-adev" << "dshow-size";
     }
diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 32e6bdd..fd5e2f4 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -457,6 +457,12 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
     }
 }
 
+void StringListConfigControl::comboIndexChanged( int i_index )
+{
+    Q_UNUSED( i_index );
+    emit changed();
+}
+
 void StringListConfigControl::actionRequested( int i_action )
 {
     /* Supplementary check for boundaries */
@@ -493,6 +499,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
 void StringListConfigControl::finish(module_config_t *p_module_config )
 {
     combo->setEditable( false );
+    CONNECT( combo, currentIndexChanged ( int ), this, comboIndexChanged( int ) );
 
     if(!p_module_config) return;
 
diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp
index 63f207c..c749163 100644
--- a/modules/gui/qt4/components/preferences_widgets.hpp
+++ b/modules/gui/qt4/components/preferences_widgets.hpp
@@ -101,9 +101,10 @@ protected:
     vlc_object_t *p_this;
     module_config_t *p_item;
     QWidget *widget;
+signals:
+    void changed();
 #if 0
 /* You shouldn't use that now..*/
-signals:
     void Updated();
 #endif
 };
@@ -471,7 +472,7 @@ private:
     QLabel *label;
 private slots:
     void actionRequested( int );
-
+    void comboIndexChanged( int );
 };
 
 void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,



More information about the vlc-commits mailing list