diff --git a/app/PlaYUVerSubWindowHandle.cpp b/app/PlaYUVerSubWindowHandle.cpp index 7f77840..1958d3d 100644 --- a/app/PlaYUVerSubWindowHandle.cpp +++ b/app/PlaYUVerSubWindowHandle.cpp @@ -129,6 +129,12 @@ Void PlaYUVerSubWindowHandle::updateActiveSubWindow( SubWindowHandle *window ) } } } + + if( m_pcActiveWindow ) + { + parentWidget()->setWindowTitle( QApplication::applicationName() + " :: " + m_pcActiveWindow->getWindowName() ); + } + } Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowHandle *window, Qt::WindowFlags flags ) @@ -136,7 +142,8 @@ Void PlaYUVerSubWindowHandle::addSubWindow( SubWindowHandle *window, Qt::WindowF if( window ) { connect( window, SIGNAL( updateStatusBar( const QString& ) ), qobject_cast( parent() ), SLOT( updateStatusBar( const QString& ) ) ); - connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), qobject_cast( parent() ), SLOT( updateZoomFactorSBox() ) ); + connect( window, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), qobject_cast( parent() ), + SLOT( updateZoomFactorSBox() ) ); if( m_uiWindowMode == NormalSubWindows ) { connect( window, SIGNAL( aboutToActivate( SubWindowHandle* ) ), this, SLOT( updateActiveSubWindow( SubWindowHandle* ) ) ); @@ -211,10 +218,10 @@ SubWindowHandle* PlaYUVerSubWindowHandle::activeSubWindow() const return m_pcActiveWindow; } -QList PlaYUVerSubWindowHandle::findSubWindow( const QString &windowName ) const +QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const { QList apcSubWindowList; - if( windowName.isEmpty() ) + if( uiCategory == 0 ) { apcSubWindowList = m_apcSubWindowList; } @@ -222,21 +229,24 @@ QList PlaYUVerSubWindowHandle::findSubWindow( const QString &w { for( Int i = 0; i < m_apcSubWindowList.size(); i++ ) { - if( m_apcSubWindowList.at( i )->getWindowName() == windowName ) + if( m_apcSubWindowList.at( i )->getCategory() & uiCategory ) apcSubWindowList.append( m_apcSubWindowList.at( i ) ); } } return apcSubWindowList; } -QList PlaYUVerSubWindowHandle::findSubWindow( const UInt uiCategory ) const +QList PlaYUVerSubWindowHandle::findSubWindow( const QString &windowName, const UInt uiCategory ) const { + QList subWindowList = findSubWindow( uiCategory ); QList apcSubWindowList; - QList subWindowList = findSubWindow(); - for( Int i = 0; i < subWindowList.size(); i++ ) + if( !windowName.isEmpty() ) { - if( subWindowList.at( i )->getCategory() & uiCategory ) - apcSubWindowList.append( subWindowList.at( i ) ); + for( Int i = 0; i < subWindowList.size(); i++ ) + { + if( subWindowList.at( i )->getWindowName() == windowName ) + apcSubWindowList.append( subWindowList.at( i ) ); + } } return apcSubWindowList; } diff --git a/app/PlaYUVerSubWindowHandle.h b/app/PlaYUVerSubWindowHandle.h index 7375857..b7c682c 100644 --- a/app/PlaYUVerSubWindowHandle.h +++ b/app/PlaYUVerSubWindowHandle.h @@ -51,8 +51,8 @@ public: SubWindowHandle *activeSubWindow() const; - QList findSubWindow( const QString &aName = QString() ) const; - QList findSubWindow( const UInt uiCategory ) const; + QList findSubWindow( const UInt uiCategory = 0 ) const; + QList findSubWindow( const QString &aName, const UInt uiCategory = 0 ) const; SubWindowHandle* findSubWindow( const SubWindowHandle* subWindow ) const; Void createActions(); diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index a634d1e..9dfb063 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -51,6 +51,10 @@ public: PlotSubWindow( QWidget * parent = 0 ); ~PlotSubWindow(); + Void setTool( UInt uiTool ) + { + } + /** * Virtual functions from SubWindowHandle */ @@ -69,7 +73,6 @@ public: */ // QSize sizeHint() const; // QSize sizeHint( const QSize & ) const; - }; } // NAMESPACE diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index 2252a3b..497fd3b 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -73,9 +73,8 @@ QMenu* QualityHandle::createMenu() m_pcMenuQuality = new QMenu( "Quality", this ); QMenu* metricsSubMenu = m_pcMenuQuality->addMenu( "Quality Metrics" ); metricsSubMenu->addActions( m_actionGroupQualityMetric->actions() ); - //m_pcMenuQuality->addActions( m_actionGroupQualityMetric->actions() ); - //m_pcMenuQuality->addSeparator(); m_pcMenuQuality->addAction( m_arrayActions[SELECT_REF_ACT] ); + m_pcMenuQuality->addSeparator(); //m_pcMenuQuality->addAction( m_arrayActions[CREATE_PLOT] ); return m_pcMenuQuality; } diff --git a/app/SubWindowHandle.h b/app/SubWindowHandle.h index 93ce88d..8b77dc1 100644 --- a/app/SubWindowHandle.h +++ b/app/SubWindowHandle.h @@ -76,6 +76,11 @@ public: SubWindowHandle( QWidget *, UInt ); ~SubWindowHandle(); + /** + * Show the image at its original size + */ + virtual Void setTool( UInt uiTool ) = 0; + /** * Show the image at its original size */ diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index b0b6690..2208f15 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -190,6 +190,11 @@ public: return m_apcCurrentModule; } + Void setTool( UInt uiTool ) + { + m_cViewArea->setTool( ( ViewArea::eTool )uiTool ); + } + /** * Virtual functions from SubWindowHandle */ diff --git a/app/plaYUVerApp.cpp b/app/plaYUVerApp.cpp index d237a25..4119ced 100644 --- a/app/plaYUVerApp.cpp +++ b/app/plaYUVerApp.cpp @@ -366,12 +366,10 @@ Void plaYUVerApp::setTool( Int idxTool ) { m_uiViewTool = idxTool; actionGroupTools->actions().at( m_uiViewTool )->setChecked( true ); - VideoSubWindow* videoSubWindow; - QList subWindowList = m_pcWindowHandle->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + QList subWindowList = m_pcWindowHandle->findSubWindow(); for( Int i = 0; i < subWindowList.size(); i++ ) { - videoSubWindow = qobject_cast( subWindowList.at( i ) ); - videoSubWindow->getViewArea()->setTool( ( ViewArea::eTool )m_uiViewTool ); + subWindowList.at( i )->setTool( m_uiViewTool ); } } @@ -494,8 +492,6 @@ Void plaYUVerApp::update() m_pcCurrentVideoSubWindow = qobject_cast( m_pcCurrentSubWindow ); } - setWindowTitle( QApplication::applicationName() + " - " + m_pcCurrentSubWindow->getWindowName() ); - if( m_pcCurrentVideoSubWindow ) { if( !m_pcWindowHandle->findSubWindow( m_pcCurrentVideoSubWindow->getRefSubWindow() ) ) @@ -527,16 +523,22 @@ Void plaYUVerApp::updateMenus() { Bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 ); + Bool hasVideoStreamSubWindow = false; + if( m_pcCurrentSubWindow ) + if( m_pcCurrentSubWindow->getCategory() & SubWindowHandle::VIDEO_STREAM_SUBWINDOW ) + hasVideoStreamSubWindow = true; + m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false ); m_arrayActions[SAVE_ACT]->setEnabled( hasSubWindow ); - m_arrayActions[FORMAT_ACT]->setEnabled( hasSubWindow ); m_arrayActions[CLOSE_ACT]->setEnabled( hasSubWindow ); - m_arrayActions[RELOAD_ACT]->setEnabled( hasSubWindow ); - m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasSubWindow ); - m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasSubWindow ); m_arrayActions[CLOSEALL_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 ); m_arrayActions[ZOOM_OUT_ACT]->setEnabled( hasSubWindow ); m_arrayActions[ZOOM_NORMAL_ACT]->setEnabled( hasSubWindow );