From 275711c4a7bb04b369a4bac436c3ffa4389a255e Mon Sep 17 00:00:00 2001 From: gdd Date: Wed, 17 Nov 2010 18:06:23 +0000 Subject: [PATCH] Plugins manager for SMESH --- src/SMESHGUI/SMESHGUI.cxx | 17 +++++++++++++++++ src/SMESHGUI/SMESH_msg_en.ts | 4 ++++ src/SMESHGUI/SMESH_msg_fr.ts | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 1efc41fd2..5d66656a8 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -23,6 +23,8 @@ // File : SMESHGUI.cxx // Author : Nicolas REJNERI, Open CASCADE S.A.S. +#include // 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 diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index e0ac1377f..efadce49d 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -3228,6 +3228,10 @@ Input value precision can be adjusted using NB_NODES_REMOVED Removed %1 node(s). + + SMESH_PLUGINS_OTHER + SMESH plugins + SMESHGUI diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index fc4c60024..19d6cdcf6 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -3225,6 +3225,10 @@ avec le paramètre '%1' des préférences du module Mesh.NB_NODES_REMOVED %1 nœud(s) supprimés. + + SMESH_PLUGINS_OTHER + Extensions SMESH + SMESHGUI -- 2.39.2