updateCommandsStatus();
setEditEnabled( myEditEnabled );
+ loadPreferences();
+
SUIT_Application::start();
}
+/*!
+ Close the Application
+*/
+void STD_Application::closeApplication()
+{
+ if ( desktop() )
+ savePreferences();
+
+ SUIT_Application::closeApplication();
+}
+
/*!Event on closing desktop*/
void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e )
{
- if (SUIT_Session::session()->applications().count() < 2) {
+ if ( SUIT_Session::session()->applications().count() < 2 )
+ {
onExit();
return;
}
setActiveStudy( 0 );
delete study;
+ savePreferences();
+
setDesktop( 0 );
closeApplication();
// STV: aNbStudies - number of currently existing studies (exclude currently closed)
// STV: aNbStudies should be compared with 0.
if ( aNbStudies )
+ {
+ savePreferences();
setDesktop( 0 );
+ }
else
{
updateDesktopTitle();
this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) );
}
+/*!
+ Allow to load preferences before the desktop will be shown.
+*/
+void STD_Application::loadPreferences()
+{
+}
+
+/*!
+ Allow to save preferences before the application will be closed.
+*/
+void STD_Application::savePreferences()
+{
+}
+
void STD_Application::studyCreated( SUIT_Study* )
{
updateDesktopTitle();
virtual void start();
+ virtual void closeApplication();
+
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& ) {}
signals:
virtual void setDesktop( SUIT_Desktop* );
+ virtual void loadPreferences();
+ virtual void savePreferences();
+
virtual void studySaved( SUIT_Study* );
virtual void studyOpened( SUIT_Study* );
virtual void studyCreated( SUIT_Study* );