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
void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
unsigned int *pi_width, unsigned int *pi_height )
{
show();
if( p_vout )
{
msg_Dbg( p_intf, "embedded video already in use" );
......@@ -326,25 +327,26 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
/** Slower and faster Buttons **/
slowerButton = new QPushButton( "S" );
slowerButton->setFlat( true );
BUTTON_SET_ACT( slowerButton, "S", qtr( "Slower" ), slower() );
controlLayout->addWidget( slowerButton, 0, 0 );
slowerButton->setMaximumSize( QSize( 26, 20 ) );
fasterButton = new QPushButton( "F" );
fasterButton->setFlat( true );
BUTTON_SET_ACT( fasterButton, "F", qtr( "Faster" ), faster() );
controlLayout->addWidget( fasterButton, 0, 17 );
fasterButton->setMaximumSize( QSize( 26, 20 ) );
/** TODO: Insert here the AdvControls Widget
* Then fix all the size issues in main_interface.cpp
**/
/* advanced Controls handling */
b_advancedVisible = b_advControls;
advControls = new AdvControlsWidget( p_intf );
controlLayout->addWidget( advControls, 1, 3, 2, 5, Qt::AlignBottom );
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 */
discFrame = new QFrame( this );
......@@ -400,7 +402,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
playButton->setMinimumSize( QSize( 45, 45 ) );
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->setColumnStretch( 2, 0 );
......
......@@ -115,16 +115,6 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
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.
ui.subFrame->hide();
......
......@@ -199,7 +199,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* Init input manager */
MainInputManager::getInstance( p_intf );
ON_TIMEOUT( updateOnTimer() );
ON_TIMEOUT( debug() );
// ON_TIMEOUT( debug() );
/********************
......@@ -367,6 +367,8 @@ void MainInterface::handleMainUi( QSettings *settings )
p_intf->pf_request_window = ::DoRequest;
p_intf->pf_release_window = ::DoRelease;
p_intf->pf_control_window = ::DoControl;
CONNECT( this, askVideoToHide(), videoWidget, hide() );
}
/* Finish the sizing */
......@@ -443,10 +445,29 @@ void MainInterface::showSpeedMenu( QPoint pos )
/****************************************************************************
* 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,
int *pi_y, unsigned int *pi_width,
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 );
if( ret )
{
......@@ -482,38 +503,19 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
void MainInterface::releaseVideo( void *p_win )
{
videoWidget->release( p_win );
videoWidget->widgetSize = QSize( 0, 0 );
videoWidget->resize( videoWidget->widgetSize );
emit askVideoToHide();
if( embeddedPlaylistWasActive )
playlistWidget->show();
else if( bgWidget )
if( bgWidget )
bgWidget->show();
videoIsActive = false;
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 i_ret = VLC_EGENERIC;
msg_Dbg( p_intf, "I was there" );
switch( i_query )
{
case VOUT_GET_SIZE:
......@@ -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_height = va_arg( args, unsigned int );
videoWidget->widgetSize = QSize( i_width, i_height );
// videoWidget->updateGeometry();
videoWidget->updateGeometry();
need_components_update = true;
i_ret = VLC_SUCCESS;
break;
......
......@@ -152,6 +152,8 @@ private slots:
void updateSystrayTooltipName( QString );
void updateSystrayTooltipStatus( int );
void showSpeedMenu( QPoint );
signals:
void askVideoToHide();
};
#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