From e5d9adf5214d4b44ea6e15942ebba8434a8f621f Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sun, 27 Sep 2015 04:15:10 +0100 Subject: [PATCH] Improve window title when handling modules and add new shortcuts --- app/ModulesHandle.cpp | 25 ++++++++++++------------- app/PlaYUVerSubWindowHandle.cpp | 1 + app/VideoHandle.cpp | 4 ++-- app/VideoSubWindow.cpp | 3 +++ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index a22180a..49e63c4 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -335,10 +335,6 @@ Void ModulesHandle::activateModule() return; } - QString windowName; - windowName.append( QStringLiteral( "Module " ) ); - windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName ); - for( Int i = 0; i < videoSubWindowList.size(); i++ ) { pcCurrAppModuleIf->m_pcSubWindow[i] = videoSubWindowList.at( i ); @@ -357,13 +353,16 @@ Void ModulesHandle::activateModule() Bool bShowModulesNewWindow = m_arrayActions[FORCE_NEW_WINDOW_ACT]->isChecked() | bTmpForceNewWindow; + QString windowName; + VideoSubWindow* pcModuleSubWindow = NULL; if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE ) { if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow ) { pcModuleSubWindow = new VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW ); - pcModuleSubWindow->setWindowName( windowName ); + windowName.append( QStringLiteral( "Module " ) ); + windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName ); connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, SLOT( updateSelectionArea( QRect ) ) ); connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, @@ -372,14 +371,6 @@ Void ModulesHandle::activateModule() pcCurrAppModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow; } - else - { - QString windowName = videoSubWindowList.at( 0 )->getWindowName(); - windowName.append( QStringLiteral( " - Module " ) ); - windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName ); - videoSubWindowList.at( 0 )->setWindowName( windowName ); - - } } else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE ) { @@ -439,9 +430,17 @@ Void ModulesHandle::activateModule() if( pcModuleSubWindow ) { + pcModuleSubWindow->setWindowName( windowName ); m_pcMainWindowManager->addSubWindow( pcModuleSubWindow ); pcModuleSubWindow->show(); } + else + { + windowName = videoSubWindowList.at( 0 )->getWindowName(); + windowName.append( QStringLiteral( " - Module " ) ); + windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName ); + videoSubWindowList.at( 0 )->setWindowName( windowName ); + } m_pcPlaYUVerAppModuleIfList.append( pcCurrAppModuleIf ); diff --git a/app/PlaYUVerSubWindowHandle.cpp b/app/PlaYUVerSubWindowHandle.cpp index a89d83f..530443a 100644 --- a/app/PlaYUVerSubWindowHandle.cpp +++ b/app/PlaYUVerSubWindowHandle.cpp @@ -475,6 +475,7 @@ Void PlaYUVerSubWindowHandle::createActions() m_arrayActions[TILE_WINDOWS_ACT] = new QAction( tr( "Tile" ), this ); m_arrayActions[TILE_WINDOWS_ACT]->setIcon( QIcon( ":images/windowstile.png" ) ); m_arrayActions[TILE_WINDOWS_ACT]->setStatusTip( tr( "Tile the windows" ) ); + m_arrayActions[TILE_WINDOWS_ACT]->setShortcut( tr( "Ctrl+T" ) ); //connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), mdiArea, SLOT( tileSubWindows() ) ); connect( m_arrayActions[TILE_WINDOWS_ACT], SIGNAL( triggered() ), this, SLOT( tileSubWindows() ) ); diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index 777e39c..1aca447 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -107,12 +107,12 @@ Void VideoHandle::createActions() m_arrayActions[VIDEO_REPEAT_ACT]->setChecked( false ); m_arrayActions[VIDEO_ZOOM_LOCK_ACT] = new QAction( "Zoom Lock", this ); - m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setStatusTip( "Lock zoom between all video windows" ); + m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setStatusTip( "Sync zoom between all video windows" ); m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setShortcut( tr( "Ctrl+L" ) ); m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setCheckable( true ); m_arrayActions[VIDEO_ZOOM_LOCK_ACT]->setChecked( false ); - m_arrayActions[VIDEO_LOCK_SELECTION_ACT] = new QAction( "Playing Lock", this ); + m_arrayActions[VIDEO_LOCK_SELECTION_ACT] = new QAction( "Sync Play", this ); m_arrayActions[VIDEO_LOCK_SELECTION_ACT]->setStatusTip( "Select which windows should be played synchronized. Press Ctrl while click to quickly to select all!" ); connect( m_arrayActions[VIDEO_LOCK_SELECTION_ACT], SIGNAL( triggered() ), this, SLOT( videoSelectionButtonEvent() ) ); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 91311e9..450ba5f 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -415,11 +415,13 @@ Void VideoSubWindow::updateVideoWindowInfo() QString m_cCodedName = QString::fromStdString( m_pCurrStream->getCodecName() ); m_cStreamInformation = m_cFormatName + " | " + m_cCodedName; } +//#if 0 if( m_pcCurrFrame ) { QString m_cPelFmtName = QString::fromStdString( m_pcCurrFrame->getPelFmtName() ); m_cStreamInformation += " | " + m_cPelFmtName; } +//#endif if( m_cStreamInformation.isEmpty() ) { m_cStreamInformation = " "; @@ -558,6 +560,7 @@ Void VideoSubWindow::disableModule( PlaYUVerAppModuleIf* pcModule ) pcModule = m_pcCurrentDisplayModule; m_pcCurrentDisplayModule = 0; ModulesHandle::destroyModuleIf( pcModule ); + setWindowName( QFileInfo( m_cFilename ).fileName() ); bRefresh |= true; } }