Add support to signall if the format supports user configuration

This commit is contained in:
jfmcarreira committed 2021-10-10 22:25:32 +01:00
1 parent b7ad00a4c5
commit 3b31453221
5 files changed
+18 -9

No files matched your search

+12 -5
View File
@@ -598,10 +598,17 @@ void MainWindow::updateMenus()
{
bool hasSubWindow = ( m_pcWindowHandle->activeSubWindow() != 0 );
bool hasVideoStreamSubWindow = false;
if( m_pcCurrentSubWindow )
if( m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW )
hasVideoStreamSubWindow = true;
bool hasVideoStreamSubWindow{ false };
bool supportsFormat{ false };
if( m_pcCurrentSubWindow && m_pcCurrentSubWindow->getCategory() & SubWindowAbstract::VIDEO_STREAM_SUBWINDOW )
{
hasVideoStreamSubWindow = true;
if( auto* pcVideoSubWindow = qobject_cast<VideoStreamSubWindow*>( m_pcCurrentVideoSubWindow ) )
{
supportsFormat = pcVideoSubWindow->supportsFormatConfiguration();
}
}
m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false );
@@ -611,7 +618,7 @@ void MainWindow::updateMenus()
m_arrayActions[RELOAD_ACT]->setEnabled( hasSubWindow );
m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasSubWindow );
m_arrayActions[FORMAT_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[FORMAT_ACT]->setEnabled( supportsFormat );
m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow );
m_arrayActions[ZOOM_IN_ACT]->setEnabled( hasSubWindow );
+2
View File
@@ -79,6 +79,8 @@ public:
void setResourceManaget( ResourceHandle* resourceManager ) { m_pcResourceManager = resourceManager; }
bool supportsFormatConfiguration() const { return m_pCurrStream->supportsFormatConfiguration(); };
bool loadFile( QString cFilename, bool bForceDialog = false );
bool loadFile( CalypFileInfo* streamInfo );
void loadAll();