mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-27 10:05:37 +05:00
CCAR: add python plugins manager to GEOM module (submenu Other in New Entity menu)
This commit is contained in:
parent
f22df83647
commit
8d7e376e8e
@ -23,6 +23,7 @@
|
|||||||
// File : GeometryGUI.cxx
|
// File : GeometryGUI.cxx
|
||||||
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
|
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
|
||||||
//
|
//
|
||||||
|
#include "Python.h"
|
||||||
#include "GeometryGUI.h"
|
#include "GeometryGUI.h"
|
||||||
#include "GeometryGUI_Operations.h"
|
#include "GeometryGUI_Operations.h"
|
||||||
#include "GEOMGUI_OCCSelector.h"
|
#include "GEOMGUI_OCCSelector.h"
|
||||||
@ -1098,6 +1099,21 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
setMenuShown( true );
|
setMenuShown( true );
|
||||||
setToolShown( true );
|
setToolShown( true );
|
||||||
|
|
||||||
|
// import Python module that manages GEOM 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,"geom","New Entity","Other");
|
||||||
|
if(result==NULL)
|
||||||
|
PyErr_Print();
|
||||||
|
Py_XDECREF(result);
|
||||||
|
}
|
||||||
|
PyGILState_Release(gstate);
|
||||||
|
// end of GEOM plugins loading
|
||||||
|
|
||||||
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
|
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
|
||||||
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
|
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user