Commit 8cc46013 authored by Thomas Guillem's avatar Thomas Guillem

qt: fix video moved to the art container when a first vout fails

If a vout probe fails, releaseVideoSlot() will be called with an input with a
valid Video. This will cause the showTab() method to stack the videoWidget into
the artContainer.
parent 856d2bc2
...@@ -626,10 +626,10 @@ void MainInterface::debug() ...@@ -626,10 +626,10 @@ void MainInterface::debug()
} }
inline void MainInterface::showVideo() { showTab( videoWidget ); } inline void MainInterface::showVideo() { showTab( videoWidget ); }
inline void MainInterface::restoreStackOldWidget() inline void MainInterface::restoreStackOldWidget( bool video_closing )
{ showTab( stackCentralOldWidget ); } { showTab( stackCentralOldWidget, video_closing ); }
inline void MainInterface::showTab( QWidget *widget ) inline void MainInterface::showTab( QWidget *widget, bool video_closing )
{ {
if ( !widget ) widget = bgWidget; /* trying to restore a null oldwidget */ if ( !widget ) widget = bgWidget; /* trying to restore a null oldwidget */
#ifdef DEBUG_INTF #ifdef DEBUG_INTF
...@@ -652,7 +652,7 @@ inline void MainInterface::showTab( QWidget *widget ) ...@@ -652,7 +652,7 @@ inline void MainInterface::showTab( QWidget *widget )
stackWidgetsSizes[stackCentralOldWidget] = stackCentralW->size(); stackWidgetsSizes[stackCentralOldWidget] = stackCentralW->size();
/* If we are playing video, embedded */ /* If we are playing video, embedded */
if( videoWidget && THEMIM->getIM()->hasVideo() ) if( !video_closing && videoWidget && THEMIM->getIM()->hasVideo() )
{ {
/* Video -> Playlist */ /* Video -> Playlist */
if( videoWidget == stackCentralOldWidget && widget == playlistWidget ) if( videoWidget == stackCentralOldWidget && widget == playlistWidget )
...@@ -695,7 +695,7 @@ inline void MainInterface::showTab( QWidget *widget ) ...@@ -695,7 +695,7 @@ inline void MainInterface::showTab( QWidget *widget )
#endif #endif
/* This part is done later, to account for the new pl size */ /* This part is done later, to account for the new pl size */
if( videoWidget && THEMIM->getIM()->hasVideo() && if( !video_closing && videoWidget && THEMIM->getIM()->hasVideo() &&
videoWidget == stackCentralOldWidget && widget == playlistWidget ) videoWidget == stackCentralOldWidget && widget == playlistWidget )
{ {
playlistWidget->artContainer->addWidget( videoWidget ); playlistWidget->artContainer->addWidget( videoWidget );
...@@ -789,7 +789,7 @@ void MainInterface::releaseVideoSlot( void ) ...@@ -789,7 +789,7 @@ void MainInterface::releaseVideoSlot( void )
hideResumePanel(); hideResumePanel();
if( stackCentralW->currentWidget() == videoWidget ) if( stackCentralW->currentWidget() == videoWidget )
restoreStackOldWidget(); restoreStackOldWidget( true );
else if( playlistWidget && else if( playlistWidget &&
playlistWidget->artContainer->currentWidget() == videoWidget ) playlistWidget->artContainer->currentWidget() == videoWidget )
{ {
......
...@@ -126,9 +126,9 @@ protected: ...@@ -126,9 +126,9 @@ protected:
void handleSystray(); void handleSystray();
/* Central StackWidget Management */ /* Central StackWidget Management */
void showTab( QWidget *); void showTab( QWidget *, bool video_closing = false );
void showVideo(); void showVideo();
void restoreStackOldWidget(); void restoreStackOldWidget( bool video_closing = false );
/* */ /* */
void displayNormalView(); void displayNormalView();
......
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