-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "SUIT_Tools.h"
#include "SUIT_ViewManager.h"
#include "SUIT_ViewWindow.h"
-#include "PyConsole_Console.h"
+#include "SalomePyConsole_Console.h"
#include <QAction>
#include <QApplication>
PyModuleHelper* getPythonHelper()
{
LightApp_Module* module = getActiveModule();
- PyModuleHelper* helper = module ? qFindChild<PyModuleHelper*>( module, "python_module_helper" ) : 0;
+ PyModuleHelper* helper = module ? module->findChild<PyModuleHelper*>( "python_module_helper" ) : 0;
return helper;
}
virtual void Execute()
{
LightApp_Application* anApp = getApplication();
- if ( anApp ) {
+ if ( anApp && anApp->objectBrowser() ) {
myResult = anApp->objectBrowser()->treeView();
}
}
myResult = (QAction*)module->createAction( myId, myTipText, icon, myMenuText, myStatusText, myKey, module, myToggle );
}
// for Python module, automatically connect action to callback slot
- PyModuleHelper* helper = qFindChild<PyModuleHelper*>( module, "python_module_helper" );
+ PyModuleHelper* helper = module->findChild<PyModuleHelper*>( "python_module_helper" );
if ( helper ) helper->connectAction( myResult );
}
}
// specific processing for ParaView viewer:
// hierarchy of ParaView viewer is much complex than for usual view;
// we look for sub-widget named "Viewport"
- QList<QWidget*> lst = qFindChildren<QWidget*>( wnd, "Viewport" );
+ QList<QWidget*> lst = wnd->findChildren<QWidget*>( "Viewport" );
if ( !lst.isEmpty() ) {
lst[0]->resize( myWndWidth, myWndHeight );
myResult = true;
QWidget* wnd = viewMgr->getActiveView();
myResult = viewMgr->getActiveView()->getId();
if ( wnd ) {
- wnd->setShown(myVisible);
+ if ( !myVisible )
+ wnd->setVisible(false);
if ( !myVisible && myWidth == 0 && myHeight == 0 ) {
myWidth = 1024;
myHeight = 768;
virtual void Execute()
{
if ( getApplication() ) {
- PyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
+ SalomePyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
if ( pyConsole ) pyConsole->startLog( myFileName );
}
}
virtual void Execute()
{
if ( getApplication() ) {
- PyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
+ SalomePyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
if ( pyConsole ) pyConsole->stopLog();
}
}