Commit 19a891e2 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - small fixes... Remove one redondant connect, block the access to the...

Qt4 - small fixes... Remove one redondant connect, block the access to the speedSlider if there is no input.

parent e1bc46e7
...@@ -148,11 +148,11 @@ QSize VideoWidget::sizeHint() const ...@@ -148,11 +148,11 @@ QSize VideoWidget::sizeHint() const
#define MAX_BG_SIZE 400 #define MAX_BG_SIZE 400
#define MIN_BG_SIZE 64 #define MIN_BG_SIZE 64
BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) : BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
QWidget( NULL ), p_intf( _p_i ) :QWidget( NULL ), p_intf( _p_i )
{ {
/* We should use that one to take the more size it can */ /* We should use that one to take the more size it can */
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); // setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
/* A dark background */ /* A dark background */
setAutoFillBackground( true ); setAutoFillBackground( true );
...@@ -179,13 +179,20 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) : ...@@ -179,13 +179,20 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) :
backgroundLayout->setColumnStretch( 2, 1 ); backgroundLayout->setColumnStretch( 2, 1 );
CONNECT( THEMIM->getIM(), artChanged( QString ), this, update( QString ) ); CONNECT( THEMIM->getIM(), artChanged( QString ), this, update( QString ) );
resize( 300, 150 );
} }
BackgroundWidget::~BackgroundWidget() BackgroundWidget::~BackgroundWidget()
{ {
} }
void BackgroundWidget::resizeEvent( QResizeEvent * event )
{
if( event->size().height() <= MIN_BG_SIZE )
label->hide();
else
label->show();
}
void BackgroundWidget::update( QString url ) void BackgroundWidget::update( QString url )
{ {
if( url.isNull() ) if( url.isNull() )
...@@ -613,7 +620,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -613,7 +620,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) ); CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) ); CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) );
CONNECT( THEMIM->getIM(), statusChanged( int ), this, updateInput() );
updateInput(); updateInput();
} }
...@@ -828,6 +834,11 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) : ...@@ -828,6 +834,11 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) :
SpeedControlWidget::~SpeedControlWidget() SpeedControlWidget::~SpeedControlWidget()
{} {}
void SpeedControlWidget::setEnable( bool b_enable )
{
speedSlider->setEnabled( b_enable );
}
void SpeedControlWidget::mouseDoubleClickEvent( QMouseEvent * event ) void SpeedControlWidget::mouseDoubleClickEvent( QMouseEvent * event )
{ {
resetRate(); resetRate();
......
...@@ -91,7 +91,7 @@ private: ...@@ -91,7 +91,7 @@ private:
QLabel *label; QLabel *label;
virtual void contextMenuEvent( QContextMenuEvent *event ); virtual void contextMenuEvent( QContextMenuEvent *event );
intf_thread_t *p_intf; intf_thread_t *p_intf;
virtual void resizeEvent( QResizeEvent * event );
public slots: public slots:
void toggle(){ TOGGLEV( this ); } void toggle(){ TOGGLEV( this ); }
void update( QString ); void update( QString );
...@@ -252,6 +252,8 @@ protected: ...@@ -252,6 +252,8 @@ protected:
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
QSlider *speedSlider; QSlider *speedSlider;
public slots:
void setEnable( bool );
private slots: private slots:
void updateRate( int ); void updateRate( int );
void resetRate(); void resetRate();
......
...@@ -904,6 +904,10 @@ void MainInterface::setStatus( int status ) ...@@ -904,6 +904,10 @@ void MainInterface::setStatus( int status )
{ {
/* Forward the status to the controls to toggle Play/Pause */ /* Forward the status to the controls to toggle Play/Pause */
controls->setStatus( status ); controls->setStatus( status );
controls->updateInput();
speedControl->setEnable( THEMIM->getIM()->hasInput() );
/* And in the systray for the menu */ /* And in the systray for the menu */
if( sysTray ) if( sysTray )
QVLCMenu::updateSystrayMenu( this, p_intf ); QVLCMenu::updateSystrayMenu( this, p_intf );
......
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