From 0ccf12a7b3ee2c41d0b1054242eb33040815eec8 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 10 May 2014 03:10:15 +0100 Subject: [PATCH] Minor changes in the ModulesHandle interface without functionality changes --- source/app/ModulesHandle.cpp | 14 ++++++++------ source/app/ModulesHandle.h | 10 +++++----- source/app/plaYUVerApp.cpp | 10 +++++----- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/source/app/ModulesHandle.cpp b/source/app/ModulesHandle.cpp index 426906f..af56d0a 100644 --- a/source/app/ModulesHandle.cpp +++ b/source/app/ModulesHandle.cpp @@ -41,14 +41,15 @@ Void ModulesHandle::ModulesList( Bool bCreate ) } -ModulesHandle::ModulesHandle( QWidget * parent ) +ModulesHandle::ModulesHandle( QWidget * parent, QMdiArea *mdiArea ) : + QObject( parent ), + m_pcParent( parent ), + m_pcMdiArea( mdiArea ), + m_uiModulesCount( 0 ), + m_uiModuleSelected( -1 ) { - m_pcParent = parent; - // configure class setParent( m_pcParent ); - m_uiModulesCount = 0; - m_uiModuleSelected = -1; ModulesList( true ); } @@ -67,9 +68,10 @@ void ModulesHandle::selectModule( int index ) m_uiModuleSelected = index; } -SubWindowHandle* ModulesHandle::toggleSelectedModuleIf( SubWindowHandle* pcSubWindow ) +SubWindowHandle* ModulesHandle::toggleSelectedModuleIf() { Bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked(); + SubWindowHandle* pcSubWindow = qobject_cast( m_pcMdiArea->activeSubWindow() ); SubWindowHandle* interfaceChild = NULL; PlaYUVerModuleIf* currModuleIf = NULL; diff --git a/source/app/ModulesHandle.h b/source/app/ModulesHandle.h index 9fdedab..a9a6ec1 100644 --- a/source/app/ModulesHandle.h +++ b/source/app/ModulesHandle.h @@ -48,18 +48,19 @@ class ModulesHandle: public QObject { Q_OBJECT public: - ModulesHandle( QWidget * parent = 0 ); + ModulesHandle( QWidget * parent = 0, QMdiArea *mdiArea = 0 ); ~ModulesHandle(); QMenu* createMenus( QMenuBar *MainAppMenuBar ); Void updateMenus( Bool hasSubWindow ); - SubWindowHandle* toggleSelectedModuleIf( SubWindowHandle* pcSubWindow ); + SubWindowHandle* toggleSelectedModuleIf(); private: QWidget *m_pcParent; - + QMdiArea *m_pcMdiArea; UInt m_uiModulesCount; Int m_uiModuleSelected; + QMenu* m_pcModulesMenu; QList m_pcModulesSubMenuList; QList m_pcPlaYUVerModules; @@ -68,7 +69,7 @@ private: enum MODULES_ACTION_LIST { - FORCE_NEW_WINDOW_ACT=0, + FORCE_NEW_WINDOW_ACT = 0, DISABLE_ALL_ACT, MODULES_TOTAL_ACT }; @@ -78,7 +79,6 @@ private: Void ModulesList( Bool bCreate ); Void destroyModuleIf( PlaYUVerModuleIf* pcCurrModuleIf ); - private Q_SLOTS: void selectModule( int index ); void destroyAllModulesIf(); diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 06f6790..26e4891 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -54,7 +54,7 @@ plaYUVerApp::plaYUVerApp() mapperWindow = new QSignalMapper( this ); connect( mapperWindow, SIGNAL( mapped(QWidget*) ), this, SLOT( setActiveSubWindow(QWidget*) ) ); - m_pcModulesHandle = new ModulesHandle( this ); + m_pcModulesHandle = new ModulesHandle( this, mdiArea ); createActions(); createToolBars(); @@ -230,7 +230,7 @@ void plaYUVerApp::closeAll() void plaYUVerApp::selectModule( QAction *curr_action ) { - SubWindowHandle *interfaceChild = m_pcModulesHandle->toggleSelectedModuleIf( m_pcCurrentSubWindow ); + SubWindowHandle *interfaceChild = m_pcModulesHandle->toggleSelectedModuleIf(); if( interfaceChild ) { mdiArea->addSubWindow( interfaceChild ); @@ -303,7 +303,7 @@ UInt plaYUVerApp::getMaxFrameNumber() UInt maxFrames = INT_MAX; for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) { - currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum(); + currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum(); if( currFrames < maxFrames ) maxFrames = currFrames; } @@ -540,9 +540,9 @@ void plaYUVerApp::videoSelectionButtonEvent() { DialogSubWindowSelector dialogWindowsSelection( this, mdiArea ); QStringList cWindowListNames; - for(Int i=0; igetWindowName() ); + cWindowListNames.append( m_acPlayingSubWindows.at( i )->getWindowName() ); dialogWindowsSelection.setSubWindowList( cWindowListNames ); } if( dialogWindowsSelection.exec() == QDialog::Accepted )