// Author: Sergey LITONIN
#ifdef WIN32
-// E.A. : On windows with python 2.6, there is a conflict
-// E.A. : between pymath.h and Standard_math.h which define
-// E.A. : some same symbols : acosh, asinh, ...
-#include <Standard_math.hxx>
-#include <pymath.h>
+ // E.A. : On windows with python 2.6, there is a conflict
+ // E.A. : between pymath.h and Standard_math.h which define
+ // E.A. : some same symbols : acosh, asinh, ...
+ #include <Standard_math.hxx>
+ #ifndef DISABLE_PYCONSOLE
+ #include <pymath.h>
+ #endif
#endif
-#include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
+#ifndef DISABLE_PYCONSOLE
+ #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
+ #include <PyConsole_Console.h>
+ #include "SalomeApp_NoteBook.h"
+#endif
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_DataModel.h"
#include "SalomeApp_VisualState.h"
#include "SalomeApp_StudyPropertiesDlg.h"
#include "SalomeApp_LoadStudiesDlg.h"
-#include "SalomeApp_NoteBook.h"
-
#include "SalomeApp_ExitDlg.h"
#include <LightApp_Application.h>
// temporary commented
//#include <OB_ListItem.h>
-#include <PyConsole_Console.h>
#include <Utils_ORB_INIT.hxx>
#include <Utils_SINGLETON.hxx>
updateObjectBrowser(true);
}
+#ifndef DISABLE_PYCONSOLE
// import/execute python scripts
if ( pyfiles.count() > 0 && activeStudy() ) {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
}
}
}
+#endif
} else {
LightApp_Application::start();
SALOME_EventFilter::Init();
createExtraActions();
+#ifndef DISABLE_PYCONSOLE
+#ifndef DISABLE_SALOMEOBJECT
// import Python module that manages SALOME plugins
PyGILState_STATE gstate = PyGILState_Ensure();
PyObjWrapper pluginsmanager = PyImport_ImportModule((char*)"salome_pluginsmanager");
PyErr_Print();
PyGILState_Release(gstate);
// end of SALOME plugins loading
+#endif
+#endif
}
QString command = QString("execfile(r\"%1\")").arg(aFile);
+#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
if ( pyConsole )
pyConsole->exec( command );
+#endif
}
}
connect( aStudy, SIGNAL( saved ( SUIT_Study* ) ), this, SLOT( onStudySaved ( SUIT_Study* ) ) );
connect( aStudy, SIGNAL( closed ( SUIT_Study* ) ), this, SLOT( onStudyClosed ( SUIT_Study* ) ) );
+#ifndef DISABLE_PYCONSOLE
//to receive signal in application that NoteBook's variable was modified
connect( aStudy, SIGNAL(notebookVarUpdated(QString)),
this, SIGNAL(notebookVarUpdated(QString)) );
+#endif
return aStudy;
}
{
QString command = QString("execfile(r\"%1\")").arg(aFile);
+#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
if ( pyConsole )
pyConsole->exec( command );
+#endif
}
}
QWidget* SalomeApp_Application::createWindow( const int flag )
{
QWidget* wid = 0;
+#ifndef DISABLE_PYCONSOLE
if ( flag != WT_PyConsole ) wid = LightApp_Application::createWindow(flag);
+#else
+ wid = LightApp_Application::createWindow(flag);
+#endif
SUIT_ResourceMgr* resMgr = resourceMgr();
*/
}
}
+#ifndef DISABLE_PYCONSOLE
else if ( flag == WT_PyConsole )
{
PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(), new SalomeApp_PyInterp() );
}
wid = getNoteBook();
}
+#endif
return wid;
}
}
-/*!Global utility funciton, returns selected GUI Save point object's ID */
+/*!Global utility function, returns selected GUI Save point object's ID */
int getSelectedSavePoint( const LightApp_SelectionMgr* selMgr )
{
SALOME_ListIO aList;
{
LightApp_Application::onStudyCreated( study );
+#ifndef DISABLE_PYCONSOLE
desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
windowDock( getWindow( WT_ObjectBrowser ) ) );
+#endif
loadDockWindowsState();
{
LightApp_Application::onStudyOpened( study );
+#ifndef DISABLE_PYCONSOLE
desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
windowDock( getWindow( WT_ObjectBrowser ) ) );
+#endif
loadDockWindowsState();
}
}
+#ifndef DISABLE_PYCONSOLE
/*! Set SalomeApp_NoteBook pointer */
void SalomeApp_Application::setNoteBook( SalomeApp_NoteBook* theNoteBook )
{
{
return myNoteBook;
}
+#endif
/*!
* Define extra actions defined in module definition XML file.
void SalomeApp_Application::defaultWindows( QMap<int, int>& aMap ) const
{
LightApp_Application::defaultWindows(aMap);
+#ifndef DISABLE_PYCONSOLE
if ( !aMap.contains( WT_NoteBook ) ) {
if ( !myNoteBook ) {
aMap.insert( WT_NoteBook, Qt::LeftDockWidgetArea );
}
}
+#endif
}
/*!
void SalomeApp_Application::currentWindows(QMap<int, int>& aMap) const
{
LightApp_Application::currentWindows( aMap );
+#ifndef DISABLE_PYCONSOLE
if ( !aMap.contains( WT_NoteBook) && myNoteBook )
aMap.insert( WT_NoteBook, Qt::LeftDockWidgetArea );
+#endif
}
+#ifndef DISABLE_PYCONSOLE
//============================================================================
/*! Function : onUpdateStudy
* Purpose : Slot to update the study.
return ok;
}
+#endif
//============================================================================
/*! Function : onRestoreStudy
// load study from the temporary directory
QString command = QString( "execfile(r\"%1\")" ).arg( theDumpScript );
+#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = app->pythonConsole();
if ( pyConsole )
pyConsole->execAndWait( command );
+#endif
// remove temporary directory
QFileInfo aScriptInfo = QFileInfo( theDumpScript );
if( SalomeApp_Study* newStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) )
{
+#ifndef DISABLE_PYCONSOLE
_PTR(Study) aStudyDS = newStudy->studyDS();
app->getNoteBook()->Init( aStudyDS );
newStudy->updateFromNotebook(theStudyName, theIsStudySaved);
newStudy->Modified();
updateDesktopTitle();
updateActions();
+#endif
}
else
ok = false;
*/
void SalomeApp_Application::afterCloseDoc()
{
+#ifndef DISABLE_PYCONSOLE
// emit signal to restore study from Python script
if ( myNoteBook ) {
emit dumpedStudyClosed( myNoteBook->getDumpedStudyScript(),
myNoteBook->getDumpedStudyName(),
myNoteBook->isDumpedStudySaved() );
}
+#endif
LightApp_Application::afterCloseDoc();
}