Qt4 - Try to fix the detection of video tracks and show of related buttons, fix a...
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 28 Jan 2008 04:16:17 +0000 (04:16 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 28 Jan 2008 04:16:17 +0000 (04:16 +0000)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/input_manager.cpp

index 885f676..ee0838b 100644 (file)
@@ -590,6 +590,10 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     /* Volume control connection */
     CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
     CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) );
+
+    CONNECT( THEMIM->getIM(), statusChanged( int ), this, updateInput() );
+
+    updateInput();
 }
 
 ControlsWidget::~ControlsWidget()
@@ -678,11 +682,13 @@ void ControlsWidget::updateVolume()
         volumeSlider->setValue( i_volume );
         b_my_volume = false;
     }
+}
 
+void ControlsWidget::updateInput()
+{
     /* Activate the interface buttons according to the presence of the input */
     enableInput( THEMIM->getIM()->hasInput() );
-    //enableVideo( THEMIM->getIM()->hasVideo() );
-    enableVideo( true );
+    enableVideo( THEMIM->getIM()->hasVideo() );
 }
 
 void ControlsWidget::setStatus( int status )
index 59275c6..9ef01c1 100644 (file)
@@ -182,6 +182,7 @@ private slots:
     void next();
     void updateVolume( int );
     void updateVolume( void );
+    void updateInput();
     void fullscreen();
     void extSettings();
     void faster();
index de9cf9b..6752dd2 100644 (file)
@@ -475,6 +475,7 @@ void MainInputManager::customEvent( QEvent *event )
         {
             im->delInput();
             emit inputChanged( NULL );
+            p_input = NULL;
         }
 
         if( !p_input )