#ifndef DISABLE_PYCONSOLE
/*!
+ This returns the python console integrated to the GUI. Depending
+ when you request the python console, this function could return
+ null. Then the optional parameter force (default to false) can be
+ set to force the creation of the python console if it is not done
+ already.
+ \param force - if true, the pythonConsole is created if it does not exist yet
\return Python Console
*/
-PyConsole_Console* LightApp_Application::pythonConsole()
+PyConsole_Console* LightApp_Application::pythonConsole(const bool force)
{
- return qobject_cast<PyConsole_Console*>( dockWindow( WT_PyConsole ) );
+ QWidget* wid = dockWindow( WT_PyConsole );
+ if ( !wid and force==true) {
+ wid = getWindow(WT_PyConsole);
+ }
+ return qobject_cast<PyConsole_Console*>( wid );
}
#endif
LogWindow* logWindow();
SUIT_DataBrowser* objectBrowser();
#ifndef DISABLE_PYCONSOLE
- PyConsole_Console* pythonConsole();
+ PyConsole_Console* pythonConsole(const bool force = false);
#endif
virtual void updateObjectBrowser( const bool = true );