Qt: hide record button when the record access-filter is not present
authorJean-Philippe Andre <jpeg@via.ecp.fr>
Sat, 23 Aug 2008 22:38:11 +0000 (18:38 -0400)
committerJean-Philippe Andre <jpeg@via.ecp.fr>
Sat, 23 Aug 2008 22:53:05 +0000 (18:53 -0400)
If this stays too counter-intuitive, revert this commit, 672c3f35c4e4
and 7fe659bf364.
IMHO, the user who enables the record access-filter knows what he does.

modules/gui/qt4/components/interface_widgets.cpp

index 66b75b3..1f36d90 100644 (file)
@@ -336,6 +336,7 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, bool b_fsCreation = f
     BUTTON_SET_ACT( frameButton, "Fr", qtr( "Frame by frame" ), frame() );
 #endif
 
+    /* Record Button */
     recordButton = new QPushButton;
     setupSmallButton( recordButton );
     advLayout->addWidget( recordButton );
@@ -360,7 +361,15 @@ void AdvControlsWidget::enableInput( bool enable )
     {
         input_item_t *p_item = input_GetItem( THEMIM->getInput() );
         i_input_id = p_item->i_id;
+
+        if( var_Type( THEMIM->getInput(), "record-toggle" ) == VLC_VAR_VOID )
+            recordButton->setVisible( true );
+        else
+            recordButton->setVisible( false );
     }
+    else
+        recordButton->setVisible( false );
+
     ABButton->setEnabled( enable );
     recordButton->setEnabled( enable );
 
@@ -448,6 +457,7 @@ void AdvControlsWidget::record()
         /* This method won't work fine if the stream can't be cut anywhere */
         if( var_Type( p_input, "record-toggle" ) == VLC_VAR_VOID )
             var_TriggerCallback( p_input, "record-toggle" );
+#if 0
         else
         {
             /* 'record' access-filter is not loaded, we open Save dialog */
@@ -459,6 +469,7 @@ void AdvControlsWidget::record()
             if( psz )
                 THEDP->streamingDialog( NULL, psz, true );
         }
+#endif
     }
 }