From 90f719f7712411e17abd0ef30d442143d441b265 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Sat, 26 Jul 2008 21:26:44 -0700 Subject: [PATCH] Define an option to disable FS controller, as part of workaround #1758. If you think this commit is too much a feature than a bugfix, please revert. --- .../gui/qt4/components/simple_preferences.cpp | 1 + modules/gui/qt4/main_interface.cpp | 50 +++++++++++-------- modules/gui/qt4/qt4.cpp | 4 ++ modules/gui/qt4/ui/sprefs_interface.ui | 36 ++++++++++--- 4 files changed, 61 insertions(+), 30 deletions(-) diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp index e2e07d4583..3161f45624 100644 --- a/modules/gui/qt4/components/simple_preferences.cpp +++ b/modules/gui/qt4/components/simple_preferences.cpp @@ -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 ); diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index 8199129f43..1a2384273a 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -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 */ diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index a47aed7c52..f769317dec 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -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 ); diff --git a/modules/gui/qt4/ui/sprefs_interface.ui b/modules/gui/qt4/ui/sprefs_interface.ui index 3598580868..c3160e69e6 100644 --- a/modules/gui/qt4/ui/sprefs_interface.ui +++ b/modules/gui/qt4/ui/sprefs_interface.ui @@ -91,21 +91,21 @@ - + Qt::Horizontal - + _("Skins") - + @@ -139,7 +139,7 @@ - + Qt::Vertical @@ -152,7 +152,7 @@ - + _("Skin file") @@ -162,16 +162,36 @@ - - + + + + + 0 + 0 + + + - + + + + 0 + 0 + + _("Browse...") + + + + _("Show a controller in fullscreen") + + + -- 2.39.2