[vlc-devel] commit: Fix teletex buttons (Lukas Durfina )
git version control
git at videolan.org
Mon Jun 23 18:04:08 CEST 2008
vlc | branch: master | Lukas Durfina <lukas.durfina at gmail.com> | Mon Jun 23 14:08:49 2008 +0200| [ec725cdc50c7b23539c4d455b1d5edb03c7e764b]
Fix teletex buttons
uninitialized variable and synchro with fs controller
Signed-off-by: Jean-Paul Saman <jpsaman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec725cdc50c7b23539c4d455b1d5edb03c7e764b
---
modules/gui/qt4/components/interface_widgets.cpp | 25 +++++++++++++++------
modules/gui/qt4/components/interface_widgets.hpp | 2 +-
modules/gui/qt4/input_manager.cpp | 15 +++++++++---
modules/gui/qt4/input_manager.hpp | 4 +++
4 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 43b88e1..5727e33 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -485,7 +485,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
telexLayout->setSpacing( 0 );
telexLayout->setMargin( 0 );
- QPushButton *telexOn = new QPushButton;
+ telexOn = new QPushButton;
setupSmallButton( telexOn );
telexLayout->addWidget( telexOn );
@@ -503,23 +503,32 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
telexLayout->addWidget( telexPage );
- controlLayout->addWidget( telexFrame, 1, 10, 2, 4, Qt::AlignBottom );
+ if( !b_fsCreation )
+ controlLayout->addWidget( telexFrame, 1, 10, 2, 4, Qt::AlignBottom );
telexFrame->hide(); /* default hidden */
CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(),
telexGotoPage( int ) );
+ CONNECT( THEMIM->getIM(), setNewTelexPage( int ),
+ telexPage, setValue( int ) );
+
+ BUTTON_SET_IMG( telexOn, "", tv.png, qtr( "Teletext on" ) );
- BUTTON_SET_ACT_I( telexOn, "", tv.png, qtr( "Teletext on" ),
- toggleTeletext() );
+ CONNECT( telexOn, clicked(), THEMIM->getIM(),
+ telexToggleButtons() );
CONNECT( telexOn, clicked( bool ), THEMIM->getIM(),
telexToggle( bool ) );
+ CONNECT( THEMIM->getIM(), toggleTelexButtons(),
+ this, toggleTeletext() );
+ b_telexEnabled = false;
telexTransparent->setEnabled( false );
telexPage->setEnabled( false );
- BUTTON_SET_ACT_I( telexTransparent, "", tvtelx.png, qtr( "Teletext" ),
- toggleTeletextTransparency() );
+ BUTTON_SET_IMG( telexTransparent, "", tvtelx.png, qtr( "Teletext" ) );
CONNECT( telexTransparent, clicked( bool ),
THEMIM->getIM(), telexSetTransparency() );
+ CONNECT( THEMIM->getIM(), toggleTelexTransparency(),
+ this, toggleTeletextTransparency() );
CONNECT( THEMIM->getIM(), teletextEnabled( bool ),
telexFrame, setVisible( bool ) );
@@ -1146,9 +1155,11 @@ static int regMouseMoveCallback( vlc_object_t *vlc_object, const char *variable,
var_DelCallback( p_vout, "mouse-moved",
showFullscreenControllCallback, (void *) p_fs );
b_registered = false;
- p_fs->hide();
}
+ if ( !var_GetBool( p_vout, "fullscreen" ) )
+ p_fs->hide();
+
return VLC_SUCCESS;
}
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index ed629ac..35e3c9a 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -203,7 +203,7 @@ protected:
InputSlider *slider;
QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
QPushButton *playButton, *fullscreenButton, *extSettingsButton;
- QPushButton *telexTransparent;
+ QPushButton *telexTransparent, *telexOn;
QSpinBox *telexPage;
QToolButton *slowerButton, *fasterButton;
QHBoxLayout *controlButLayout;
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index cb655df..d53ccb5 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -416,6 +416,7 @@ void InputManager::telexGotoPage( int page )
vlc_object_release( p_vbi );
}
}
+ emit setNewTelexPage( page );
}
void InputManager::telexToggle( bool b_enabled )
@@ -426,19 +427,24 @@ void InputManager::telexToggle( bool b_enabled )
{
vlc_value_t val;
vlc_object_t *p_vbi;
+ var_Change( p_input, "spu-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
+ b_enabled = (val.i_int > 0);
p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
"zvbi", FIND_ANYWHERE );
if( p_vbi )
{
i_page = var_GetInteger( p_vbi, "vbi-page" );
vlc_object_release( p_vbi );
+ i_page = b_enabled ? i_page : 0;
+ telexGotoPage( i_page );
}
- var_Change( p_input, "spu-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
- b_enabled = (val.i_int > 0);
}
emit teletextEnabled( b_enabled );
- i_page = b_enabled ? i_page : 0;
- telexGotoPage( i_page );
+}
+
+void InputManager::telexToggleButtons()
+{
+ emit toggleTelexButtons();
}
void InputManager::telexSetTransparency()
@@ -455,6 +461,7 @@ void InputManager::telexSetTransparency()
vlc_object_release( p_vbi );
}
}
+ emit toggleTelexTransparency();
}
void InputManager::slower()
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 1cf835b..ce9e352 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -103,6 +103,7 @@ public slots:
void sectionMenu();
void telexGotoPage( int ); ///< Goto teletext page
void telexToggle( bool ); ///< Enable disable teletext buttons
+ void telexToggleButtons(); ///< Toggle buttons after click
void telexSetTransparency(); ///< Set transparency on teletext background
signals:
@@ -119,6 +120,9 @@ signals:
void inputUnset();
/// Teletext
void teletextEnabled( bool );
+ void toggleTelexButtons();
+ void toggleTelexTransparency();
+ void setNewTelexPage( int );
};
class MainInputManager : public QObject
More information about the vlc-devel
mailing list