Salome HOME
Initial iteration for storage the back references and making concealment only on...
[modules/shaper.git] / src / XGUI / XGUI_MainWindow.h
index 010f9e309530b3cb12289015b259a85908bfdcee..3294f58ac5fd276945c1cd31e6a1b36c9c9c807b 100644 (file)
@@ -18,11 +18,11 @@ class QCloseEvent;
  * \brief Main window of the application (Desktop).
  * It contains: Object Browser, 3d Viewer, Python console, property panel, main menu
  */
-class XGUI_EXPORT XGUI_MainWindow: public QMainWindow
+class XGUI_EXPORT XGUI_MainWindow : public QMainWindow
 {
 Q_OBJECT
 
-public:
+ public:
   XGUI_MainWindow(QWidget* parent = 0);
   virtual ~XGUI_MainWindow();
 
@@ -41,13 +41,28 @@ public:
     return myViewer;
   }
 
-public slots:
+ public slots:
   void showPythonConsole();
   void hidePythonConsole();
+  //! Python console can be a dock widget 
+  void dockPythonConsole();
+  //! or can be a tab in the main menu.
+  void undockPythonConsole();
 
   void createSubWindow();
-  
-private slots:
+
+  /// Add name of current directory into title of desktop window
+  void setCurrentDir(const QString& theDir, bool toUpdate = true);
+
+  /// Add asterisk to a title of the window
+  void setModifiedState(bool isModified, bool toUpdate = true);
+
+  /// Returns current state of modification
+  bool isModifiedState() const { return myIsModified; }
+
+  void updateTitle();
+
+ private slots:
   void cascadeWindows();
   void onViewCreated(XGUI_ViewWindow* theWindow);
   void onDeleteView(XGUI_ViewWindow* theWindow);
@@ -57,14 +72,34 @@ private slots:
 signals:
   void exitKeySequence();
 
-protected:
+ protected:
   void closeEvent(QCloseEvent* event);
+  void createMainMenu();
 
-private:
+ private:
   XGUI_MainMenu* myMenuBar;
   XGUI_Viewer* myViewer;
 
+  QString myTitle;
+  QString myCurrentDir;
+  bool myIsModified;
+
   PyConsole_EnhConsole* myPythonConsole;
 };
 
+class XGUI_EXPORT CloseEventWatcher : public QObject
+{
+Q_OBJECT
+
+ public:
+  CloseEventWatcher(QObject* theParent);
+
+signals:
+  void widgetClosed();
+
+ protected:
+  bool eventFilter(QObject *obj, QEvent *);
+
+};
+
 #endif