Two improvements related with PlotSubWindow

Fix ModulesHandle to filter PlotSubWinodws
Generalize reload to be applied to all kinds of subwindows
This commit is contained in:
jfmcarreira committed 2015-03-13 15:40:29 +00:00
1 parent d3a83bde04
commit 59f744c725
6 files changed
+42 -16

No files matched your search

+1 -1
View File
@@ -256,7 +256,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
{
QStringList selectedWindows = dialogWindowsSelection.getSelectedWindows();
VideoSubWindow *videoSubWindow;
QList<SubWindowHandle*> subWindowList = m_pcMainWindowManager->findSubWindow();
QList<SubWindowHandle*> subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW );
for( Int j = 0; j < selectedWindows.size(); j++ )
{
for( Int i = 0; i < subWindowList.size(); i++ )
+5
View File
@@ -65,6 +65,11 @@ public:
Void definePlotColors();
Void refreshSubWindow()
{
}
Void setTool( UInt uiTool )
{
}
+5
View File
@@ -76,6 +76,11 @@ public:
SubWindowHandle( QWidget *, UInt );
~SubWindowHandle();
/**
* Show the image at its original size
*/
virtual Void refreshSubWindow() = 0;
/**
* Show the image at its original size
*/
+15 -4
View File
@@ -122,11 +122,22 @@ Void VideoSubWindow::loadAll()
refreshFrame();
}
Void VideoSubWindow::reloadFile()
Void VideoSubWindow::refreshSubWindow()
{
Int currFrameNum = m_pCurrStream->getCurrFrameNum();
loadFile( m_cFilename, false );
seekAbsoluteEvent( currFrameNum );
if( getCategory() == SubWindowHandle::VIDEO_STREAM_SUBWINDOW )
{
Int currFrameNum = m_pCurrStream->getCurrFrameNum();
if( !loadFile( m_cFilename, false ) )
{
close();
return;
}
seekAbsoluteEvent( currFrameNum );
}
else
{
refreshFrame();
}
}
Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog )
+2 -1
View File
@@ -117,9 +117,10 @@ public:
Bool loadFile( QString cFilename, Bool bForceDialog = false );
Bool loadFile( PlaYUVerStreamInfo* streamInfo );
Void loadAll();
Void reloadFile();
Bool save( QString filename );
Void refreshSubWindow();
Bool play();
Void pause();
Bool playEvent();
+14 -10
View File
@@ -328,9 +328,9 @@ Void plaYUVerApp::format()
Void plaYUVerApp::reload()
{
if( m_pcCurrentVideoSubWindow )
if( m_pcCurrentSubWindow )
{
m_pcCurrentVideoSubWindow->reloadFile();
m_pcCurrentSubWindow->refreshSubWindow();
m_pcCurrentSubWindow = NULL;
update();
}
@@ -338,14 +338,18 @@ Void plaYUVerApp::reload()
Void plaYUVerApp::reloadAll()
{
VideoSubWindow *videoSubWindow;
QList<SubWindowHandle*> subWindowList = m_pcWindowHandle->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW );
for( Int i = 0; i < subWindowList.size(); i++ )
UInt windowCategoryOrder[] =
{
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
if( !videoSubWindow->getIsModule() )
SubWindowHandle::VIDEO_STREAM_SUBWINDOW,
SubWindowHandle::MODULE_SUBWINDOW,
SubWindowHandle::MODULE_SUBWINDOW };
for( UInt c = 0; c < 3; c++ )
{
QList<SubWindowHandle*> subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] );
for( Int i = 0; i < subWindowList.size(); i++ )
{
videoSubWindow->reloadFile();
subWindowList.at( i )->refreshSubWindow();
}
}
m_pcCurrentSubWindow = NULL;
@@ -533,10 +537,10 @@ Void plaYUVerApp::updateMenus()
m_arrayActions[SAVE_ACT]->setEnabled( hasSubWindow );
m_arrayActions[CLOSE_ACT]->setEnabled( hasSubWindow );
m_arrayActions[CLOSEALL_ACT]->setEnabled( hasSubWindow );
m_arrayActions[RELOAD_ACT]->setEnabled( hasSubWindow );
m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasSubWindow );
m_arrayActions[FORMAT_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[RELOAD_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[ZOOM_IN_ACT]->setEnabled( hasSubWindow );