{
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();
}
}
if ( isOk )
- updateCommandsStatus();
+ studySaved( activeStudy() );
else
onSaveAsDoc();
}
tr( "INF_DOC_SAVING_FAILS" ).arg( aName ), tr( "BUT_OK" ) );
}
- updateDesktopTitle();
- updateCommandsStatus();
+ studySaved( activeStudy() );
return isOk;
}
/*!\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;
}
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();
+}
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();