X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLightApp%2FLightApp_Application.h;h=da8ffc266784632ec2c2b127d5b9f031a4c14576;hb=60dfa5505a35714e1ff59b424514100648e38cab;hp=967676ef11f12849cc4bd6573aa0a43cd36054ac;hpb=f25a7d782e3629f303c2d915eab4d7440c892b3f;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 967676ef1..da8ffc266 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -33,14 +33,17 @@ #include "LightApp.h" #include +#include #include #include #include class LogWindow; +class QtxInfoPanel; #ifndef DISABLE_PYCONSOLE class PyConsole_Console; +class PyConsole_Interp; #endif class LightApp_WidgetContainer; class LightApp_Preferences; @@ -50,6 +53,7 @@ class LightApp_DataObject; class SUIT_DataBrowser; class SUIT_Study; class SUIT_Accel; +class SUIT_ViewModel; class CAM_Module; class QString; @@ -72,6 +76,7 @@ class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application, public SUIT public: typedef enum { WT_ObjectBrowser, + WT_InfoPanel, #ifndef DISABLE_PYCONSOLE WT_PyConsole, #endif @@ -85,7 +90,8 @@ public: CloseId, CloseAllId, GroupAllId, PreferencesId, MRUId, ModulesListId, NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, - NewQxSceneViewId, NewGraphicsViewId, StyleId, FullScreenId, + NewQxSceneViewId, NewGraphicsViewId, NewPVViewId, NewPyViewerId, StyleId, FullScreenId, + WebSiteId, ForumId, VideosId, TutorialsId, UserID }; protected: @@ -107,6 +113,7 @@ public: LogWindow* logWindow(); SUIT_DataBrowser* objectBrowser(); + QtxInfoPanel* infoPanel(); #ifndef DISABLE_PYCONSOLE PyConsole_Console* pythonConsole(const bool force = false); #endif @@ -115,7 +122,7 @@ public: LightApp_Preferences* preferences() const; - virtual QString getFileFilter() const; + virtual QString getFileFilter( bool ) const; virtual QString getFileName( bool open, const QString& initial, const QString& filters, const QString& caption, QWidget* parent ); @@ -128,16 +135,18 @@ public: SUIT_ViewManager* getViewManager( const QString&, const bool ); virtual void addViewManager( SUIT_ViewManager* ); virtual void removeViewManager( SUIT_ViewManager* ); - virtual SUIT_ViewManager* createViewManager( const QString& vmType ); + virtual SUIT_ViewManager* createViewManager( const QString& vmType, bool detached = false ); virtual SUIT_ViewManager* createViewManager( const QString& vmType, QWidget* w ); + virtual SUIT_ViewManager* createViewManager( SUIT_ViewModel* ); - QWidget* getWindow( const int, const int = -1 ); + QWidget* getWindow( const int ); QWidget* dockWindow( const int ) const; void removeDockWindow( const int ); void insertDockWindow( const int, QWidget* ); void placeDockWindow( const int, Qt::DockWidgetArea ); virtual void start(); + virtual void closeApplication(); virtual void contextMenuPopup( const QString&, QMenu*, QString& ); @@ -149,8 +158,6 @@ public: void setDefaultStudyName( const QString& theName ); - static int studyId(); - virtual bool event( QEvent* ); virtual bool checkDataObject( LightApp_DataObject* theObj ); @@ -174,11 +181,21 @@ public: void emitOperationFinished( const QString&, const QString&, const QStringList& ); + void updateVisibilityState( DataObjectList& theList, + SUIT_ViewModel* theViewModel ); + + virtual bool checkExistingDoc( bool = true ); + +#ifndef DISABLE_PYCONSOLE + PyConsole_Interp* getPyInterp(); +#endif + signals: void studyOpened(); void studySaved(); void studyClosed(); void preferenceChanged( const QString&, const QString&, const QString& ); + void preferenceResetToDefaults(); void operationFinished( const QString&, const QString&, const QStringList& ); public slots: @@ -186,13 +203,16 @@ public slots: virtual void onHelpContextModule( const QString&, const QString&, const QString& = QString() ); virtual void onNewDoc(); virtual void onOpenDoc(); + virtual void onHelpAbout(); virtual bool onOpenDoc( const QString& ); virtual void onCopy(); virtual void onPaste(); virtual void onSelectionChanged(); + virtual void onDockWindowVisibilityChanged( bool ); protected: + void showHelp( const QString& ); virtual void createActions(); virtual void createActionForViewer( const int id, const int parentId, @@ -206,6 +226,8 @@ protected: virtual void setActiveStudy( SUIT_Study* ); virtual void updateCommandsStatus(); + virtual bool canOpenDoc( const QString& ); + virtual void beforeCloseDoc( SUIT_Study* ); virtual void afterCloseDoc(); virtual void moduleAdded( CAM_Module* ); @@ -221,17 +243,23 @@ protected: virtual QMap activateModuleActions() const; virtual void moduleActionSelected( const int ); +#ifndef DISABLE_PYCONSOLE + virtual PyConsole_Interp* createPyInterp(); +#endif + protected slots: virtual void onDesktopActivated(); + virtual void onViewManagerRemoved( SUIT_ViewManager* ); + virtual void onWindowActivated( SUIT_ViewWindow* theViewWindow ); void onNewWindow(); - void onModuleActivation( const QString& ); + virtual void onModuleActivation( const QString& ); void onCloseView( SUIT_ViewManager* ); - void onStudyCreated( SUIT_Study* ); - void onStudyOpened( SUIT_Study* ); - void onStudySaved( SUIT_Study* ); - void onStudyClosed( SUIT_Study* ); + virtual void onStudyCreated( SUIT_Study* ); + virtual void onStudyOpened( SUIT_Study* ); + virtual void onStudySaved( SUIT_Study* ); + virtual void onStudyClosed( SUIT_Study* ); void onWCDestroyed( QObject* ); @@ -242,6 +270,8 @@ protected slots: virtual void onDesktopMessage( const QString& ); + virtual void onInfoPanelShown(); + private slots: void onSelection(); void onRefresh(); @@ -252,6 +282,8 @@ private slots: void onCloseWindow(); void onCloseAllWindow(); void onGroupAllWindow(); + void onRenamed(); + //void onMoved(); protected: void updateWindows(); @@ -259,6 +291,8 @@ protected: void updateModuleActions(); void removeModuleAction( const QString& ); + bool checkModule( const QString& ); + void loadDockWindowsState(); void saveDockWindowsState(); @@ -273,8 +307,6 @@ protected: void currentViewManagers( QStringList& ) const; void moduleIconNames( QMap& ) const; - bool isLibExists( const QString& ) const; - QDockWidget* windowDock( QWidget* ) const; QByteArray dockWindowsState( const QMap&, const QMap& ) const; void dockWindowsState( const QByteArray&, QMap&, QMap& ) const; @@ -283,12 +315,17 @@ protected: virtual bool openAction( const int, const QString& ); void showPreferences( const QString& = QString() ); + void showPreferences( const QStringList& ); private: void emptyPreferences( const QString& ); - QList findToolBars(); + QList findToolBars( const QStringList& names = QStringList() ); - QByteArray processState(QByteArray& input, const bool processWin,const bool processTb, QByteArray defaultState = QByteArray()); + QByteArray processState(QByteArray& input, + const bool processWin, + const bool processTb, + const bool isRestoring, + QByteArray defaultState = QByteArray()); protected: typedef QPointer WinPtr; @@ -312,8 +349,9 @@ protected: static LightApp_Preferences* _prefs_; - static int lastStudyId; QStringList myUserWmTypes; + + friend void LightAppCleanUpAppResources(); }; #ifdef WIN32