From 5e4af61da6484f3b91f93ccc6aefd104544d0731 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 9 Mar 2015 00:08:36 +0000 Subject: [PATCH] Minor fixes in modules handle --- app/ModulesHandle.cpp | 24 ++++++++++++------------ app/VideoSubWindow.h | 5 +++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index d481017..89f512c 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -164,16 +164,18 @@ Void ModulesHandle::updateMenus() if( pcSubWindow ) { QList apcCurrentModule = pcSubWindow->getModuleArray(); + if( pcSubWindow->getDisplayModule() ) + { + m_arrayActions[APPLY_ALL_ACT]->setEnabled( true ); + m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true ); + apcCurrentModule.append( pcSubWindow->getDisplayModule() ); + } for( Int i = 0; i < apcCurrentModule.size(); i++ ) { currModuleAction = apcCurrentModule.at( i )->m_pcModuleAction; currModuleAction->setChecked( true ); } - if( apcCurrentModule.size() ) - { - m_arrayActions[APPLY_ALL_ACT]->setEnabled( true ); - m_arrayActions[SWAP_FRAMES_ACT]->setEnabled( true ); - } + } } @@ -194,10 +196,10 @@ Void ModulesHandle::processOpt( Int index ) VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( pcSubWindow ) { - QList apcCurrentModule = pcSubWindow->getModuleArray(); - if( apcCurrentModule.size() > 1 ) + PlaYUVerAppModuleIf* pcCurrentModule = pcSubWindow->getDisplayModule(); + if( pcCurrentModule ) { - PlaYUVerAppModuleIf* pcCurrModule = apcCurrentModule.at( 0 ); + PlaYUVerAppModuleIf* pcCurrModule = pcCurrentModule; switch( index ) { case INVALID_OPT: @@ -304,11 +306,10 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) pcModuleSubWindow->setWindowName( windowName ); connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) ); - connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) ); + connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, + SLOT( zoomToFactorAll( double, QPoint ) ) ); connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) ); - - pcCurrModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow; } @@ -468,7 +469,6 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) } supported.append( " )" ); - QStringList filter; filter << supported << formatsList diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index fd9c2e5..eb8ec66 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -179,6 +179,11 @@ public: Void disableModule( PlaYUVerAppModuleIf* pcModule = NULL ); Void associateModule( PlaYUVerAppModuleIf* pcModule ); + PlaYUVerAppModuleIf* getDisplayModule() + { + return m_pcCurrentDisplayModule; + } + QList getModuleArray() { return m_apcCurrentModule;