]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Adding option to skip the connection to an external server.
authorabn <adrien.bruneton@cea.fr>
Fri, 19 Sep 2014 13:42:55 +0000 (15:42 +0200)
committerabn <adrien.bruneton@cea.fr>
Fri, 19 Sep 2014 13:42:55 +0000 (15:42 +0200)
src/PVGUI/PVGUI_Module.cxx
src/PVGUI/view/PVViewer_ViewManager.cxx

index d4f7cc9a1766d93b2c715e43b8daaa6c35b29535..f1f9b836a1365d582f84f4c483eb046c385e17d5 100644 (file)
 #include <pqServerResource.h>
 #include <pqServerConnectReaction.h>
 
+// TO REMOVE:
+#include <PyInterp_Interp.h>
+
+
 //----------------------------------------------------------------------------
 PVGUI_Module* ParavisModule = 0;
 
@@ -402,7 +406,6 @@ void PVGUI_Module::initialize( CAM_Application* app )
   if(!isStop)
     {
       // Start a timer to schedule asap:
-      //  - the connection to the server
       //  - the trace start
       myInitTimer = new QTimer(aDesktop);
       QObject::connect(myInitTimer, SIGNAL(timeout()), this, SLOT(onInitTimer()) );
@@ -451,14 +454,10 @@ void PVGUI_Module::onDataRepresentationUpdated() {
 }
 
 /*!
-  \brief Initialisation timer event - fired only once, after the GUI loop is ready.
-  See creation in initialize().
+  \brief Initialisation timer event - trace start up
 */
 void PVGUI_Module::onInitTimer()
 {
-#ifndef PARAVIS_WITH_FULL_CORBA
-//  connectToExternalPVServer();
-#endif
   startTrace();
 }
   
@@ -959,6 +958,8 @@ void PVGUI_Module::createPreferences()
   int aParaVisSettingsTab = addPreference( tr( "TIT_PVISSETTINGS" ) );
   addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "stop_trace");
 
+  addPreference( tr( "PREF_NO_EXT_PVSERVER" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "no_ext_pv_server");
+
   int aSaveType = addPreference(tr( "PREF_SAVE_TYPE_LBL" ), aParaVisSettingsTab,
                                 LightApp_Preferences::Selector,
                                 "PARAVIS", "savestate_type");
index ae6442106b28b6fb4bcf32ad20f8de0608198d2e..4ce117044f75ff3c62956b514a6ab692e782fd1f 100644 (file)
@@ -117,7 +117,7 @@ bool PVViewer_ViewManager::ParaviewInitApp(SUIT_Desktop * aDesktop)
       PyConsole_Interp* pyInterp = app->pythonConsole()->getInterp();
       {
         PyLockWrapper aGil;
-        std::string cmd = "import paraview; paraview.fromGUI = True;";
+        std::string cmd = "import paraview;paraview.fromGUI = True";
         pyInterp->run(cmd.c_str());
       }
 
@@ -169,11 +169,9 @@ void PVViewer_ViewManager::ParaviewCleanup()
   pqApplicationCore::instance()->settings()->sync();
 
   pqPVApplicationCore * app = GetPVApplication();
-  // [ABN] : TODO review this, this triggers an ugly crash (Python thread state mix-up)
-  // at SALOME's exit.
   // Schedule destruction of PVApplication singleton:
-//  if (app)
-//    app->deleteLater();
+  if (app)
+    app->deleteLater();
 }
 
 PARAVIS_ORB::PARAVIS_Gen_var PVViewer_ViewManager::GetEngine()
@@ -189,6 +187,11 @@ PARAVIS_ORB::PARAVIS_Gen_var PVViewer_ViewManager::GetEngine()
 
 bool PVViewer_ViewManager::ConnectToExternalPVServer(SUIT_Desktop* aDesktop)
 {
+  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+  bool noConnect = aResourceMgr->booleanValue( "PARAVIS", "no_ext_pv_server", false );
+  if (noConnect)
+    return true;
+
   pqServer* server = pqActiveObjects::instance().activeServer();
   if (server && server->isRemote())
     {