Fix tile windows command, and make sure logger is reconnected to 3d view if it is closed and reopened

This commit is contained in:
Jon Jenssen 2022-08-23 16:05:31 +02:00 committed by Magne Sjaastad
parent 7e31e6e55a
commit 86b21714eb
9 changed files with 35 additions and 4 deletions

View File

@ -969,6 +969,13 @@ void RiaGuiApplication::createMainWindow()
m_mainWindow->setDefaultToolbarVisibility(); m_mainWindow->setDefaultToolbarVisibility();
m_mainWindow->loadWinGeoAndDockToolBarLayout(); m_mainWindow->loadWinGeoAndDockToolBarLayout();
m_mainWindow->showWindow(); m_mainWindow->showWindow();
// if there is an existing logger, reconnect to it
auto logger = dynamic_cast<RiuMessagePanelLogger*>( RiaLogging::loggerInstance() );
if ( logger )
{
logger->addMessagePanel( m_mainWindow->messagePanel() );
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -2105,3 +2105,11 @@ QStringList RiuMainWindow::defaultDockStateNames()
RiuDockWidgetTools::dockStateHideAll3DWindowName() }; RiuDockWidgetTools::dockStateHideAll3DWindowName() };
return retList; return retList;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QAction* RiuMainWindow::tileSubWindowsAction()
{
return caf::CmdFeatureManager::instance()->action( "RicTileWindowsFeature" );
}

View File

@ -140,6 +140,7 @@ public:
protected: protected:
void closeEvent( QCloseEvent* event ) override; void closeEvent( QCloseEvent* event ) override;
QStringList defaultDockStateNames() override; QStringList defaultDockStateNames() override;
QAction* tileSubWindowsAction() override;
private: private:
void createActions(); void createActions();

View File

@ -753,7 +753,7 @@ void RiuMainWindowBase::addDefaultEntriesToWindowsMenu()
QAction* closeAllSubWindowsAction = new QAction( "Close All Windows", this ); QAction* closeAllSubWindowsAction = new QAction( "Close All Windows", this );
connect( closeAllSubWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( closeAllSubWindows() ) ); connect( closeAllSubWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( closeAllSubWindows() ) );
m_windowMenu->addAction( caf::CmdFeatureManager::instance()->action( "RicTilePlotWindowsFeature" ) ); m_windowMenu->addAction( tileSubWindowsAction() );
m_windowMenu->addAction( cascadeWindowsAction ); m_windowMenu->addAction( cascadeWindowsAction );
m_windowMenu->addAction( closeAllSubWindowsAction ); m_windowMenu->addAction( closeAllSubWindowsAction );
} }

View File

@ -39,6 +39,7 @@ class PdmUiTreeView;
class PdmUiItem; class PdmUiItem;
} // namespace caf } // namespace caf
class QAction;
class QMdiArea; class QMdiArea;
class QMdiSubWindow; class QMdiSubWindow;
class QUndoView; class QUndoView;
@ -113,6 +114,8 @@ protected:
virtual QStringList defaultDockStateNames() = 0; virtual QStringList defaultDockStateNames() = 0;
virtual QAction* tileSubWindowsAction() = 0;
protected slots: protected slots:
void slotDockWidgetToggleViewActionTriggered(); void slotDockWidgetToggleViewActionTriggered();
void slotRefreshHelpActions(); void slotRefreshHelpActions();

View File

@ -151,7 +151,10 @@ RiuMessagePanelLogger::RiuMessagePanelLogger()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuMessagePanelLogger::addMessagePanel( RiuMessagePanel* messagePanel ) void RiuMessagePanelLogger::addMessagePanel( RiuMessagePanel* messagePanel )
{ {
m_messagePanel.push_back( messagePanel ); // get rid of any unused entries (qpointers are null)
m_messagePanels.erase( std::remove( m_messagePanels.begin(), m_messagePanels.end(), nullptr ), m_messagePanels.end() );
m_messagePanels.push_back( messagePanel );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -212,7 +215,7 @@ void RiuMessagePanelLogger::writeToMessagePanel( RILogLevel messageLevel, const
return; return;
} }
for ( auto& panel : m_messagePanel ) for ( auto& panel : m_messagePanels )
{ {
if ( panel ) if ( panel )
{ {

View File

@ -72,6 +72,6 @@ private:
void writeToMessagePanel( RILogLevel messageLevel, const char* message ); void writeToMessagePanel( RILogLevel messageLevel, const char* message );
private: private:
std::vector<QPointer<RiuMessagePanel>> m_messagePanel; std::vector<QPointer<RiuMessagePanel>> m_messagePanels;
int m_logLevel; int m_logLevel;
}; };

View File

@ -1210,3 +1210,11 @@ void RiuPlotMainWindow::slotToggleSelectionLink()
{ {
m_selection3DLinkEnabled = !m_selection3DLinkEnabled; m_selection3DLinkEnabled = !m_selection3DLinkEnabled;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QAction* RiuPlotMainWindow::tileSubWindowsAction()
{
return caf::CmdFeatureManager::instance()->action( "RicTilePlotWindowsFeature" );
}

View File

@ -106,6 +106,7 @@ protected:
void dropEvent( QDropEvent* event ) override; void dropEvent( QDropEvent* event ) override;
QStringList defaultDockStateNames() override; QStringList defaultDockStateNames() override;
QAction* tileSubWindowsAction() override;
private: private:
void setPdmRoot( caf::PdmObject* pdmRoot ); void setPdmRoot( caf::PdmObject* pdmRoot );