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: Jean-Paul Saman's avatarJean-Paul Saman <jpsaman@videolan.org>
parent 51b21bc3
......@@ -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;
}
......
......@@ -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;
......
......@@ -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()
......
......@@ -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
......
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