]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0022565: [CEA 1145] Missing WT_NoteBook in python:
authorakl <akl@opencascade.com>
Thu, 24 Apr 2014 14:00:14 +0000 (18:00 +0400)
committerakl <akl@opencascade.com>
Thu, 24 Apr 2014 14:00:14 +0000 (18:00 +0400)
1) by default, 'NoteBook' dockable window is enable only in the GEOM and SMESH modules now.
2) added a possibility to enable/disable 'NoteBook' window via Python API (windows() function).

src/SALOME_PYQT/SalomePyQt/CMakeLists.txt
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index 5a914f487395dee3ae96b8f6311ff992738609cf..c8c60125a702756b17c7acaf85180b841a2d3ae3 100755 (executable)
@@ -48,6 +48,15 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/SUIT
 )
 
+IF(SALOME_LIGHT_ONLY)
+  #disable 'ENABLE_CORBA' feature
+  SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} "-xENABLE_CORBA;")
+ELSE(SALOME_LIGHT_ONLY)
+  INCLUDE_DIRECTORIES(
+    ${PROJECT_SOURCE_DIR}/src/SalomeApp
+  )
+ENDIF(SALOME_LIGHT_ONLY)
+
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(
   ${QWT_DEFINITIONS}
index 084529e3b47354c44a622b51c5cc7555df62dad7..6d3a0122a2b0e291ca99e2dab7db4c373292df5f 100644 (file)
@@ -33,6 +33,9 @@
 #include <QColor>
 
 #include <LightApp_Application.h>
+#ifndef GUI_DISABLE_CORBA
+#include <SalomeApp_Application.h>
+#endif
 #include <LightApp_Preferences.h>
 #include <Plot2d_ViewFrame.h>
 
@@ -80,6 +83,9 @@ enum MenuName {
 
 enum {
   WT_ObjectBrowser = LightApp_Application::WT_ObjectBrowser,
+#ifndef GUI_DISABLE_CORBA
+  WT_NoteBook      = SalomeApp_Application::WT_NoteBook,
+#endif
   WT_PyConsole     = LightApp_Application::WT_PyConsole,
   WT_LogWindow     = LightApp_Application::WT_LogWindow,
   WT_User          = LightApp_Application::WT_User
index b021191868a54a077fbc2c559bd85c04c0423b59..78af0cd11662ec53fc161925252912e1f177f196 100644 (file)
@@ -25,6 +25,8 @@
 
 %Module SalomePyQt
 
+%Feature ENABLE_CORBA
+
 %Import QtGuimod.sip
 %Import QtXmlmod.sip
 
@@ -66,6 +68,9 @@ enum MenuName {
 
 enum WindowType {
   WT_ObjectBrowser,
+%If (ENABLE_CORBA)
+  WT_NoteBook,
+%End
   WT_PyConsole,
   WT_LogWindow,
   WT_User
index 0ae89d09dc4f34fd13d61ef5727f3501d111bac4..6bab8edef41dccea24b5996745aa9f23cbd1a46d 100644 (file)
@@ -1854,35 +1854,6 @@ bool SalomeApp_Application::renameObject( const QString& entry, const QString& n
   return false;
 }
 
-/*!
-  \return default windows( Object Browser, Python Console )
-  Adds to map \a aMap.
-*/
-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
-}
-
-/*!
-  Gets current windows.
-  \param winMap - output current windows map.
-*/
-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
index f38b410a4fe5980d1c9cc8c370ef6dbc90205c98..b7355d901d7007164aeb60ffc56d508a0caa4903 100644 (file)
@@ -107,7 +107,6 @@ public:
 
   virtual bool                        useStudy( const QString& );
   virtual void                        updateDesktopTitle();
-  virtual void                        currentWindows( QMap<int, int>& ) const;
 
 #ifndef DISABLE_PYCONSOLE
   virtual void                        setNoteBook(SalomeApp_NoteBook* theNoteBook);
@@ -161,8 +160,6 @@ protected:
   virtual QMap<int, QString>          activateModuleActions() const;
   virtual void                        moduleActionSelected( const int );
 
-  virtual void                        defaultWindows( QMap<int, int>& ) const;
-
   void                                objectBrowserColumnsVisibility();
 
 #ifndef DISABLE_PYCONSOLE