Commit 5af20362 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - fix the assert bug on releasing the Video. There are other to do, but I...

Qt4 - fix the assert bug on releasing the Video. There are other to do, but I don't have time this WE, but here is the way to do it correctly.
funman ? :D


parent 425c5899
...@@ -88,6 +88,7 @@ QSize VideoWidget::sizeHint() const ...@@ -88,6 +88,7 @@ QSize VideoWidget::sizeHint() const
void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y, void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
unsigned int *pi_width, unsigned int *pi_height ) unsigned int *pi_width, unsigned int *pi_height )
{ {
show();
if( p_vout ) if( p_vout )
{ {
msg_Dbg( p_intf, "embedded video already in use" ); msg_Dbg( p_intf, "embedded video already in use" );
...@@ -326,25 +327,26 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) : ...@@ -326,25 +327,26 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
/** Slower and faster Buttons **/ /** Slower and faster Buttons **/
slowerButton = new QPushButton( "S" ); slowerButton = new QPushButton( "S" );
slowerButton->setFlat( true );
BUTTON_SET_ACT( slowerButton, "S", qtr( "Slower" ), slower() ); BUTTON_SET_ACT( slowerButton, "S", qtr( "Slower" ), slower() );
controlLayout->addWidget( slowerButton, 0, 0 ); controlLayout->addWidget( slowerButton, 0, 0 );
slowerButton->setMaximumSize( QSize( 26, 20 ) ); slowerButton->setMaximumSize( QSize( 26, 20 ) );
fasterButton = new QPushButton( "F" ); fasterButton = new QPushButton( "F" );
fasterButton->setFlat( true );
BUTTON_SET_ACT( fasterButton, "F", qtr( "Faster" ), faster() ); BUTTON_SET_ACT( fasterButton, "F", qtr( "Faster" ), faster() );
controlLayout->addWidget( fasterButton, 0, 17 ); controlLayout->addWidget( fasterButton, 0, 17 );
fasterButton->setMaximumSize( QSize( 26, 20 ) ); fasterButton->setMaximumSize( QSize( 26, 20 ) );
/** TODO: Insert here the AdvControls Widget
* Then fix all the size issues in main_interface.cpp
**/
/* advanced Controls handling */ /* advanced Controls handling */
b_advancedVisible = b_advControls; b_advancedVisible = b_advControls;
advControls = new AdvControlsWidget( p_intf ); advControls = new AdvControlsWidget( p_intf );
controlLayout->addWidget( advControls, 1, 3, 2, 5, Qt::AlignBottom ); controlLayout->addWidget( advControls, 1, 3, 2, 5, Qt::AlignBottom );
if( !b_advancedVisible ) advControls->hide(); if( !b_advancedVisible ) advControls->hide();
//THIS should be removed. need_components_update = true; // FIXME THIS should be removed. need_components_update = true;
/** Disc and Menus handling */ /** Disc and Menus handling */
discFrame = new QFrame( this ); discFrame = new QFrame( this );
...@@ -400,7 +402,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) : ...@@ -400,7 +402,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
playButton->setMinimumSize( QSize( 45, 45 ) ); playButton->setMinimumSize( QSize( 45, 45 ) );
playButton->setIconSize( QSize( 30, 30 ) ); playButton->setIconSize( QSize( 30, 30 ) );
controlLayout->addWidget( playButton, 2, 0, 2, 2, Qt::AlignBottom ); controlLayout->addWidget( playButton, 2, 0, 2, 2 );
controlLayout->setColumnMinimumWidth( 2, 20 ); controlLayout->setColumnMinimumWidth( 2, 20 );
controlLayout->setColumnStretch( 2, 0 ); controlLayout->setColumnStretch( 2, 0 );
......
...@@ -115,16 +115,6 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -115,16 +115,6 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
QListView *fileListView = findChildren<QListView*>().first(); QListView *fileListView = findChildren<QListView*>().first();
#if WIN32
/* QFileDialog is quite buggy make it brerable on win32 by tweaking
the followin */
fileListView->setLayoutMode(QListView::Batched);
fileListView->setViewMode(QListView::ListMode);
fileListView->setResizeMode(QListView::Adjust);
fileListView->setUniformItemSizes(false);
fileListView->setFlow(QListView::TopToBottom);
fileListView->setWrapping(true);
#endif
// Hide the subtitles control by default. // Hide the subtitles control by default.
ui.subFrame->hide(); ui.subFrame->hide();
......
...@@ -199,7 +199,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -199,7 +199,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Init input manager */ /* Init input manager */
MainInputManager::getInstance( p_intf ); MainInputManager::getInstance( p_intf );
ON_TIMEOUT( updateOnTimer() ); ON_TIMEOUT( updateOnTimer() );
ON_TIMEOUT( debug() ); // ON_TIMEOUT( debug() );
/******************** /********************
...@@ -367,6 +367,8 @@ void MainInterface::handleMainUi( QSettings *settings ) ...@@ -367,6 +367,8 @@ void MainInterface::handleMainUi( QSettings *settings )
p_intf->pf_request_window = ::DoRequest; p_intf->pf_request_window = ::DoRequest;
p_intf->pf_release_window = ::DoRelease; p_intf->pf_release_window = ::DoRelease;
p_intf->pf_control_window = ::DoControl; p_intf->pf_control_window = ::DoControl;
CONNECT( this, askVideoToHide(), videoWidget, hide() );
} }
/* Finish the sizing */ /* Finish the sizing */
...@@ -443,10 +445,29 @@ void MainInterface::showSpeedMenu( QPoint pos ) ...@@ -443,10 +445,29 @@ void MainInterface::showSpeedMenu( QPoint pos )
/**************************************************************************** /****************************************************************************
* Video Handling * Video Handling
****************************************************************************/ ****************************************************************************/
class SetVideoOnTopQtEvent : public QEvent
{
public:
SetVideoOnTopQtEvent( bool _onTop ) :
QEvent( (QEvent::Type)SetVideoOnTopEvent_Type ), onTop( _onTop)
{
}
bool OnTop() const
{
return onTop;
}
private:
bool onTop;
};
void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
int *pi_y, unsigned int *pi_width, int *pi_y, unsigned int *pi_width,
unsigned int *pi_height ) unsigned int *pi_height )
{ {
msg_Dbg( p_intf, "I was here" );
void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height ); void *ret = videoWidget->request( p_nvout,pi_x, pi_y, pi_width, pi_height );
if( ret ) if( ret )
{ {
...@@ -482,38 +503,19 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, ...@@ -482,38 +503,19 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
void MainInterface::releaseVideo( void *p_win ) void MainInterface::releaseVideo( void *p_win )
{ {
videoWidget->release( p_win ); videoWidget->release( p_win );
videoWidget->widgetSize = QSize( 0, 0 ); emit askVideoToHide();
videoWidget->resize( videoWidget->widgetSize );
if( embeddedPlaylistWasActive ) if( bgWidget )
playlistWidget->show();
else if( bgWidget )
bgWidget->show(); bgWidget->show();
videoIsActive = false; videoIsActive = false;
need_components_update = true; need_components_update = true;
} }
class SetVideoOnTopQtEvent : public QEvent
{
public:
SetVideoOnTopQtEvent( bool _onTop ) :
QEvent( (QEvent::Type)SetVideoOnTopEvent_Type ), onTop( _onTop)
{
}
bool OnTop() const
{
return onTop;
}
private:
bool onTop;
};
int MainInterface::controlVideo( void *p_window, int i_query, va_list args ) int MainInterface::controlVideo( void *p_window, int i_query, va_list args )
{ {
int i_ret = VLC_EGENERIC; int i_ret = VLC_EGENERIC;
msg_Dbg( p_intf, "I was there" );
switch( i_query ) switch( i_query )
{ {
case VOUT_GET_SIZE: case VOUT_GET_SIZE:
...@@ -530,7 +532,7 @@ int MainInterface::controlVideo( void *p_window, int i_query, va_list args ) ...@@ -530,7 +532,7 @@ int MainInterface::controlVideo( void *p_window, int i_query, va_list args )
unsigned int i_width = va_arg( args, unsigned int ); unsigned int i_width = va_arg( args, unsigned int );
unsigned int i_height = va_arg( args, unsigned int ); unsigned int i_height = va_arg( args, unsigned int );
videoWidget->widgetSize = QSize( i_width, i_height ); videoWidget->widgetSize = QSize( i_width, i_height );
// videoWidget->updateGeometry(); videoWidget->updateGeometry();
need_components_update = true; need_components_update = true;
i_ret = VLC_SUCCESS; i_ret = VLC_SUCCESS;
break; break;
......
...@@ -152,6 +152,8 @@ private slots: ...@@ -152,6 +152,8 @@ private slots:
void updateSystrayTooltipName( QString ); void updateSystrayTooltipName( QString );
void updateSystrayTooltipStatus( int ); void updateSystrayTooltipStatus( int );
void showSpeedMenu( QPoint ); void showSpeedMenu( QPoint );
signals:
void askVideoToHide();
}; };
#endif #endif
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