From f393c3d556cff8f69b7fc3b5e51a85e3dddcb477 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 8 Jul 2016 17:51:00 +0300 Subject: [PATCH] Additional fix for the "0023270: [CEA 1822] PARAVIS GUI widgets should be instanciated only when needed" issue. --- src/PVViewer/PVViewer_GUIElements.cxx | 24 ++++++++++++++++++++++++ src/PVViewer/PVViewer_GUIElements.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/src/PVViewer/PVViewer_GUIElements.cxx b/src/PVViewer/PVViewer_GUIElements.cxx index 2a6d260ff..70e360716 100644 --- a/src/PVViewer/PVViewer_GUIElements.cxx +++ b/src/PVViewer/PVViewer_GUIElements.cxx @@ -44,6 +44,10 @@ #include #include #include +#include + +#include +#include #include #include @@ -211,6 +215,7 @@ void PVViewer_GUIElements::buildPVWidgets() Q_ARG( pqServerManagerModelItem* , NULL ) ); } + publishExistingSources(); myPVWidgetsFlag = true; } } @@ -326,3 +331,22 @@ QMenu* PVViewer_GUIElements::getMacrosMenu() { buildPVWidgets(); return macrosMenu; } + +void PVViewer_GUIElements::publishExistingSources() { + vtkSMSessionProxyManager* pxm = pqActiveObjects::instance().proxyManager(); + pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel(); + if( !pxm || !smmodel ) + return; + vtkSMProxyIterator* iter = vtkSMProxyIterator::New(); + iter->SetModeToOneGroup(); + iter->SetSessionProxyManager( pxm ); + for ( iter->Begin( "sources" ); !iter->IsAtEnd(); iter->Next() ) { + if ( pqProxy* item = smmodel->findItem( iter->GetProxy() ) ) { + pqPipelineSource* source = qobject_cast( item ); + QMetaObject::invokeMethod( smmodel, + "sourceAdded", + Qt::AutoConnection, + Q_ARG( pqPipelineSource* , source ) ); + } + } +} diff --git a/src/PVViewer/PVViewer_GUIElements.h b/src/PVViewer/PVViewer_GUIElements.h index dcfba68a9..eead0ef14 100644 --- a/src/PVViewer/PVViewer_GUIElements.h +++ b/src/PVViewer/PVViewer_GUIElements.h @@ -70,6 +70,8 @@ private: void buildPVWidgets(); + void publishExistingSources(); + // Widgets pqPropertiesPanel* propertiesPanel; pqPipelineBrowserWidget* pipelineBrowserWidget; -- 2.39.2