Improve modules destroy when using new window

This commit is contained in:
jfmcarreira committed 2014-05-10 04:09:10 +01:00
1 parent e498e20c3e
commit 73ed8720b5
4 files changed
+45 -43

No files matched your search

+4 -7
View File
@@ -99,6 +99,7 @@ SubWindowHandle* ModulesHandle::toggleSelectedModuleIf()
connect( interfaceChild->getViewArea(), SIGNAL( positionChanged(const QPoint &, PlaYUVerFrame *) ), this,
SLOT( updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *) ) );
currModuleIf->m_pcDisplaySubWindow = interfaceChild;
currModuleIf->m_pcDisplaySubWindow->setModule( currModuleIf );
}
else
{
@@ -117,15 +118,11 @@ Void ModulesHandle::destroyModuleIf( PlaYUVerModuleIf *pcCurrModuleIf )
{
pcCurrModuleIf->m_pcAction->setChecked( false );
if( pcCurrModuleIf->m_pcDisplaySubWindow )
{
pcCurrModuleIf->m_pcDisplaySubWindow->close();
pcCurrModuleIf->m_pcDisplaySubWindow = NULL;
}
else
{
if( pcCurrModuleIf->m_pcSubWindow )
pcCurrModuleIf->m_pcSubWindow->disableModule();
}
pcCurrModuleIf->m_pcSubWindow->refreshFrame();
pcCurrModuleIf->m_pcDisplaySubWindow = NULL;
pcCurrModuleIf->m_pcSubWindow = NULL;
pcCurrModuleIf->destroy();
}
+2 -1
View File
@@ -55,6 +55,8 @@ public:
Void updateMenus( Bool hasSubWindow );
SubWindowHandle* toggleSelectedModuleIf();
static Void destroyModuleIf( PlaYUVerModuleIf* pcCurrModuleIf );
private:
QWidget *m_pcParent;
QMdiArea *m_pcMdiArea;
@@ -77,7 +79,6 @@ private:
Void appendModule( PlaYUVerModuleIf* );
Void ModulesList( Bool bCreate );
Void destroyModuleIf( PlaYUVerModuleIf* pcCurrModuleIf );
private Q_SLOTS:
void selectModule( int index );
+16 -16
View File
@@ -124,11 +124,14 @@ Void SubWindowHandle::enableModule( PlaYUVerModuleIf* select_module )
Void SubWindowHandle::disableModule()
{
if( !m_pcCurrentModule )
return;
m_pcCurrentModule = NULL;
m_pcModuleSubWindow = NULL;
refreshFrame();
if( m_pcCurrentModule )
{
PlaYUVerModuleIf* pcCurrentModule = m_pcCurrentModule;
m_pcCurrentModule = NULL;
m_pcModuleSubWindow = NULL;
ModulesHandle::destroyModuleIf( pcCurrentModule );
refreshFrame();
}
}
Void SubWindowHandle::setCurrFrame( PlaYUVerFrame* pcCurrFrame )
@@ -139,19 +142,16 @@ Void SubWindowHandle::setCurrFrame( PlaYUVerFrame* pcCurrFrame )
Void SubWindowHandle::refreshFrame()
{
m_pcCurrFrame = m_pCurrStream->getCurrFrame();
if( m_pcCurrentModule )
if( m_pCurrStream )
{
if( m_pcModuleSubWindow )
{
m_pcModuleSubWindow->setCurrFrame( m_pcCurrentModule->process( m_pCurrStream->getCurrFrame() ) );
}
else
{
m_pcCurrFrame = m_pcCurrentModule->process( m_pCurrStream->getCurrFrame() );
}
m_pcCurrFrame = m_pCurrStream->getCurrFrame();
if( m_pcCurrentModule )
if( m_pcModuleSubWindow )
m_pcModuleSubWindow->setCurrFrame( m_pcCurrentModule->process( m_pCurrStream->getCurrFrame() ) );
else
m_pcCurrFrame = m_pcCurrentModule->process( m_pCurrStream->getCurrFrame() );
m_cViewArea->setImage( m_pcCurrFrame );
}
m_cViewArea->setImage( m_pcCurrFrame );
}
Bool SubWindowHandle::save()
+23 -19
View File
@@ -1,21 +1,21 @@
/* This file is a part of plaYUVer project
* Copyright (C) 2014 by Luis Lucas (luisfrlucas@gmail.com)
* Joao Carreira (jfmcarreira@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* Copyright (C) 2014 by Luis Lucas (luisfrlucas@gmail.com)
* Joao Carreira (jfmcarreira@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/**
* \file SubWindowHandle.h
@@ -107,6 +107,10 @@ public:
{
m_pcModuleSubWindow = pcWindow;
}
Void setModule( PlaYUVerModuleIf* pcCurrentModule )
{
m_pcCurrentModule = pcCurrentModule;
}
/**
* Functions to enable a module in the
@@ -175,9 +179,9 @@ protected:
void closeEvent( QCloseEvent *event );
public Q_SLOTS:
void adjustScrollBarByZoom( double factor , QPoint center );
void adjustScrollBarByZoom( double factor, QPoint center );
void adjustScrollBarByOffset( QPoint Offset );
void updateLastScrollValue( );
void updateLastScrollValue();
};
} // NAMESPACE