Commit 69afa855 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fix behaviour of the button logic for teletext and use the images.

parent 9497e5ca
...@@ -460,6 +460,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -460,6 +460,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
sectionNext() ); sectionNext() );
CONNECT( menuButton, clicked(), THEMIM->getIM(), CONNECT( menuButton, clicked(), THEMIM->getIM(),
sectionMenu() ); sectionMenu() );
/** /**
* Telextext QFrame * Telextext QFrame
* TODO: Merge with upper menu in a StackLayout * TODO: Merge with upper menu in a StackLayout
...@@ -469,17 +470,16 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -469,17 +470,16 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
telexLayout->setSpacing( 0 ); telexLayout->setSpacing( 0 );
telexLayout->setMargin( 0 ); telexLayout->setMargin( 0 );
QToolButton *telexOn = new QToolButton; QPushButton *telexOn = new QPushButton;
telexOn->setText( qtr( "On" ) );
setupSmallButton( telexOn ); setupSmallButton( telexOn );
telexLayout->addWidget( telexOn ); telexLayout->addWidget( telexOn );
QToolButton *telexTransparent = new QToolButton; telexTransparent = new QPushButton;
telexTransparent->setText( qtr( "Transparent" ) );
setupSmallButton( telexTransparent ); setupSmallButton( telexTransparent );
telexLayout->addWidget( telexTransparent ); telexLayout->addWidget( telexTransparent );
b_telexTransparent = false;
QSpinBox *telexPage = new QSpinBox; telexPage = new QSpinBox;
telexPage->setRange( 0, 999 ); telexPage->setRange( 0, 999 );
telexPage->setValue( 100 ); telexPage->setValue( 100 );
telexPage->setAccelerated( true ); telexPage->setAccelerated( true );
...@@ -489,12 +489,20 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -489,12 +489,20 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
telexLayout->addWidget( telexPage ); telexLayout->addWidget( telexPage );
controlLayout->addWidget( telexFrame, 1, 10, 2, 3, Qt::AlignBottom ); controlLayout->addWidget( telexFrame, 1, 10, 2, 3, Qt::AlignBottom );
telexFrame->hide(); telexFrame->hide(); /* default hidden */
CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(), CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(),
telexGotoPage( int ) ); telexGotoPage( int ) );
BUTTON_SET_ACT_I( telexOn, "", tv.png, qtr( "Teletext on" ),
toggleTeletext() );
CONNECT( telexOn, clicked( bool ), THEMIM->getIM(), CONNECT( telexOn, clicked( bool ), THEMIM->getIM(),
telexToggle( bool ) ); telexToggle( bool ) );
telexTransparent->setEnabled( false );
telexPage->setEnabled( false );
BUTTON_SET_ACT_I( telexTransparent, "", tvtelx.png, qtr( "Teletext" ),
toggleTeletextTransparency() );
CONNECT( telexTransparent, clicked( bool ), CONNECT( telexTransparent, clicked( bool ),
THEMIM->getIM(), telexSetTransparency( bool ) ); THEMIM->getIM(), telexSetTransparency( bool ) );
CONNECT( THEMIM->getIM(), teletextEnabled( bool ), CONNECT( THEMIM->getIM(), teletextEnabled( bool ),
...@@ -627,6 +635,39 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -627,6 +635,39 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
ControlsWidget::~ControlsWidget() ControlsWidget::~ControlsWidget()
{} {}
void ControlsWidget::toggleTeletext()
{
bool b_enabled = THEMIM->teletextState();
if( b_telexEnabled )
{
telexTransparent->setEnabled( false );
telexPage->setEnabled( false );
b_telexEnabled = false;
}
else if( b_enabled )
{
telexTransparent->setEnabled( true );
telexPage->setEnabled( true );
b_telexEnabled = true;
}
}
void ControlsWidget::toggleTeletextTransparency()
{
if( b_telexTransparent )
{
telexTransparent->setIcon( QIcon( ":/pixmaps/tvtelx.png" ) );
telexTransparent->setToolTip( qtr( "Teletext" ) );
b_telexTransparent = false;
}
else
{
telexTransparent->setIcon( QIcon( ":/pixmaps/tvtelx-transparent.png" ) );
telexTransparent->setToolTip( qtr( "Transparent" ) );
b_telexTransparent = true;
}
}
void ControlsWidget::stop() void ControlsWidget::stop()
{ {
THEMIM->stop(); THEMIM->stop();
......
...@@ -195,6 +195,8 @@ protected: ...@@ -195,6 +195,8 @@ protected:
InputSlider *slider; InputSlider *slider;
QPushButton *prevSectionButton, *nextSectionButton, *menuButton; QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
QPushButton *playButton, *fullscreenButton, *extSettingsButton; QPushButton *playButton, *fullscreenButton, *extSettingsButton;
QPushButton *telexTransparent;
QSpinBox *telexPage;
QToolButton *slowerButton, *fasterButton; QToolButton *slowerButton, *fasterButton;
QHBoxLayout *controlButLayout; QHBoxLayout *controlButLayout;
AdvControlsWidget *advControls; AdvControlsWidget *advControls;
...@@ -203,6 +205,8 @@ protected: ...@@ -203,6 +205,8 @@ protected:
VolumeClickHandler *hVolLabel; VolumeClickHandler *hVolLabel;
bool b_advancedVisible; bool b_advancedVisible;
bool b_telexTransparent;
bool b_telexEnabled;
protected slots: protected slots:
void play(); void play();
void stop(); void stop();
...@@ -216,6 +220,8 @@ protected slots: ...@@ -216,6 +220,8 @@ protected slots:
void faster(); void faster();
void slower(); void slower();
void toggleAdvanced(); void toggleAdvanced();
void toggleTeletext();
void toggleTeletextTransparency();
signals: signals:
void advancedControlsToggled( bool ); void advancedControlsToggled( bool );
}; };
......
...@@ -610,6 +610,26 @@ void MainInputManager::togglePlayPause() ...@@ -610,6 +610,26 @@ void MainInputManager::togglePlayPause()
getIM()->togglePlayPause(); getIM()->togglePlayPause();
} }
bool MainInputManager::teletextState()
{
im = getIM();
if( im->hasInput() )
{
vlc_value_t val;
vlc_object_t *p_vbi;
p_vbi = (vlc_object_t *) vlc_object_find_name( getInput(),
"zvbi", FIND_ANYWHERE );
if( p_vbi )
{
vlc_object_release( p_vbi );
return true;
}
var_Change( getInput(), "spu-es", VLC_VAR_CHOICESCOUNT, &val, NULL );
return (val.i_int > 0);
}
return false;
}
/* Static callbacks */ /* Static callbacks */
/* IM */ /* IM */
......
...@@ -149,6 +149,7 @@ private: ...@@ -149,6 +149,7 @@ private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
static MainInputManager *instance; static MainInputManager *instance;
public slots: public slots:
bool teletextState();
void togglePlayPause(); void togglePlayPause();
void stop(); void stop();
void next(); void next();
......
modules/gui/qt4/pixmaps/tvtelx.png

274 Bytes | W: | H:

modules/gui/qt4/pixmaps/tvtelx.png

325 Bytes | W: | H:

modules/gui/qt4/pixmaps/tvtelx.png
modules/gui/qt4/pixmaps/tvtelx.png
modules/gui/qt4/pixmaps/tvtelx.png
modules/gui/qt4/pixmaps/tvtelx.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
<file>pixmaps/playlist_shuffle_off.png</file> <file>pixmaps/playlist_shuffle_off.png</file>
<file>pixmaps/playlist_shuffle_on.png</file> <file>pixmaps/playlist_shuffle_on.png</file>
<file>pixmaps/play.png</file> <file>pixmaps/play.png</file>
<file>pixmaps/tvtelx-transparent.png</file>
<file>pixmaps/tvtelx.png</file>
<file>pixmaps/tv.png</file>
<file>pixmaps/previous_16px.png</file> <file>pixmaps/previous_16px.png</file>
<file>pixmaps/previous.png</file> <file>pixmaps/previous.png</file>
<file>pixmaps/record_16px.png</file> <file>pixmaps/record_16px.png</file>
......
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