Salome HOME
Plugins manager for SMESH
authorgdd <gdd>
Wed, 17 Nov 2010 18:06:23 +0000 (18:06 +0000)
committergdd <gdd>
Wed, 17 Nov 2010 18:06:23 +0000 (18:06 +0000)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHGUI/SMESH_msg_fr.ts

index 1efc41fd29c3cf65fb4d847210218ca61b121a10..5d66656a8602aeb11479c70fc92b5d845be6c5ec 100644 (file)
@@ -23,6 +23,8 @@
 //  File   : SMESHGUI.cxx
 //  Author : Nicolas REJNERI, Open CASCADE S.A.S.
 
+#include <Standard_math.hxx>  // E.A. must be included before Python.h to fix compilation on windows
+#include "Python.h"
 //  SMESH includes
 #include "SMESHGUI.h"
 #include "SMESHGUI_AddMeshElementDlg.h"
@@ -3709,6 +3711,21 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
   setMenuShown( true );
   setToolShown( true );
 
+  // import Python module that manages SMESH plugins (need to be here because SalomePyQt API uses active module)
+  PyGILState_STATE gstate = PyGILState_Ensure();
+  PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
+  if(pluginsmanager==NULL)
+    PyErr_Print();
+  else
+    {
+      PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"smesh",tr("MEN_MESH").toStdString().c_str(),tr("SMESH_PLUGINS_OTHER").toStdString().c_str());
+      if(result==NULL)
+        PyErr_Print();
+      Py_XDECREF(result);
+    }
+  PyGILState_Release(gstate);
+  // end of GEOM plugins loading
+
   // Reset actions accelerator keys
   action(111)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B)); // Import DAT
   action(112)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U)); // Import UNV
index e0ac1377fc35cc9e6b441194e54bb72876449999..efadce49d39813f6016c784e264393d62e13ed9f 100644 (file)
@@ -3228,6 +3228,10 @@ Input value precision can be adjusted using
         <source>NB_NODES_REMOVED</source>
         <translation>Removed %1 node(s).</translation>
     </message>
+    <message>
+        <source>SMESH_PLUGINS_OTHER</source>
+        <translation>SMESH plugins</translation>
+    </message>  
 </context>
 <context>
     <name>SMESHGUI</name>
index fc4c60024877ed14989d4cb7f2deb9e9fcf21397..19d6cdcf60973e3ada06a468347c3c014b153744 100755 (executable)
@@ -3225,6 +3225,10 @@ avec le paramètre &apos;%1&apos; des préférences du module Mesh.</translation
         <source>NB_NODES_REMOVED</source>
         <translation>%1 nœud(s) supprimés.</translation>
     </message>
+    <message>
+        <source>SMESH_PLUGINS_OTHER</source>
+        <translation>Extensions SMESH</translation>
+    </message>   
 </context>
 <context>
     <name>SMESHGUI</name>