]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Emit save signal with Exit flag.
authoradv <adv@opencascade.com>
Tue, 17 Jul 2012 05:18:06 +0000 (05:18 +0000)
committeradv <adv@opencascade.com>
Tue, 17 Jul 2012 05:18:06 +0000 (05:18 +0000)
src/STD/STD_Application.cxx
src/STD/STD_Application.h

index 792ab4cb9bf65312425d202763e2ae94f72fbacb..2d8820999df24ebf4b5267e6071ab6d9bc60f867 100755 (executable)
@@ -437,8 +437,8 @@ bool STD_Application::closeAction( const int choice, bool& closePermanently )
   {
   case CloseSave:
     if ( activeStudy()->isSaved() )
-      onSaveDoc();
-    else if ( !onSaveAsDoc() )
+      onSaveDoc( true );
+    else if ( !onSaveAsDoc( true ) )
       res = false;
     break;
   case CloseDiscard:
@@ -504,14 +504,14 @@ bool STD_Application::openAction( const int choice, const QString& aName )
 }
 
 /*!Save document if all ok, else error message.*/
-void STD_Application::onSaveDoc()
+void STD_Application::onSaveDoc( bool exit )
 {
   if ( !activeStudy() )
     return;
 
   if ( myCustomPersistence )
   {
-    emit saveDoc();
+    emit saveDoc( exit );
     return;
   }
 
@@ -540,11 +540,11 @@ void STD_Application::onSaveDoc()
   if ( isOk )
     studySaved( activeStudy() );
   else
-    onSaveAsDoc();
+    onSaveAsDoc( exit );
 }
 
 /*! \retval TRUE, if doument saved successful, else FALSE.*/
-bool STD_Application::onSaveAsDoc()
+bool STD_Application::onSaveAsDoc( bool exit )
 {
   SUIT_Study* study = activeStudy();
   if ( !study )
@@ -552,7 +552,7 @@ bool STD_Application::onSaveAsDoc()
 
   if ( myCustomPersistence )
   {
-    emit saveAsDoc();
+    emit saveAsDoc( exit );
     return true;
   }
 
index 6c069f9346a04a4591124b650217ed23173fdefa..5c3cb5bacc68ad553819199afb6a54e9c410ca9f 100755 (executable)
@@ -120,16 +120,16 @@ signals:
   void                  newDoc( const QString& );
   void                  closeDoc();
   void                  openDoc();
-  void                  saveDoc();
-  void                  saveAsDoc();
+  void                  saveDoc( bool exit );
+  void                  saveAsDoc( bool exit );
 
 public slots:
   virtual void          onNewDoc();
   virtual bool          onNewDoc( const QString& );
 
   virtual void          onCloseDoc( bool ask = true );
-  virtual void          onSaveDoc();
-  virtual bool          onSaveAsDoc();
+  virtual void          onSaveDoc( bool exit = false );
+  virtual bool          onSaveAsDoc( bool exit = false );
 
   virtual void          onOpenDoc();
   virtual bool          onOpenDoc( const QString& );