diff --git a/source/app/ModulesHandle.cpp b/source/app/ModulesHandle.cpp index 31ecc94..9236e85 100644 --- a/source/app/ModulesHandle.cpp +++ b/source/app/ModulesHandle.cpp @@ -81,8 +81,6 @@ SubWindowHandle* ModulesHandle::toggleSelectedModuleIf() { QString windowName; interfaceChild = new SubWindowHandle( m_pcParent ); - pcSubWindow->setModuleSubWindow( interfaceChild ); - pcSubWindow->enableModule( currModuleIf ); windowName.append( pcSubWindow->userFriendlyCurrentFile() ); windowName.append( " [" ); windowName.append( currModuleIf->m_cModuleDef.m_pchModuleName ); @@ -93,12 +91,8 @@ SubWindowHandle* ModulesHandle::toggleSelectedModuleIf() currModuleIf->m_pcDisplaySubWindow = interfaceChild; currModuleIf->m_pcDisplaySubWindow->setModule( currModuleIf ); } - else - { - pcSubWindow->enableModule( currModuleIf ); - currModuleIf->m_pcDisplaySubWindow = pcSubWindow; - } currModuleIf->m_pcSubWindow = pcSubWindow; + pcSubWindow->enableModule( currModuleIf ); } else { @@ -122,7 +116,10 @@ PlaYUVerFrame* ModulesHandle::applyModuleIf( PlaYUVerModuleIf *pcCurrModuleIf ) case MODULE_REQUIRES_THREE_FRAMES: break; } - pcCurrModuleIf->m_pcDisplaySubWindow->setCurrFrame( processedFrame ); + if( pcCurrModuleIf->m_pcDisplaySubWindow ) + pcCurrModuleIf->m_pcDisplaySubWindow->setCurrFrame( processedFrame ); + else + pcCurrModuleIf->m_pcSubWindow->setCurrFrame( processedFrame ); return processedFrame; } diff --git a/source/app/PropertiesSidebar.cpp b/source/app/PropertiesSidebar.cpp index 428cffa..bbc9514 100755 --- a/source/app/PropertiesSidebar.cpp +++ b/source/app/PropertiesSidebar.cpp @@ -549,7 +549,7 @@ Void FramePropertiesSideBar::stopHistogram() void FramePropertiesSideBar::slotUpdateDataHistogram() { - if( m_pcFrame && isVisible() ) + if( m_pcFrame->isValid() && isVisible() ) { // If a selection area is done in Image Editor and if the current // image is the same in Image Viewer, then compute too the histogram diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index 784b897..b3d28bb 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -56,7 +56,6 @@ SubWindowHandle::SubWindowHandle( QWidget * parent ) : //m_pCurrStream = new InputStream; m_pcCurrFrame = NULL; m_pcCurrentModule = NULL; - m_pcModuleSubWindow = NULL; m_cWindowName = QString( " " ); m_bIsPlaying = false; @@ -132,7 +131,6 @@ Void SubWindowHandle::disableModule() { PlaYUVerModuleIf* pcCurrentModule = m_pcCurrentModule; m_pcCurrentModule = NULL; - m_pcModuleSubWindow = NULL; ModulesHandle::destroyModuleIf( pcCurrentModule ); refreshFrame(); } @@ -151,16 +149,12 @@ Void SubWindowHandle::refreshFrame() m_pcCurrFrame = m_pCurrStream->getCurrFrame(); if( m_pcCurrentModule ) { - if( m_pcModuleSubWindow ) - { - m_pcModuleSubWindow->setCurrFrame( m_pcCurrentModule->process( m_pcCurrFrame ) ); - } - else - { - m_pcCurrFrame = m_pcCurrentModule->process( m_pcCurrFrame ); - } + ModulesHandle::applyModuleIf( m_pcCurrentModule ); + } + else + { + m_cViewArea->setImage( m_pcCurrFrame ); } - m_cViewArea->setImage( m_pcCurrFrame ); } } diff --git a/source/app/SubWindowHandle.h b/source/app/SubWindowHandle.h index 1383e29..ccf85ba 100644 --- a/source/app/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -51,7 +51,6 @@ private: ViewArea* m_cViewArea; PlaYUVerModuleIf* m_pcCurrentModule; - SubWindowHandle* m_pcModuleSubWindow; InputStream* m_pCurrStream; PlaYUVerFrame* m_pcCurrFrame; @@ -103,10 +102,6 @@ public: { return m_cViewArea; } - Void setModuleSubWindow( SubWindowHandle* pcWindow ) - { - m_pcModuleSubWindow = pcWindow; - } Void setModule( PlaYUVerModuleIf* pcCurrentModule ) { m_pcCurrentModule = pcCurrentModule; diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index dec355e..5aacfce 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -239,6 +239,8 @@ void plaYUVerApp::selectModule( QAction *curr_action ) interfaceChild->zoomToFit(); interfaceChild->getViewArea()->setTool( m_appTool ); } + if( activeSubWindow() ) + m_pcCurrentSubWindow = activeSubWindow(); updateFrameProperties(); return; }