From: abn Date: Wed, 27 Jul 2016 10:10:55 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/agr/fix_tests' X-Git-Tag: V8_1_0b1~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2150e7c3c1bfbd9a364d197b5ff016914a294c9b;p=modules%2Fmed.git Merge remote-tracking branch 'origin/agr/fix_tests' Conflicts: src/MEDCalc/gui/CMakeLists.txt src/MEDCalc/gui/MEDModule.cxx src/MEDCalc/gui/MEDModule.hxx --- 2150e7c3c1bfbd9a364d197b5ff016914a294c9b diff --cc src/MEDCalc/gui/MEDModule.cxx index 69f51d446,cb0c4703e..1501c32b1 --- a/src/MEDCalc/gui/MEDModule.cxx +++ b/src/MEDCalc/gui/MEDModule.cxx @@@ -42,11 -42,9 +42,13 @@@ #ifndef DISABLE_PVVIEWER #include "PVViewer_ViewModel.h" +#include "PVViewer_GUIElements.h" #endif ++ +#include "MEDFactoryClient.hxx" +#include "MEDPresentationManager_i.hxx" + #include #include @@@ -95,18 -86,22 +97,27 @@@ voi MEDModule::init() { // initialize MED module engine (load, if necessary) - if ( CORBA::is_nil( myEngine ) ) { + if ( CORBA::is_nil( _MED_engine ) ) { Engines::EngineComponent_var comp = SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "MED" ); - myEngine = MED_ORB::MED_Gen::_narrow( comp ); + _MED_engine = MED_ORB::MED_Gen::_narrow( comp ); } + + // Retrieve MEDFactory to get MEDPresentationManager (sometimes + if ( ! _presManager ) { + _presManager = MEDFactoryClient::getFactory()->getPresentationManager(); + } } + //void MEDModule::onEventLoopStarted() + //{ + // if(!getApp()->isMainEventLoopStarted()) + // { + // QTimer::singleShot(100, this, SLOT(onEventLoopStarted())); + // return; + // } + //} + void MEDModule::initialize( CAM_Application* app ) { @@@ -259,26 -257,10 +277,32 @@@ MEDModule::createModuleWidgets() connect(_workspaceController, SIGNAL(workspaceSignal(const MEDCALC::MedEvent*)), _presentationController, SLOT(processWorkspaceEvent(const MEDCALC::MedEvent*))); ++ + // Now that the workspace controller is created, ParaView core application has normally been started, + // and hidden GUI elements have been created. We can fire the VCR toolbar activation: + initToolbars(); +} + +void +MEDModule::initToolbars() +{ + // VCR and Time toolbars: + SUIT_Desktop* dsk = getApp()->desktop(); + _pvGuiElements = PVViewer_GUIElements::GetInstance(dsk); + + _pvGuiElements->getVCRToolbar(); // make sure VCR toolbar is built + _pvGuiElements->setToolBarVisible(false); + _pvGuiElements->setVCRTimeToolBarVisible(true); + + // Emit signal in order to make sure that animation scene is set - same trick as in PARAVIS module activation + QMetaObject::invokeMethod( pqPVApplicationCore::instance()->animationManager(), + "activeSceneChanged", + Q_ARG( pqAnimationScene*, pqPVApplicationCore::instance()->animationManager()->getActiveScene() ) ); ++ + #ifdef MED_HAS_QTTESTING + connect(_workspaceController, SIGNAL(workspaceSignal(const MEDCALC::MedEvent*)), + _testController, SLOT(processWorkspaceEvent(const MEDCALC::MedEvent*))); + #endif } void diff --cc src/MEDCalc/gui/MEDModule.hxx index 4c783a6bc,4a2e01851..7541e3f91 --- a/src/MEDCalc/gui/MEDModule.hxx +++ b/src/MEDCalc/gui/MEDModule.hxx @@@ -107,12 -105,10 +112,17 @@@ private XmedDataModel* _xmedDataModel; PresentationController* _presentationController; ProcessingController* _processingController; ++ + PVViewer_GUIElements* _pvGuiElements; + + static MED_ORB::MED_Gen_var _MED_engine; + + // GUI needs to talk directly to the pres manager to activate a view, get some params, etc ...: + static MEDCALC::MEDPresentationManager_ptr _presManager; ++ + #ifdef MED_HAS_QTTESTING + TestController * _testController; + #endif - static MED_ORB::MED_Gen_var myEngine; }; #endif diff --cc src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx index 758a54502,72be05804..8e1905a8c --- a/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx +++ b/src/MEDCalc/gui/dialogs/WidgetPresentationParameters.hxx @@@ -29,9 -29,10 +29,10 @@@ #include -class WidgetPresentationParameters : public QWidget +class MEDCALCGUI_DIALOGS_EXPORT WidgetPresentationParameters : public QWidget { Q_OBJECT + public: WidgetPresentationParameters(QWidget* parent = 0); virtual ~WidgetPresentationParameters() {}