From c52e909ed39b4aab6f891034cbc4d62b64c3cd75 Mon Sep 17 00:00:00 2001 From: adv Date: Tue, 17 Jul 2012 05:18:06 +0000 Subject: [PATCH] Emit save signal with Exit flag. --- src/STD/STD_Application.cxx | 14 +++++++------- src/STD/STD_Application.h | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 792ab4cb9..2d8820999 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -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; } diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index 6c069f934..5c3cb5bac 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -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& ); -- 2.39.2