-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015 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
// 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
#include "SalomeApp.h"
#include <LightApp_Application.h>
-#include <SUIT_DataObject.h>
-
#include <omniORB4/CORBA.h>
//#include <SALOMEconfig.h>
class LightApp_Preferences;
class SalomeApp_Study;
+#ifndef DISABLE_PYCONSOLE
class SalomeApp_NoteBook;
+#endif
class SUIT_Desktop;
-
-class SUIT_ViewModel;
class SALOME_LifeCycleCORBA;
public:
enum { MenuToolsId = 5 };
enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
- CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, UserID };
+ CatalogGenId, RegDisplayId, SaveGUIStateId, ConnectId, DisconnectId,
+ UserID };
- typedef enum { WT_NoteBook = LightApp_Application::WT_User } WindowTypes;
+ typedef enum { WT_NoteBook = LightApp_Application::WT_User,
+ WT_User
+ } WindowTypes;
protected:
enum { OpenRefresh = LightApp_Application::OpenReload + 1 };
- enum { CloseUnload = LightApp_Application::CloseDiscard + 1 };
+ enum { CloseDisconnectSave = LightApp_Application::CloseDiscard + 1, CloseDisconnect };
enum { LoadStudyId = LightApp_Application::OpenStudyId + 1, NewAndScriptId };
public:
virtual bool checkDataObject(LightApp_DataObject* theObj);
- virtual void setDesktop( SUIT_Desktop* );
+ virtual bool checkExistingDoc();
static CORBA::ORB_var orb();
static SALOMEDSClient_StudyManager* studyMgr();
virtual bool useStudy( const QString& );
virtual void updateDesktopTitle();
- virtual void currentWindows( QMap<int, int>& ) const;
-
+
+#ifndef DISABLE_PYCONSOLE
virtual void setNoteBook(SalomeApp_NoteBook* theNoteBook);
virtual SalomeApp_NoteBook* getNoteBook() const;
-
- //! update visibility state of objects
- void updateVisibilityState( DataObjectList& theList,
- SUIT_ViewModel* theViewModel );
+#endif
virtual bool renameAllowed( const QString& ) const;
virtual bool renameObject( const QString&, const QString& );
-
+
public slots:
virtual void onLoadDoc();
virtual void onNewWithScript();
virtual bool onLoadDoc( const QString& );
+ virtual void onUnloadDoc( bool ask = true);
virtual void onCloseDoc( bool ask = true);
virtual void onExit();
virtual void onCopy();
virtual void onPaste();
void onSaveGUIState();// called from VISU
+#ifndef DISABLE_PYCONSOLE
void onUpdateStudy(); // called from NoteBook
+#endif
bool onRestoreStudy( const QString& theDumpScript,
- const QString& theStudyName,
- bool theIsStudySaved );
+ const QString& theStudyName,
+ bool theIsStudySaved );
+
+ virtual void onDockWindowVisibilityChanged( bool );
protected slots:
void onStudyCreated( SUIT_Study* );
- void onStudySaved( SUIT_Study* );
void onStudyOpened( SUIT_Study* );
- void onStudyClosed( SUIT_Study* );
-
- void onViewManagerRemoved( SUIT_ViewManager* );
+ void onDesktopMessage( const QString& );
protected:
virtual void createActions();
virtual QMap<int, QString> activateModuleActions() const;
virtual void moduleActionSelected( const int );
- virtual void defaultWindows( QMap<int, int>& ) const;
-
void objectBrowserColumnsVisibility();
+#ifndef DISABLE_PYCONSOLE
bool updateStudy();
+ virtual PyConsole_Interp* createPyInterp();
+#endif
- virtual void closeApplication();
+ virtual void afterCloseDoc();
private slots:
void onDeleteInvalidReferences();
void onOpenWith();
void onExtAction();
- void onWindowActivated( SUIT_ViewWindow* theViewWindow );
-
private:
void createExtraActions();
private:
- QPointer<SalomeApp_NoteBook> myNoteBook;
- QMap<QString, QAction*> myExtActions; // Map <AttributeUserID, QAction>
+#ifndef DISABLE_PYCONSOLE
+ QPointer<SalomeApp_NoteBook> myNoteBook; // Notebook instance
+#endif
+ QMap<QString, QAction*> myExtActions; // Map <AttributeUserID, QAction>
+ bool myIsCloseFromExit; // "Close from Exit" flag
signals:
- void dumpedStudyClosed( const QString& theDumpScript,
- const QString& theStudyName,
- bool theIsStudySaved );
+ void dumpedStudyClosed( const QString& theDumpScript,
+ const QString& theStudyName,
+ bool theIsStudySaved );
void notebookVarUpdated( QString theVarName );
};