[vlc-devel] commit: Define an option to disable FS controller, as part of workaround #1758. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Sun Jul 27 06:24:25 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Jul 26 21:26:44 2008 -0700| [90f719f7712411e17abd0ef30d442143d441b265]
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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=90f719f7712411e17abd0ef30d442143d441b265
---
modules/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 e2e07d4..3161f45 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 8199129..1a23842 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 a47aed7..f769317 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 3598580..c3160e6 100644
--- a/modules/gui/qt4/ui/sprefs_interface.ui
+++ b/modules/gui/qt4/ui/sprefs_interface.ui
@@ -91,21 +91,21 @@
</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" >
@@ -139,7 +139,7 @@
</property>
</widget>
</item>
- <item row="5" column="0" >
+ <item row="6" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@@ -152,7 +152,7 @@
</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>
@@ -162,16 +162,36 @@
</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>
More information about the vlc-devel
mailing list