diff --git a/source/app/ModulesHandle.cpp b/source/app/ModulesHandle.cpp index e7de421..431c55c 100644 --- a/source/app/ModulesHandle.cpp +++ b/source/app/ModulesHandle.cpp @@ -133,7 +133,7 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf } else { - windowName.append( pcSubWindow->userFriendlyCurrentFile() ); + windowName.append( pcSubWindow->getWindowName() ); pcCurrModuleIf->m_pcSubWindow[0] = pcSubWindow; } windowName.append( " <" ); diff --git a/source/app/QualityMeasurementSidebar.cpp b/source/app/QualityMeasurementSidebar.cpp index c674998..a5ad62a 100644 --- a/source/app/QualityMeasurementSidebar.cpp +++ b/source/app/QualityMeasurementSidebar.cpp @@ -45,7 +45,8 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, QMdiArea RecLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); m_comboBoxRef = new QComboBox; - + m_comboBoxRef->setSizeAdjustPolicy( QComboBox::AdjustToMinimumContentsLength ); + m_comboBoxRef->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed); updateSubWindowList(); QGridLayout *mainLayout = new QGridLayout; @@ -114,7 +115,7 @@ Void QualityMeasurementSidebar::updateSubWindowList() subWindow = qobject_cast( m_pcMainWindowMdiArea->subWindowList().at( i ) ); if( subWindow ) { - currSubWindowName = subWindow->getWindowName(); + currSubWindowName = subWindow->getWindowShortName(); if( !m_pcSelectedWindowListNames.contains( currSubWindowName ) && !subWindow->getIsModule() ) m_pcWindowListNames.append( currSubWindowName ); } @@ -127,10 +128,11 @@ Void QualityMeasurementSidebar::updateSubWindowList() { if( SubWindowHandle* refSubWindow = m_pcCurrentSubWindow->getRefSubWindow() ) { - Int index = m_pcWindowListNames.indexOf( refSubWindow->getWindowName() ); + Int index = m_pcWindowListNames.indexOf( refSubWindow->getWindowShortName() ); m_comboBoxRef->setCurrentIndex( index ); } } + m_comboBoxRef->setSizeAdjustPolicy( QComboBox::AdjustToContents ); } Void QualityMeasurementSidebar::updateCurrentWindow( SubWindowHandle *subWindow ) diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index d9eddda..11d7305 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -114,6 +114,7 @@ Bool SubWindowHandle::loadFile( QString cFilename, Bool bForceDialog ) m_cCurrFileName = cFilename; m_cWindowName = m_pCurrStream->getStreamInformationString(); + m_cWindowShortName = QFileInfo( cFilename ).fileName(); setWindowTitle( m_cWindowName ); return true; } diff --git a/source/app/SubWindowHandle.h b/source/app/SubWindowHandle.h index 1111be2..41c14ab 100644 --- a/source/app/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -57,6 +57,7 @@ private: SubWindowHandle* m_pcReferenceSubWindow; QString m_cWindowName; + QString m_cWindowShortName; QString m_cCurrFileName; Bool m_bIsPlaying; @@ -183,13 +184,11 @@ public: { return m_cWindowName; } - - QString userFriendlyCurrentFile() + QString getWindowShortName() { - return m_cWindowName; + return m_cWindowShortName; } - - QString currentFile() + QString getCurrentFileName() { return m_cCurrFileName; } diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 80c6ea4..dad84cb 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -269,7 +269,7 @@ Void plaYUVerApp::format() { if( m_pcCurrentSubWindow ) { - m_pcCurrentSubWindow->loadFile( m_pcCurrentSubWindow->currentFile(), true ); + m_pcCurrentSubWindow->loadFile( m_pcCurrentSubWindow->getCurrentFileName(), true ); m_pcCurrentSubWindow = NULL; chageSubWindowSelection(); } @@ -888,7 +888,7 @@ SubWindowHandle* plaYUVerApp::findSubWindow( const QMdiArea* mdiArea, const QStr foreach( QMdiSubWindow * window, mdiArea->subWindowList() ){ SubWindowHandle *mdiChild = qobject_cast( window); - if( mdiChild->currentFile() == canonicalFilePath ) + if( mdiChild->getCurrentFileName() == canonicalFilePath ) return mdiChild; } return 0; @@ -1006,11 +1006,11 @@ Void plaYUVerApp::updateWindowMenu() QString text; if( i < 9 ) { - text = tr( "&%1 %2" ).arg( i + 1 ).arg( child->userFriendlyCurrentFile() ); + text = tr( "&%1 %2" ).arg( i + 1 ).arg( child->getWindowName() ); } else { - text = tr( "%1 %2" ).arg( i + 1 ).arg( child->userFriendlyCurrentFile() ); + text = tr( "%1 %2" ).arg( i + 1 ).arg( child->getWindowName() ); } QAction *action = m_arrayMenu[WINDOW_MENU]->addAction( text ); action->setCheckable( true );