diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 45fcd8f..b407121 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -425,6 +425,14 @@ Bool ModulesHandle::applyModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf, Bool isP { Bool bRet = false; QApplication::setOverrideCursor( Qt::WaitCursor ); + if( pcCurrModuleIf->m_pcDisplaySubWindow ) + { + pcCurrModuleIf->m_pcDisplaySubWindow->setFillWindow( true ); + } + else + { + pcCurrModuleIf->m_pcSubWindow[0]->setFillWindow( true ); + } if( !( isPlaying && ( pcCurrModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_SKIP_WHILE_PLAY ) ) ) { #ifdef PLAYUVER_THREADED_MODULES @@ -535,11 +543,13 @@ Void ModulesHandle::showModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) if( pcCurrModuleIf->m_pcDisplaySubWindow ) { pcCurrModuleIf->m_pcDisplaySubWindow->setCurrFrame( pcCurrModuleIf->m_pcProcessedFrame ); + pcCurrModuleIf->m_pcDisplaySubWindow->setFillWindow( false ); pcCurrModuleIf->m_pcDisplaySubWindow->clearWindowBusy(); } else { pcCurrModuleIf->m_pcSubWindow[0]->setCurrFrame( pcCurrModuleIf->m_pcProcessedFrame ); + pcCurrModuleIf->m_pcSubWindow[0]->setFillWindow( false ); pcCurrModuleIf->m_pcSubWindow[0]->clearWindowBusy(); } break; diff --git a/app/PlaYUVerSubWindowHandle.cpp b/app/PlaYUVerSubWindowHandle.cpp index 1f31a0a..6fc6399 100644 --- a/app/PlaYUVerSubWindowHandle.cpp +++ b/app/PlaYUVerSubWindowHandle.cpp @@ -116,6 +116,7 @@ Void PlaYUVerSubWindowHandle::resetWindowMode() m_apcMdiSubWindowList.clear(); if( m_pcMdiArea ) delete m_pcMdiArea; + m_pcMdiArea = NULL; if( m_pcWindowManagerLayout ) delete m_pcWindowManagerLayout; diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index d14a32a..7b1ca90 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -93,13 +93,17 @@ class VideoInformation: public QWidget private: QList m_cTopLeftTextList; QFont m_cTopLeftTextFont; + QFont m_cCenterTextFont; + Bool m_bBusyWindow; public: VideoInformation( QWidget *parent ) : - QWidget( parent ) + QWidget( parent ), + m_bBusyWindow( false ) { setPalette( Qt::transparent ); setAttribute( Qt::WA_TransparentForMouseEvents ); m_cTopLeftTextFont.setPointSize( 8 ); + m_cCenterTextFont.setPointSize( 12 ); } Void setInformationTopLeft( const QStringList& textLines ) { @@ -109,6 +113,10 @@ public: m_cTopLeftTextList.append( textLines.at( i ) ); } } + Void setBusyWindow( Bool bFlag ) + { + m_bBusyWindow = bFlag; + } protected: void paintEvent( QPaintEvent *event ) { @@ -123,6 +131,12 @@ protected: topLeftCorner += QPoint( 0, 15 ); } } + if( m_bBusyWindow ) + { + painter.setFont( m_cCenterTextFont ); + painter.drawText( rect(), Qt::AlignHCenter | Qt::AlignVCenter, QStringLiteral( "Refreshing..." ) ); + painter.fillRect( rect(), QBrush( QColor::fromRgb( 255, 255, 255, 50 ), Qt::SolidPattern ) ); + } } }; @@ -165,6 +179,10 @@ VideoSubWindow::VideoSubWindow( enum VideoSubWindowCategories category, QWidget m_apcCurrentModule.clear(); + m_pcUpdateTimer = new QTimer(); + m_pcUpdateTimer->setInterval( 800 ); + connect( m_pcUpdateTimer, SIGNAL( timeout() ), this, SLOT( updateWindowOnTimeout() ) ); + //! Add video information m_pcVideoInfo = new VideoInformation( this ); } @@ -493,6 +511,10 @@ Void VideoSubWindow::associateModule( PlaYUVerAppModuleIf* pcModule ) m_apcCurrentModule.append( pcModule ); } +Void VideoSubWindow::setFillWindow( Bool bFlag ) +{ + m_pcVideoInfo->setBusyWindow( bFlag ); +} Void VideoSubWindow::setCurrFrame( PlaYUVerFrame* pcCurrFrame ) { // if( m_pcCurrFrame ) @@ -871,6 +893,10 @@ QSize VideoSubWindow::sizeHint( const QSize & maxSize ) const return isize; } +Void VideoSubWindow::updateWindowOnTimeout() +{ + m_pcVideoInfo->update(); +} Void VideoSubWindow::resizeEvent( QResizeEvent* event ) { m_pcVideoInfo->resize( event->size() ); diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 1a86bd5..d51ee5c 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -95,6 +95,7 @@ private: Bool m_bIsPlaying; + QTimer* m_pcUpdateTimer; /** * Threads variables * QtConcurrent @@ -257,11 +258,14 @@ public: m_bWindowBusy = false; } + Void setFillWindow( Bool bFlag ); + protected: Void resizeEvent( QResizeEvent* event ); //void closeEvent( QCloseEvent *event ); public Q_SLOTS: + void updateWindowOnTimeout(); void adjustScrollBarByScale( double scale, QPoint center ); void adjustScrollBarByOffset( QPoint Offset ); void updateCurScrollValues();