From: stv Date: Tue, 22 Nov 2005 11:46:17 +0000 (+0000) Subject: no message X-Git-Tag: BR_3_1_0_deb~57 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a49c61458891c632081e3ed31650d728733f31c7;p=modules%2Fgui.git no message --- diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index e3ef0126c..374bce1fc 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -221,15 +221,15 @@ void STD_Application::onNewDoc() { createEmptyStudy(); activeStudy()->createDocument(); - updateDesktopTitle(); - updateCommandsStatus(); + studyCreated( activeStudy() ); } else { SUIT_Application* aApp = startApplication( 0, 0 ); if ( aApp->inherits( "STD_Application" ) ) ((STD_Application*)aApp)->onNewDoc(); - else { + else + { aApp->createEmptyStudy(); aApp->activeStudy()->createDocument(); } @@ -445,7 +445,7 @@ void STD_Application::onSaveDoc() } if ( isOk ) - updateCommandsStatus(); + studySaved( activeStudy() ); else onSaveAsDoc(); } @@ -478,8 +478,7 @@ bool STD_Application::onSaveAsDoc() tr( "INF_DOC_SAVING_FAILS" ).arg( aName ), tr( "BUT_OK" ) ); } - updateDesktopTitle(); - updateCommandsStatus(); + studySaved( activeStudy() ); return isOk; } @@ -521,9 +520,11 @@ void STD_Application::setEditEnabled( bool theEnable ) /*!\retval true, if document opened successful, else false.*/ bool STD_Application::useFile(const QString& theFileName) { - bool res = SUIT_Application::useFile(theFileName); - updateDesktopTitle(); - updateCommandsStatus(); + bool res = SUIT_Application::useFile( theFileName ); + + if ( res ) + studyOpened( activeStudy() ); + return res; } @@ -809,3 +810,21 @@ void STD_Application::setDesktop( SUIT_Desktop* desk ) connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ), this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) ); } + +void STD_Application::studyCreated( SUIT_Study* ) +{ + updateDesktopTitle(); + updateCommandsStatus(); +} + +void STD_Application::studyOpened( SUIT_Study* ) +{ + updateDesktopTitle(); + updateCommandsStatus(); +} + +void STD_Application::studySaved( SUIT_Study* ) +{ + updateDesktopTitle(); + updateCommandsStatus(); +} diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index aa15b2477..d5236f790 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -111,6 +111,10 @@ protected: virtual void setDesktop( SUIT_Desktop* ); + virtual void studySaved( SUIT_Study* ); + virtual void studyOpened( SUIT_Study* ); + virtual void studyCreated( SUIT_Study* ); + virtual void beforeCloseDoc( SUIT_Study* theDoc ); virtual void afterCloseDoc();