Merge branch 'master' into featurePelFormatsApi
This commit is contained in:
commit
ff50990742
4 files changed
+68
-39
No files matched your search
+1
-1
@@ -2,6 +2,6 @@
|
||||
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="video/x-raw">
|
||||
<comment>Raw YUV file</comment>
|
||||
<icon name="video-x-generic"/>
|
||||
<glob-deleteall/>
|
||||
<alias type="video/x-raw"/>
|
||||
<glob pattern="*.yuv"/>
|
||||
</mime-type>
|
||||
@@ -28,9 +28,10 @@
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdiArea, Int numberWindowsSelected ) :
|
||||
DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdiArea, Int minWindowsSelected, Int maxWindowsSelected ) :
|
||||
QDialog( parent ),
|
||||
m_iNumberOfSelectedWindows( numberWindowsSelected ),
|
||||
m_iMinSelectedWindows( minWindowsSelected ),
|
||||
m_iMaxSlectedWindows( maxWindowsSelected ),
|
||||
m_pcMainWindowMdiArea( mdiArea )
|
||||
{
|
||||
QFont titleFont, menusFont;
|
||||
@@ -66,10 +67,11 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdi
|
||||
m_listSelectedWindows = new QListWidget( this );
|
||||
|
||||
// Confirmation buttons
|
||||
QDialogButtonBox* dialogButtonOkCancel = new QDialogButtonBox();
|
||||
dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
|
||||
dialogButtonOkCancel->setOrientation( Qt::Vertical );
|
||||
dialogButtonOkCancel->setCenterButtons( false );
|
||||
m_pushButtonOkCancel = new QDialogButtonBox();
|
||||
m_pushButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
|
||||
m_pushButtonOkCancel->setOrientation( Qt::Vertical );
|
||||
m_pushButtonOkCancel->setCenterButtons( false );
|
||||
m_pushButtonOkCancel->buttons().at( 0 )->setEnabled( false );
|
||||
|
||||
// Create Layouts
|
||||
QVBoxLayout* LeftVLayout = new QVBoxLayout();
|
||||
@@ -82,7 +84,7 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdi
|
||||
RightVLayout->addWidget( m_pushButtonAddAll );
|
||||
RightVLayout->addWidget( m_pushButtonRemove );
|
||||
RightVLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
|
||||
RightVLayout->addWidget( dialogButtonOkCancel );
|
||||
RightVLayout->addWidget( m_pushButtonOkCancel );
|
||||
|
||||
// Add components
|
||||
//MainLayout->addItem( new QSpacerItem( 10, 5, QSizePolicy::Expanding, QSizePolicy::Fixed ) );
|
||||
@@ -92,8 +94,8 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdi
|
||||
setLayout( MainLayout );
|
||||
|
||||
// Create actions
|
||||
connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
connect( m_pushButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
connect( m_pushButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
connect( m_pushButtonAdd, SIGNAL( clicked() ), this, SLOT( addSubWindow() ) );
|
||||
connect( m_pushButtonAddAll, SIGNAL( clicked() ), this, SLOT( addAllSubWindow() ) );
|
||||
connect( m_pushButtonRemove, SIGNAL( clicked() ), this, SLOT( removeSubWindow() ) );
|
||||
@@ -119,18 +121,25 @@ Void DialogSubWindowSelector::updateSubWindowList()
|
||||
m_comboBoxWindowList->insertItems( 0, m_pcWindowListNames );
|
||||
m_comboBoxWindowList->setCurrentIndex( -1 );
|
||||
|
||||
if( m_iNumberOfSelectedWindows >= 0 && m_pcSelectedWindowListNames.size() >= m_iNumberOfSelectedWindows )
|
||||
{
|
||||
m_pushButtonAdd->setEnabled( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pushButtonAdd->setEnabled( true );
|
||||
}
|
||||
if( m_iNumberOfSelectedWindows >= 0 && m_pcSelectedWindowListNames.size() < m_iNumberOfSelectedWindows )
|
||||
{
|
||||
Bool enableAddAll = true;
|
||||
|
||||
if( m_iMaxSlectedWindows >= 0 )
|
||||
{
|
||||
if( m_pcSelectedWindowListNames.size() >= m_iMaxSlectedWindows )
|
||||
{
|
||||
m_pushButtonAdd->setEnabled( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pushButtonAdd->setEnabled( true );
|
||||
}
|
||||
if( m_pcWindowListNames.size() > m_iMaxSlectedWindows )
|
||||
{
|
||||
enableAddAll = false;
|
||||
}
|
||||
}
|
||||
m_pushButtonAddAll->setEnabled( enableAddAll );
|
||||
|
||||
if( m_pcSelectedWindowListNames.size() > 0 )
|
||||
{
|
||||
m_pushButtonRemove->setEnabled( true );
|
||||
@@ -139,10 +148,16 @@ Void DialogSubWindowSelector::updateSubWindowList()
|
||||
{
|
||||
m_pushButtonRemove->setEnabled( false );
|
||||
}
|
||||
if( m_iNumberOfSelectedWindows >= 0 && m_pcWindowListNames.size() <= m_iNumberOfSelectedWindows )
|
||||
|
||||
if( m_pcSelectedWindowListNames.size() >= m_iMinSelectedWindows )
|
||||
{
|
||||
m_pushButtonAddAll->setEnabled( true );
|
||||
m_pushButtonOkCancel->buttons().at( 0 )->setEnabled( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pushButtonOkCancel->buttons().at( 0 )->setEnabled( false );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Void DialogSubWindowSelector::setSubWindowList( QStringList cWindowListNames )
|
||||
@@ -169,7 +184,7 @@ Void DialogSubWindowSelector::addSubWindow()
|
||||
|
||||
Void DialogSubWindowSelector::addAllSubWindow()
|
||||
{
|
||||
if( m_iNumberOfSelectedWindows <= 0 || m_pcWindowListNames.size() <= m_iNumberOfSelectedWindows )
|
||||
if( m_iMaxSlectedWindows <= 0 || m_pcWindowListNames.size() <= m_iMaxSlectedWindows )
|
||||
{
|
||||
for( Int i = 0; i < m_pcWindowListNames.size(); i++ )
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ class DialogSubWindowSelector: public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DialogSubWindowSelector( QWidget *parent = 0, QMdiArea *mdiArea = 0, Int numberWindowsSelected = -1 );
|
||||
DialogSubWindowSelector( QWidget *parent = 0, QMdiArea *mdiArea = 0, Int minWindowsSelected = 0, Int maxWindowsSelected = -1 );
|
||||
|
||||
Void setSubWindowList( QStringList cWindowListNames );
|
||||
QStringList getSelectedWindows()
|
||||
@@ -57,12 +57,14 @@ public:
|
||||
return m_pcSelectedWindowListNames;
|
||||
}
|
||||
private:
|
||||
Int m_iNumberOfSelectedWindows;
|
||||
Int m_iMinSelectedWindows;
|
||||
Int m_iMaxSlectedWindows;
|
||||
QMdiArea* m_pcMainWindowMdiArea;
|
||||
QStringList m_pcWindowListNames;
|
||||
QStringList m_pcSelectedWindowListNames;
|
||||
|
||||
QComboBox* m_comboBoxWindowList;
|
||||
QDialogButtonBox* m_pushButtonOkCancel;
|
||||
QPushButton* m_pushButtonAdd;
|
||||
QPushButton* m_pushButtonAddAll;
|
||||
QPushButton* m_pushButtonRemove;
|
||||
|
||||
@@ -105,14 +105,16 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf
|
||||
SubWindowHandle* interfaceChild = NULL;
|
||||
QString windowName;
|
||||
|
||||
QVector<SubWindowHandle*> subWindowList;
|
||||
UInt numberOfFrames = pcCurrModuleIf->m_cModuleDef.m_uiNumberOfFrames;
|
||||
if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME ) // Show dialog to select sub windows
|
||||
{
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMdiArea, numberOfFrames );
|
||||
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMdiArea, numberOfFrames, numberOfFrames );
|
||||
if( dialogWindowsSelection.exec() == QDialog::Accepted )
|
||||
{
|
||||
QStringList selectedWindows = dialogWindowsSelection.getSelectedWindows();
|
||||
SubWindowHandle *subWindow;
|
||||
|
||||
for( Int j = 0; j < selectedWindows.size(); j++ )
|
||||
{
|
||||
for( Int i = 0; i < m_pcMdiArea->subWindowList().size(); i++ )
|
||||
@@ -120,26 +122,45 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf
|
||||
subWindow = qobject_cast<SubWindowHandle *>( m_pcMdiArea->subWindowList().at( i ) );
|
||||
if( subWindow->getWindowName() == selectedWindows.at( j ) )
|
||||
{
|
||||
subWindowList.append( subWindow );
|
||||
pcCurrModuleIf->m_pcSubWindow[j] = subWindow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
// Check for same fmt in more than one frame modules
|
||||
for( Int i = 1; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcCurrModuleIf->m_pcAction->setChecked( false );
|
||||
return interfaceChild;
|
||||
if( !subWindowList.at( i )->getCurrFrame()->haveSameFmt( subWindowList.at( 0 )->getCurrFrame()) )
|
||||
{
|
||||
subWindowList.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
windowName.append( pcSubWindow->getWindowName() );
|
||||
pcCurrModuleIf->m_pcSubWindow[0] = pcSubWindow;
|
||||
subWindowList.append( pcSubWindow );
|
||||
}
|
||||
|
||||
if( subWindowList.size() == 0 )
|
||||
{
|
||||
pcCurrModuleIf->m_pcAction->setChecked( false );
|
||||
m_pcParent->statusBar()->showMessage( "Error! Module cannot be applied", 2000 );
|
||||
return interfaceChild;
|
||||
}
|
||||
|
||||
windowName.append( " <" );
|
||||
windowName.append( pcCurrModuleIf->m_cModuleDef.m_pchModuleName );
|
||||
windowName.append( ">" );
|
||||
|
||||
for( Int i = 0; i < subWindowList.size(); i++ )
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[i] = subWindowList.at( i );
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->disableModule();
|
||||
}
|
||||
|
||||
pcCurrModuleIf->m_pcDisplaySubWindow = NULL;
|
||||
if( pcCurrModuleIf->m_cModuleDef.m_iModuleType == FRAME_PROCESSING_MODULE )
|
||||
{
|
||||
@@ -165,19 +186,10 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf
|
||||
pcCurrModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
|
||||
pcCurrModuleIf->m_pcDockWidget->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
|
||||
pcCurrModuleIf->m_pcDockWidget->setWidget( pcCurrModuleIf->m_pcModuleDock );
|
||||
//pcCurrModuleIf->m_pcDockWidget->setAttribute( Qt::WA_DeleteOnClose );
|
||||
m_pcParent->addDockWidget( Qt::RightDockWidgetArea, pcCurrModuleIf->m_pcDockWidget );
|
||||
|
||||
//connect( pcCurrModuleIf->m_pcDockWidget, SIGNAL( visibilityChanged(bool) ), pcCurrModuleIf->m_pcModuleDock, SLOT( visibilityChangedSlot(bool) ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Disable existing Module
|
||||
for( UInt i = 0; i < numberOfFrames; i++ )
|
||||
{
|
||||
pcCurrModuleIf->m_pcSubWindow[i]->disableModule();
|
||||
}
|
||||
|
||||
// Create Module
|
||||
pcCurrModuleIf->create( pcCurrModuleIf->m_pcSubWindow[0]->getCurrFrame() );
|
||||
|
||||
|
||||
Reference in new issue
Block a user