From: akl Date: Thu, 24 Apr 2014 14:00:14 +0000 (+0400) Subject: 0022565: [CEA 1145] Missing WT_NoteBook in python: X-Git-Tag: V7_4_0rc1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=127e3c088a1aabbb704363368a152a88cc896895;p=modules%2Fgui.git 0022565: [CEA 1145] Missing WT_NoteBook in python: 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). --- diff --git a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt index 5a914f487..c8c60125a 100755 --- a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt +++ b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt @@ -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} diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h index 084529e3b..6d3a0122a 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h @@ -33,6 +33,9 @@ #include #include +#ifndef GUI_DISABLE_CORBA +#include +#endif #include #include @@ -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 diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index b02119186..78af0cd11 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -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 diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 0ae89d09d..6bab8edef 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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& 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& 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 diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index f38b410a4..b7355d901 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -107,7 +107,6 @@ public: virtual bool useStudy( const QString& ); virtual void updateDesktopTitle(); - virtual void currentWindows( QMap& ) const; #ifndef DISABLE_PYCONSOLE virtual void setNoteBook(SalomeApp_NoteBook* theNoteBook); @@ -161,8 +160,6 @@ protected: virtual QMap activateModuleActions() const; virtual void moduleActionSelected( const int ); - virtual void defaultWindows( QMap& ) const; - void objectBrowserColumnsVisibility(); #ifndef DISABLE_PYCONSOLE