]> git.sesse.net Git - vlc/commitdiff
Define an option to disable FS controller, as part of workaround #1758.
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 27 Jul 2008 04:26:44 +0000 (21:26 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 27 Jul 2008 04:26:44 +0000 (21:26 -0700)
If you think this commit is too much a feature than a bugfix, please revert.

modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/qt4.cpp
modules/gui/qt4/ui/sprefs_interface.ui

index e2e07d4583c45688b55e0fad8e67c27a04a2d24a..3161f45624d5ecc8fff72ff4fec5d67e34aac03e 100644 (file)
@@ -478,6 +478,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_GENERIC( "qt-display-mode", IntegerList, NULL,
                             displayModeBox );
             CONFIG_GENERIC( "embedded-video", Bool, NULL, embedVideo );
+            CONFIG_GENERIC( "qt-fs-controller", Bool, NULL, fsController );
             CONFIG_GENERIC_FILE( "skins2-last", File, NULL, ui.fileSkin,
                     ui.skinBrowse );
 
index 8199129f435f614d342a79694b7980b5af16a01f..1a2384273a2562680d03e293574ffb8355fa66ec 100644 (file)
@@ -81,13 +81,14 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 {
     /* Variables initialisation */
     // need_components_update = false;
-    bgWidget         = NULL;
-    videoWidget      = NULL;
-    playlistWidget   = NULL;
-    sysTray          = NULL;
-    videoIsActive    = false;
-    playlistVisible  = false;
-    input_name       = "";
+    bgWidget             = NULL;
+    videoWidget          = NULL;
+    playlistWidget       = NULL;
+    sysTray              = NULL;
+    videoIsActive        = false;
+    playlistVisible      = false;
+    input_name           = "";
+    fullscreenControls   = NULL;
 
     /* Ask for privacy */
     askForPrivacy();
@@ -222,12 +223,6 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 
     CONNECT( this, askUpdate(), this, doComponentsUpdate() );
 
-    CONNECT( controls, advancedControlsToggled( bool ),
-             this, doComponentsUpdate() );
-
-    CONNECT( fullscreenControls, advancedControlsToggled( bool ),
-             this, doComponentsUpdate() );
-
     /* Size and placement of interface */
     QVLCTools::restoreWidgetPosition(settings,this,QSize(350,60));
 
@@ -387,12 +382,18 @@ void MainInterface::handleMainUi( QSettings *settings )
     controls = new ControlsWidget( p_intf, this,
                    settings->value( "adv-controls", false ).toBool(),
                    b_shiny );
+    CONNECT( controls, advancedControlsToggled( bool ),
+             this, doComponentsUpdate() );
 
     /* Create the FULLSCREEN CONTROLS Widget */
-    /* bool b_shiny = config_GetInt( p_intf, "qt-blingbling" ); */
-    fullscreenControls = new FullscreenControllerWidget( p_intf, this,
-                   settings->value( "adv-controls", false ).toBool(),
-                   b_shiny );
+    if( config_GetInt( p_intf, "qt-fs-controller" ) )
+    {
+        fullscreenControls = new FullscreenControllerWidget( p_intf, this,
+                settings->value( "adv-controls", false ).toBool(),
+                b_shiny );
+        CONNECT( fullscreenControls, advancedControlsToggled( bool ),
+                this, doComponentsUpdate() );
+    }
 
     /* Add the controls Widget to the main Widget */
     mainLayout->insertWidget( 0, controls, 0, Qt::AlignBottom );
@@ -679,14 +680,14 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
 //        emit askVideoToResize( *pi_width, *pi_height );
         emit askUpdate();
 
-        fullscreenControls->attachVout( p_nvout );
+        if( fullscreenControls ) fullscreenControls->attachVout( p_nvout );
     }
     return ret;
 }
 
 void MainInterface::releaseVideo( vout_thread_t *p_vout, void *p_win )
 {
-    fullscreenControls->detachVout( p_vout );
+    if( fullscreenControls ) fullscreenControls->detachVout( p_vout );
     emit askReleaseVideo( p_win );
 }
 
@@ -884,12 +885,17 @@ void MainInterface::setName( QString name )
 void MainInterface::setStatus( int status )
 {
     msg_Dbg( p_intf, "I was here, updating your status" );
+
     /* Forward the status to the controls to toggle Play/Pause */
     controls->setStatus( status );
-    fullscreenControls->setStatus( status );
-
     controls->updateInput();
-    fullscreenControls->updateInput();
+
+    if( fullscreenControls )
+    {
+        fullscreenControls->setStatus( status );
+        fullscreenControls->updateInput();
+    }
+
     speedControl->setEnable( THEMIM->getIM()->hasInput() );
 
     /* And in the systray for the menu */
index a47aed7c52544648c0d9f7d8d6726fb8b91b9b9c..f769317dec7edce358011b3318f5cb5648252450 100644 (file)
@@ -135,6 +135,8 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 #define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete look with information area" )
 #define QT_MINIMAL_MODE_TEXT N_( "Minimal look with no menus" )
 
+#define QT_FULLSCREEN_TEXT N_( "Show a controller in fullscreen mode" )
+
 static const int i_mode_list[] =
     { QT_NORMAL_MODE, QT_ALWAYS_VIDEO_MODE, QT_MINIMAL_MODE };
 static const char *const psz_mode_list_text[] =
@@ -172,6 +174,8 @@ vlc_module_begin();
                 MINIMIZED_LONGTEXT, true);
         add_bool( "qt-name-in-title", true, NULL, TITLE_TEXT,
                   TITLE_LONGTEXT, false );
+        add_bool( "qt-fs-controller", true, NULL, QT_FULLSCREEN_TEXT,
+                  QT_FULLSCREEN_TEXT, false );
 
         add_bool( "qt-volume-complete", false, NULL, COMPLETEVOL_TEXT,
                 COMPLETEVOL_LONGTEXT, true );
index 359858086868f71d1a787cdea20822d2f2404fd3..c3160e69e66997081b763cb89651288eea334bfc 100644 (file)
         </property>
        </widget>
       </item>
-      <item row="3" column="0" colspan="4" >
+      <item row="4" column="0" colspan="4" >
        <widget class="Line" name="line" >
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
        </widget>
       </item>
-      <item row="4" column="0" >
+      <item row="5" column="0" >
        <widget class="QRadioButton" name="skins" >
         <property name="text" >
          <string>_("Skins")</string>
         </property>
        </widget>
       </item>
-      <item rowspan="2" row="4" column="1" colspan="3" >
+      <item rowspan="2" row="5" column="1" colspan="3" >
        <widget class="QLabel" name="skinsLabel" >
         <property name="sizePolicy" >
          <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
         </property>
        </widget>
       </item>
-      <item row="5" column="0" >
+      <item row="6" column="0" >
        <spacer>
         <property name="orientation" >
          <enum>Qt::Vertical</enum>
         </property>
        </spacer>
       </item>
-      <item row="6" column="0" >
+      <item row="7" column="0" >
        <widget class="QLabel" name="label_4" >
         <property name="text" >
          <string>_("Skin file")</string>
         </property>
        </widget>
       </item>
-      <item row="6" column="1" colspan="2" >
-       <widget class="QLineEdit" name="fileSkin" />
+      <item row="7" column="1" colspan="2" >
+       <widget class="QLineEdit" name="fileSkin" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
       </item>
-      <item row="6" column="3" >
+      <item row="7" column="3" >
        <widget class="QPushButton" name="skinBrowse" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="text" >
          <string>_("Browse...")</string>
         </property>
        </widget>
       </item>
+      <item row="3" column="1" colspan="3" >
+       <widget class="QCheckBox" name="fsController" >
+        <property name="text" >
+         <string>_("Show a controller in fullscreen")</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>