Add a disable all button in Modules Handle
This commit is contained in:
1 parent
341e921de4
commit
f5ece2ff31
2 files changed
+29
-7
No files matched your search
@@ -69,7 +69,7 @@ void ModulesHandle::selectModule( int index )
|
|||||||
|
|
||||||
SubWindowHandle* ModulesHandle::toggleSelectedModuleIf( SubWindowHandle* pcSubWindow )
|
SubWindowHandle* ModulesHandle::toggleSelectedModuleIf( SubWindowHandle* pcSubWindow )
|
||||||
{
|
{
|
||||||
Bool bShowModulesNewWindow = m_pcForceNewWindowAction->isChecked();
|
Bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked();
|
||||||
SubWindowHandle* interfaceChild = NULL;
|
SubWindowHandle* interfaceChild = NULL;
|
||||||
PlaYUVerModuleIf* currModuleIf = NULL;
|
PlaYUVerModuleIf* currModuleIf = NULL;
|
||||||
|
|
||||||
@@ -128,12 +128,22 @@ Void ModulesHandle::destroyModuleIf( PlaYUVerModuleIf *pcCurrModuleIf )
|
|||||||
pcCurrModuleIf->destroy();
|
pcCurrModuleIf->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Void ModulesHandle::destroyAllModulesIf()
|
||||||
|
{
|
||||||
|
for( Int i = 0; i < m_pcPlaYUVerModules.size(); i++ )
|
||||||
|
{
|
||||||
|
destroyModuleIf( m_pcPlaYUVerModules.at( i ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QMenu* ModulesHandle::createMenus( QMenuBar *MainAppMenuBar )
|
QMenu* ModulesHandle::createMenus( QMenuBar *MainAppMenuBar )
|
||||||
{
|
{
|
||||||
PlaYUVerModuleIf* currModuleIf;
|
PlaYUVerModuleIf* currModuleIf;
|
||||||
QAction* currAction;
|
QAction* currAction;
|
||||||
QMenu* currSubMenu;
|
QMenu* currSubMenu;
|
||||||
|
|
||||||
|
m_arrayActions.resize( MODULES_TOTAL_ACT );
|
||||||
|
|
||||||
m_pcActionMapper = new QSignalMapper( this );
|
m_pcActionMapper = new QSignalMapper( this );
|
||||||
connect( m_pcActionMapper, SIGNAL( mapped(int) ), this, SLOT( selectModule(int) ) );
|
connect( m_pcActionMapper, SIGNAL( mapped(int) ), this, SLOT( selectModule(int) ) );
|
||||||
|
|
||||||
@@ -178,12 +188,15 @@ QMenu* ModulesHandle::createMenus( QMenuBar *MainAppMenuBar )
|
|||||||
currModuleIf->m_pcAction = currAction;
|
currModuleIf->m_pcAction = currAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pcForceNewWindowAction = new QAction( "Use New Window", parent() );
|
m_arrayActions[DISABLE_ALL_ACT] = new QAction( "Disable All Modules", parent() );
|
||||||
m_pcForceNewWindowAction->setStatusTip( "Show module result in a new window. Some modules already force this feature" );
|
connect( m_arrayActions[DISABLE_ALL_ACT], SIGNAL( triggered() ), this, SLOT( destroyAllModulesIf() ) );
|
||||||
m_pcForceNewWindowAction->setCheckable( true );
|
m_arrayActions[FORCE_NEW_WINDOW_ACT] = new QAction( "Use New Window", parent() );
|
||||||
|
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setStatusTip( "Show module result in a new window. Some modules already force this feature" );
|
||||||
|
m_arrayActions[FORCE_NEW_WINDOW_ACT]->setCheckable( true );
|
||||||
|
|
||||||
m_pcModulesMenu->addSeparator();
|
m_pcModulesMenu->addSeparator();
|
||||||
m_pcModulesMenu->addAction( m_pcForceNewWindowAction );
|
m_pcModulesMenu->addAction( m_arrayActions[DISABLE_ALL_ACT] );
|
||||||
|
m_pcModulesMenu->addAction( m_arrayActions[FORCE_NEW_WINDOW_ACT] );
|
||||||
|
|
||||||
return m_pcModulesMenu;
|
return m_pcModulesMenu;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ public:
|
|||||||
QMenu* createMenus( QMenuBar *MainAppMenuBar );
|
QMenu* createMenus( QMenuBar *MainAppMenuBar );
|
||||||
Void updateMenus( Bool hasSubWindow );
|
Void updateMenus( Bool hasSubWindow );
|
||||||
SubWindowHandle* toggleSelectedModuleIf( SubWindowHandle* pcSubWindow );
|
SubWindowHandle* toggleSelectedModuleIf( SubWindowHandle* pcSubWindow );
|
||||||
Void destroyModuleIf( PlaYUVerModuleIf* pcCurrModuleIf );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *m_pcParent;
|
QWidget *m_pcParent;
|
||||||
@@ -66,13 +65,23 @@ private:
|
|||||||
QList<PlaYUVerModuleIf*> m_pcPlaYUVerModules;
|
QList<PlaYUVerModuleIf*> m_pcPlaYUVerModules;
|
||||||
QSignalMapper* m_pcActionMapper;
|
QSignalMapper* m_pcActionMapper;
|
||||||
QVector<QAction*> m_arrayModulesActions;
|
QVector<QAction*> m_arrayModulesActions;
|
||||||
QAction *m_pcForceNewWindowAction;
|
|
||||||
|
enum MODULES_ACTION_LIST
|
||||||
|
{
|
||||||
|
FORCE_NEW_WINDOW_ACT=0,
|
||||||
|
DISABLE_ALL_ACT,
|
||||||
|
MODULES_TOTAL_ACT
|
||||||
|
};
|
||||||
|
QVector<QAction*> m_arrayActions;
|
||||||
|
|
||||||
Void appendModule( PlaYUVerModuleIf* );
|
Void appendModule( PlaYUVerModuleIf* );
|
||||||
Void ModulesList( Bool bCreate );
|
Void ModulesList( Bool bCreate );
|
||||||
|
Void destroyModuleIf( PlaYUVerModuleIf* pcCurrModuleIf );
|
||||||
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void selectModule( int index );
|
void selectModule( int index );
|
||||||
|
void destroyAllModulesIf();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // NAMESPACE
|
} // NAMESPACE
|
||||||
|
|||||||
Reference in new issue
Block a user