]> SALOME platform Git repositories - modules/gui.git/blobdiff - src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
Salome HOME
Copyright update: 2016
[modules/gui.git] / src / SALOME_PYQT / SalomePyQt / SalomePyQt.cxx
index 42e81242522eee4b6f09cc20aa9e859c5276a212..9cb8b540b758d86bfcbd66cbc29cbab67e1409c3 100644 (file)
@@ -1,4 +1,4 @@
-// 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
@@ -61,7 +61,7 @@
 #include "SUIT_Tools.h"
 #include "SUIT_ViewManager.h"
 #include "SUIT_ViewWindow.h"
-#include "PyConsole_Console.h"
+#include "SalomePyConsole_Console.h"
 
 #include <QAction>
 #include <QApplication>
@@ -120,7 +120,7 @@ namespace
   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;
   }
   
@@ -500,7 +500,7 @@ public:
   virtual void Execute()
   {
     LightApp_Application* anApp = getApplication();
-    if ( anApp ) {
+    if ( anApp && anApp->objectBrowser() ) {
       myResult = anApp->objectBrowser()->treeView();
     }
   }
@@ -1940,7 +1940,7 @@ public:
        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 );
     }
   }
@@ -2561,7 +2561,7 @@ public:
           // 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;
@@ -2714,7 +2714,8 @@ public:
         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;
@@ -4000,7 +4001,7 @@ void SalomePyQt::startPyLog( const QString& theFileName )
     virtual void Execute() 
     {
       if ( getApplication() ) {
-       PyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
+       SalomePyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
        if ( pyConsole ) pyConsole->startLog( myFileName );
       }
     }
@@ -4020,7 +4021,7 @@ void SalomePyQt::stopPyLog()
     virtual void Execute() 
     {
       if ( getApplication() ) {
-       PyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
+       SalomePyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
        if ( pyConsole ) pyConsole->stopLog();
       }
     }