Plugins manager for SMESH

This commit is contained in:
gdd 2010-11-17 18:06:23 +00:00
parent 36cce06adb
commit 275711c4a7
3 changed files with 25 additions and 0 deletions

View 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

View 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>

View File

@ -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>