From: gdd Date: Wed, 17 Nov 2010 18:05:34 +0000 (+0000) Subject: Plugins manager for VISU X-Git-Tag: V5_1_5~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=79e4a3daf4b888cafecd6f05f03d72abb8109998;p=modules%2Fvisu.git Plugins manager for VISU --- diff --git a/src/VISUGUI/VISU_msg_en.ts b/src/VISUGUI/VISU_msg_en.ts index 61b0e2e2..b67b34b7 100644 --- a/src/VISUGUI/VISU_msg_en.ts +++ b/src/VISUGUI/VISU_msg_en.ts @@ -612,6 +612,10 @@ Input value precision can be adjusted using WRN_NO_APPROPRIATE_SELECTION No appropriate objects selected + + VISU_PLUGINS_OTHER + VISU plugins + VisuGUI diff --git a/src/VISUGUI/VISU_msg_fr.ts b/src/VISUGUI/VISU_msg_fr.ts index 30953b5c..6f07d2eb 100755 --- a/src/VISUGUI/VISU_msg_fr.ts +++ b/src/VISUGUI/VISU_msg_fr.ts @@ -611,6 +611,10 @@ le '%1' paramètre des préférences du module Post-Pro. WRN_NO_APPROPRIATE_SELECTION Les objets appropriés ne sont pas choisis + + VISU_PLUGINS_OTHER + Extensions VISU + VisuGUI diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index fd8d1557..3b23f2c8 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -24,7 +24,10 @@ // File : VisuGUI.cxx // Author : // Module : VISU -// + +#include // E.A. must be included before Python.h to fix compilation on windows +#include "Python.h" + #include "VisuGUI.h" // STL Includes @@ -3657,6 +3660,21 @@ VisuGUI setMenuShown( true ); setToolShown( true ); + // import Python module that manages VISU 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,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_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 QList shortcuts; shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );