Commit ec725cdc authored by Lukas Durfina's avatar Lukas Durfina Committed by Jean-Paul Saman

Fix teletex buttons

uninitialized variable and synchro with fs controller
Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent 51b21bc3
...@@ -485,7 +485,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -485,7 +485,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
telexLayout->setSpacing( 0 ); telexLayout->setSpacing( 0 );
telexLayout->setMargin( 0 ); telexLayout->setMargin( 0 );
QPushButton *telexOn = new QPushButton; telexOn = new QPushButton;
setupSmallButton( telexOn ); setupSmallButton( telexOn );
telexLayout->addWidget( telexOn ); telexLayout->addWidget( telexOn );
...@@ -503,23 +503,32 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -503,23 +503,32 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ); telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
telexLayout->addWidget( telexPage ); telexLayout->addWidget( telexPage );
if( !b_fsCreation )
controlLayout->addWidget( telexFrame, 1, 10, 2, 4, Qt::AlignBottom ); controlLayout->addWidget( telexFrame, 1, 10, 2, 4, Qt::AlignBottom );
telexFrame->hide(); /* default hidden */ telexFrame->hide(); /* default hidden */
CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(), CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(),
telexGotoPage( int ) ); 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" ), CONNECT( telexOn, clicked(), THEMIM->getIM(),
toggleTeletext() ); telexToggleButtons() );
CONNECT( telexOn, clicked( bool ), THEMIM->getIM(), CONNECT( telexOn, clicked( bool ), THEMIM->getIM(),
telexToggle( bool ) ); telexToggle( bool ) );
CONNECT( THEMIM->getIM(), toggleTelexButtons(),
this, toggleTeletext() );
b_telexEnabled = false;
telexTransparent->setEnabled( false ); telexTransparent->setEnabled( false );
telexPage->setEnabled( false ); telexPage->setEnabled( false );
BUTTON_SET_ACT_I( telexTransparent, "", tvtelx.png, qtr( "Teletext" ), BUTTON_SET_IMG( telexTransparent, "", tvtelx.png, qtr( "Teletext" ) );
toggleTeletextTransparency() );
CONNECT( telexTransparent, clicked( bool ), CONNECT( telexTransparent, clicked( bool ),
THEMIM->getIM(), telexSetTransparency() ); THEMIM->getIM(), telexSetTransparency() );
CONNECT( THEMIM->getIM(), toggleTelexTransparency(),
this, toggleTeletextTransparency() );
CONNECT( THEMIM->getIM(), teletextEnabled( bool ), CONNECT( THEMIM->getIM(), teletextEnabled( bool ),
telexFrame, setVisible( bool ) ); telexFrame, setVisible( bool ) );
...@@ -1146,9 +1155,11 @@ static int regMouseMoveCallback( vlc_object_t *vlc_object, const char *variable, ...@@ -1146,9 +1155,11 @@ static int regMouseMoveCallback( vlc_object_t *vlc_object, const char *variable,
var_DelCallback( p_vout, "mouse-moved", var_DelCallback( p_vout, "mouse-moved",
showFullscreenControllCallback, (void *) p_fs ); showFullscreenControllCallback, (void *) p_fs );
b_registered = false; b_registered = false;
p_fs->hide();
} }
if ( !var_GetBool( p_vout, "fullscreen" ) )
p_fs->hide();
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -203,7 +203,7 @@ protected: ...@@ -203,7 +203,7 @@ protected:
InputSlider *slider; InputSlider *slider;
QPushButton *prevSectionButton, *nextSectionButton, *menuButton; QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
QPushButton *playButton, *fullscreenButton, *extSettingsButton; QPushButton *playButton, *fullscreenButton, *extSettingsButton;
QPushButton *telexTransparent; QPushButton *telexTransparent, *telexOn;
QSpinBox *telexPage; QSpinBox *telexPage;
QToolButton *slowerButton, *fasterButton; QToolButton *slowerButton, *fasterButton;
QHBoxLayout *controlButLayout; QHBoxLayout *controlButLayout;
......
...@@ -416,6 +416,7 @@ void InputManager::telexGotoPage( int page ) ...@@ -416,6 +416,7 @@ void InputManager::telexGotoPage( int page )
vlc_object_release( p_vbi ); vlc_object_release( p_vbi );
} }
} }
emit setNewTelexPage( page );
} }
void InputManager::telexToggle( bool b_enabled ) void InputManager::telexToggle( bool b_enabled )
...@@ -426,19 +427,24 @@ void InputManager::telexToggle( bool b_enabled ) ...@@ -426,19 +427,24 @@ void InputManager::telexToggle( bool b_enabled )
{ {
vlc_value_t val; vlc_value_t val;
vlc_object_t *p_vbi; 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, p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
"zvbi", FIND_ANYWHERE ); "zvbi", FIND_ANYWHERE );
if( p_vbi ) if( p_vbi )
{ {
i_page = var_GetInteger( p_vbi, "vbi-page" ); i_page = var_GetInteger( p_vbi, "vbi-page" );
vlc_object_release( p_vbi ); 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 ); emit teletextEnabled( b_enabled );
i_page = b_enabled ? i_page : 0; }
telexGotoPage( i_page );
void InputManager::telexToggleButtons()
{
emit toggleTelexButtons();
} }
void InputManager::telexSetTransparency() void InputManager::telexSetTransparency()
...@@ -455,6 +461,7 @@ void InputManager::telexSetTransparency() ...@@ -455,6 +461,7 @@ void InputManager::telexSetTransparency()
vlc_object_release( p_vbi ); vlc_object_release( p_vbi );
} }
} }
emit toggleTelexTransparency();
} }
void InputManager::slower() void InputManager::slower()
......
...@@ -103,6 +103,7 @@ public slots: ...@@ -103,6 +103,7 @@ public slots:
void sectionMenu(); void sectionMenu();
void telexGotoPage( int ); ///< Goto teletext page void telexGotoPage( int ); ///< Goto teletext page
void telexToggle( bool ); ///< Enable disable teletext buttons void telexToggle( bool ); ///< Enable disable teletext buttons
void telexToggleButtons(); ///< Toggle buttons after click
void telexSetTransparency(); ///< Set transparency on teletext background void telexSetTransparency(); ///< Set transparency on teletext background
signals: signals:
...@@ -119,6 +120,9 @@ signals: ...@@ -119,6 +120,9 @@ signals:
void inputUnset(); void inputUnset();
/// Teletext /// Teletext
void teletextEnabled( bool ); void teletextEnabled( bool );
void toggleTelexButtons();
void toggleTelexTransparency();
void setNewTelexPage( int );
}; };
class MainInputManager : public QObject class MainInputManager : public QObject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment