+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
#include "STD_Application.h"
#include "STD_MDIDesktop.h"
+#include "STD_CloseDlg.h"
+
#include <SUIT_Tools.h>
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
#include <qfiledialog.h>
#include <qapplication.h>
+#include <iostream>
+
+/*!Create and return new instance of STD_Application*/
extern "C" STD_EXPORT SUIT_Application* createApplication()
{
return new STD_Application();
}
+/*!Constructor.*/
STD_Application::STD_Application()
: SUIT_Application(),
myEditEnabled( true ),
{
STD_MDIDesktop* desk = new STD_MDIDesktop();
- connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ),
- this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) );
-
setDesktop( desk );
}
+/*!Destructor.*/
STD_Application::~STD_Application()
{
}
+/*! \retval QString "StdApplication"*/
QString STD_Application::applicationName() const
{
return QString( "StdApplication" );
}
+/*!Start STD_Application*/
void STD_Application::start()
{
createActions();
updateCommandsStatus();
setEditEnabled( myEditEnabled );
+ loadPreferences();
+
SUIT_Application::start();
}
-void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e )
+/*!
+ Close the Application
+*/
+void STD_Application::closeApplication()
{
- if ( !isPossibleToClose() )
- {
- e->ignore();
- return;
- }
-
+ if ( desktop() )
+ savePreferences();
SUIT_Study* study = activeStudy();
- if ( study )
+ if ( study ){
study->closeDocument();
- setActiveStudy( 0 );
- delete study;
+ setActiveStudy( 0 );
+ delete study;
+ }
setDesktop( 0 );
+
+ SUIT_Application::closeApplication();
+}
+
+/*!Event on closing desktop*/
+void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e )
+{
+ if ( SUIT_Session::session()->applications().count() < 2 )
+ {
+ onExit();
+ return;
+ }
+
+ if ( !isPossibleToClose() )
+ {
+ e->ignore();
+ return;
+ }
closeApplication();
}
+/*!Create actions, menus and tools*/
void STD_Application::createActions()
{
SUIT_Desktop* desk = desktop();
createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIconSet(),
tr( "MEN_DESK_FILE_SAVEAS" ), tr( "PRP_DESK_FILE_SAVEAS" ),
- 0, desk, false, this, SLOT( onSaveAsDoc() ) );
+ CTRL+Key_A, desk, false, this, SLOT( onSaveAsDoc() ) );
createAction( EditCopyId, tr( "TOT_DESK_EDIT_COPY" ),
resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ),
QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ),
QIconSet(), tr( "MEN_DESK_VIEW_STATUSBAR" ),
- tr( "PRP_DESK_VIEW_STATUSBAR" ), 0, desk, true );
+ tr( "PRP_DESK_VIEW_STATUSBAR" ), SHIFT+Key_S, desk, true );
a->setOn( desk->statusBar()->isVisibleTo( desk ) );
connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onViewStatusBar( bool ) ) );
createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIconSet(),
tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
- 0, desk, false, this, SLOT( onHelpAbout() ) );
+ SHIFT+Key_A, desk, false, this, SLOT( onHelpAbout() ) );
+
+ //SRN: BugID IPAL9021, add an action "Load"
+ createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
+ resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
+ tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
+ CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+ //SRN: BugID IPAL9021: End
QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk );
registerAction( ViewWindowsId, da );
// Create menus
- int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1, 0 );
- int editMenu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1, 10 );
- int viewMenu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1, 10 );
- int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
+ int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1, MenuFileId, 0 );
+ int editMenu = createMenu( tr( "MEN_DESK_EDIT" ), -1, MenuEditId, 10 );
+ int viewMenu = createMenu( tr( "MEN_DESK_VIEW" ), -1, MenuViewId, 10 );
+ int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, MenuHelpId, 1000 );
// Create menu items
- createMenu( FileNewId, fileMenu, 0 );
- createMenu( FileOpenId, fileMenu, 0 );
- createMenu( FileCloseId, fileMenu, 0 );
- createMenu( separator(), fileMenu, -1, 0 );
- createMenu( FileSaveId, fileMenu, 0 );
+ createMenu( FileNewId, fileMenu, 0 );
+ createMenu( FileOpenId, fileMenu, 0 );
+ createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load"
+ createMenu( FileCloseId, fileMenu, 0 );
+ createMenu( separator(), fileMenu, -1, 0 );
+ createMenu( FileSaveId, fileMenu, 0 );
createMenu( FileSaveAsId, fileMenu, 0 );
- createMenu( separator(), fileMenu, -1, 0 );
+ createMenu( separator(), fileMenu, -1, 0 );
- createMenu( separator(), fileMenu );
- createMenu( FileExitId, fileMenu );
+ createMenu( separator(), fileMenu );
+ createMenu( FileExitId, fileMenu );
- createMenu( EditCopyId, editMenu );
+ createMenu( EditCopyId, editMenu );
createMenu( EditPasteId, editMenu );
createMenu( separator(), editMenu );
- createMenu( ViewWindowsId, viewMenu );
+ createMenu( ViewWindowsId, viewMenu );
createMenu( ViewStatusBarId, viewMenu );
- createMenu( separator(), viewMenu );
+ createMenu( separator(), viewMenu );
createMenu( HelpAboutId, helpMenu );
createMenu( separator(), helpMenu );
createTool( EditPasteId, stdTBar );
}
-/*!
- Opens new application
-*/
-void STD_Application::onNewDoc()
+/*!Opens new application*/
+void STD_Application::onNewDoc()
{
+ QApplication::setOverrideCursor( Qt::waitCursor );
+
if ( !activeStudy() )
{
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();
}
}
+
+ QApplication::restoreOverrideCursor();
}
+/*!Put file name from file dialog to onOpenDoc(const QString&) function*/
void STD_Application::onOpenDoc()
{
// It is preferrable to use OS-specific file dialog box here !!!
onOpenDoc( aName );
}
+/*! \retval true, if document was opened successful, else false.*/
bool STD_Application::onOpenDoc( const QString& aName )
{
+ QApplication::setOverrideCursor( Qt::waitCursor );
+
bool res = true;
if ( !activeStudy() )
{
// if no study - open in current desktop
- // jfa 21.06.2005:createEmptyStudy();
- // jfa 21.06.2005:res = activeStudy()->openDocument( aName );
- // jfa 21.06.2005:updateDesktopTitle();
- // jfa 21.06.2005:updateCommandsStatus();
- res = useFile( aName ); // jfa 21.06.2005
+ res = useFile( aName );
}
else
{
aApp = startApplication( 0, 0 );
if ( aApp )
res = aApp->useFile( aName );
+ if ( !res )
+ aApp->closeApplication();
}
else
aApp->desktop()->setActiveWindow();
}
+
+ QApplication::restoreOverrideCursor();
+
return res;
}
+/*! called on loading the existent study */
+void STD_Application::onLoadDoc()
+{
+}
+
+/*! \retval true, if document was loaded successful, else false.*/
bool STD_Application::onLoadDoc( const QString& aName )
{
bool res = true;
}
if ( !isAlreadyOpen )
{
- // temporary commented because of "pure virtual method called" execution error.
- // current state of code is not right, but works somehow.
- // SALOMEDS::Study of the first found application is replaced by the new one,
- // while normally the new study must be used by a new application
- //jfa tmp:aApp = startApplication( 0, 0 );
+ aApp = startApplication( 0, 0 );
if ( aApp )
res = aApp->useStudy( aName );
}
return res;
}
+/*!Virtual function. Not implemented here.*/
void STD_Application::beforeCloseDoc( SUIT_Study* )
{
}
+/*!Virtual function. Not implemented here.*/
void STD_Application::afterCloseDoc()
{
}
-void STD_Application::onCloseDoc()
+/*!Close document, if it's possible.*/
+void STD_Application::onCloseDoc( bool ask )
{
- if ( !isPossibleToClose() )
+ if ( ask && !isPossibleToClose() )
return;
SUIT_Study* study = activeStudy();
beforeCloseDoc( study );
if ( study )
- study->closeDocument();
+ study->closeDocument(myClosePermanently);
clearViewManagers();
// STV: aNbStudies - number of currently existing studies (exclude currently closed)
// STV: aNbStudies should be compared with 0.
if ( aNbStudies )
+ {
+ savePreferences();
setDesktop( 0 );
+ }
else
{
updateDesktopTitle();
closeApplication();
}
+/*!Check the application on closing.
+ * \retval true if possible, else false
+ */
bool STD_Application::isPossibleToClose()
{
+ myClosePermanently = true; //SRN: BugID: IPAL9021
if ( activeStudy() )
{
activeStudy()->abortAllOperations();
{
QString sName = activeStudy()->studyName().stripWhiteSpace();
QString msg = sName.isEmpty() ? tr( "INF_DOC_MODIFIED" ) : tr ( "INF_DOCUMENT_MODIFIED" ).arg( sName );
- int aAnswer = SUIT_MessageBox::warn3( desktop(), tr( "TOT_DESK_FILE_CLOSE" ), msg,
- tr( "BUT_YES" ), tr( "BUT_NO" ), tr( "BUT_CANCEL" ), 1, 2, 3, 1 );
- switch ( aAnswer )
+
+ //SRN: BugID: IPAL9021: Begin
+ STD_CloseDlg dlg(desktop());
+ switch( dlg.exec() )
{
case 1:
- if ( !activeStudy()->isSaved() )
- if ( !onSaveAsDoc() )
- return false;
- else
+ if ( activeStudy()->isSaved() )
onSaveDoc();
+ else if ( !onSaveAsDoc() )
+ return false;
break;
case 2:
break;
case 3:
+ myClosePermanently = false;
+ break;
+ case 4:
default:
return false;
}
+ //SRN: BugID: IPAL9021: End
}
}
return true;
}
+/*!Save document if all ok, else error message.*/
void STD_Application::onSaveDoc()
{
if ( !activeStudy() )
bool isOk = false;
if ( activeStudy()->isSaved() )
{
+ putInfo( tr( "INF_DOC_SAVING" ) + activeStudy()->studyName() );
+
+ QApplication::setOverrideCursor( Qt::waitCursor );
+
isOk = activeStudy()->saveDocument();
+
+ QApplication::restoreOverrideCursor();
+
if ( !isOk )
- SUIT_MessageBox::error1( desktop(), tr( "TIT_FILE_SAVEAS" ),
- tr( "MSG_CANT_SAVE" ).arg( activeStudy()->studyName() ), tr( "BUT_OK" ) );
+ {
+ putInfo( "" );
+ // displaying a message box as SUIT_Validator in case file can't be written (the most frequent case)
+ SUIT_MessageBox::error1( desktop(),
+ tr( "ERR_ERROR" ),
+ tr( "ERR_PERMISSION_DENIED" ).arg( activeStudy()->studyName() ),
+ tr( "BUT_OK" ) );
+ }
+ else
+ putInfo( tr( "INF_DOC_SAVED" ).arg( "" ) );
}
if ( isOk )
- updateCommandsStatus();
+ studySaved( activeStudy() );
else
onSaveAsDoc();
}
+/*! \retval TRUE, if doument saved successful, else FALSE.*/
bool STD_Application::onSaveAsDoc()
{
SUIT_Study* study = activeStudy();
if ( !study )
return false;
- QString aName = getFileName( false, study->studyName(), getFileFilter(), QString::null, 0 );
+ bool isOk = false;
+ while ( !isOk )
+ {
+ QString aName = getFileName( false, study->studyName(), getFileFilter(), QString::null, 0 );
+ if ( aName.isNull() )
+ return false;
+
+ QApplication::setOverrideCursor( Qt::waitCursor );
- if ( aName.isNull() )
- return false;
- bool isOk = study->saveDocumentAs( aName );
+ putInfo( tr( "INF_DOC_SAVING" ) + aName );
+ isOk = study->saveDocumentAs( aName );
- updateDesktopTitle();
- updateCommandsStatus();
+ putInfo( isOk ? tr( "INF_DOC_SAVED" ).arg( aName ) : "" );
+
+ QApplication::restoreOverrideCursor();
+
+ if ( !isOk )
+ SUIT_MessageBox::error1( desktop(), tr( "ERROR" ),
+ tr( "INF_DOC_SAVING_FAILS" ).arg( aName ),
+ tr( "BUT_OK" ) );
+ }
+
+ studySaved( activeStudy() );
return isOk;
}
+/*!Closing session.*/
void STD_Application::onExit()
{
- SUIT_Session::session()->closeSession();
+ int aAnswer = SUIT_MessageBox::info2( desktop(), tr( "INF_DESK_EXIT" ), tr( "QUE_DESK_EXIT" ),
+ tr( "BUT_OK" ), tr( "BUT_CANCEL" ), 1, 2, 2 );
+ if ( aAnswer == 1 )
+ SUIT_Session::session()->closeSession();
}
+/*!Virtual slot. Not implemented here.*/
void STD_Application::onCopy()
{
}
+/*!Virtual slot. Not implemented here.*/
void STD_Application::onPaste()
{
}
+/*!Sets \a theEnable for menu manager and for tool manager.*/
void STD_Application::setEditEnabled( bool theEnable )
{
myEditEnabled = theEnable;
for ( int i = EditCopyId; i <= EditPasteId; i++ )
{
- mMgr->setShown( i, myEditEnabled );
- tMgr->setShown( i, myEditEnabled );
+ mMgr->setShown( mMgr->actionId(action(i)), myEditEnabled );
+ tMgr->setShown( tMgr->actionId(action(i)), myEditEnabled );
}
}
+/*!\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;
}
+/*!Update desktop title.*/
void STD_Application::updateDesktopTitle()
{
QString aTitle = applicationName();
desktop()->setCaption( aTitle );
}
+/*!Update commands status.*/
void STD_Application::updateCommandsStatus()
{
bool aHasStudy = activeStudy() != 0;
bool aIsNeedToSave = false;
- if ( aHasStudy )
+ if ( aHasStudy )
aIsNeedToSave = !activeStudy()->isSaved() || activeStudy()->isModified();
if ( action( FileSaveId ) )
action( NewWindowId )->setEnabled( aHasStudy );
}
+/*!\retval SUIT_ViewManager by viewer manager type name.*/
SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const
{
SUIT_ViewManager* vm = 0;
return vm;
}
+/*! \param vmType - input view manager type name
+ * \param lst - output list of view managers with types \a vmType.
+ */
void STD_Application::viewManagers( const QString& vmType, ViewManagerList& lst ) const
{
for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
lst.append( it.current() );
}
+/*!\param lst - output list of all view managers.*/
void STD_Application::viewManagers( ViewManagerList& lst ) const
{
for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
lst.append( it.current() );
}
+/*!\retval ViewManagerList - const list of all view managers.*/
ViewManagerList STD_Application::viewManagers() const
{
ViewManagerList lst;
return lst;
}
+/*!\retval SUIT_ViewManager - return pointer to active view manager.*/
SUIT_ViewManager* STD_Application::activeViewManager() const
{
return myActiveViewMgr;
}
+/*!Add view manager to view managers list, if it not already there.*/
void STD_Application::addViewManager( SUIT_ViewManager* vm )
{
if ( !vm )
*/
}
+/*!Remove view manager from view managers list.*/
void STD_Application::removeViewManager( SUIT_ViewManager* vm )
{
if ( !vm )
myActiveViewMgr = 0;
}
+/*!Remove all view managers from view managers list.*/
void STD_Application::clearViewManagers()
{
ViewManagerList lst;
removeViewManager( it.current() );
}
+/*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/
bool STD_Application::containsViewManager( SUIT_ViewManager* vm ) const
{
return myViewMgrs.contains( vm ) > 0;
}
+/*!Private slot, sets active manager to \vm, if \vm in view managers list.*/
void STD_Application::onViewManagerActivated( SUIT_ViewManager* vm )
{
setActiveViewManager( vm );
}
+/*!Sets status bar show, if \on = true, else status bar hide.*/
void STD_Application::onViewStatusBar( bool on )
{
if ( on )
desktop()->statusBar()->hide();
}
+/*!Call SUIT_MessageBox::info1(...) with about information.*/
void STD_Application::onHelpAbout()
{
SUIT_MessageBox::info1( desktop(), tr( "About" ), tr( "ABOUT_INFO" ), "&OK" );
}
+/*!Create empty study. \n
+ * Create new view manager and adding it to view managers list.
+ */
void STD_Application::createEmptyStudy()
{
SUIT_Application::createEmptyStudy();
addViewManager( vm );
}
+/*!Sets active manager to \vm, if \vm in view managers list.*/
void STD_Application::setActiveViewManager( SUIT_ViewManager* vm )
{
if ( !containsViewManager( vm ) )
emit viewManagerActivated( vm );
}
+/*!Public slot. */
void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextMenuEvent* e )
{
QtxPopupMenu* popup = new QtxPopupMenu();
popup->insertSeparator();
// add items from popup client
client->contextMenuPopup( popup );
-
+
SUIT_Tools::simplifySeparators( popup );
if ( popup->count() )
delete popup;
}
-QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters,
+#include <qregexp.h>
+
+/*!\retval QString - return file name from dialog.*/
+QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters,
const QString& caption, QWidget* parent )
{
if ( !parent )
parent = desktop();
- if ( open )
+ if ( open )
{
return QFileDialog::getOpenFileName( initial, filters, parent, 0, caption );
}
while ( !isOk )
{
// It is preferrable to use OS-specific file dialog box here !!!
- aName = QFileDialog::getSaveFileName( anOldPath, filters, parent,
- 0, caption, &aUsedFilter);
+ aName = QFileDialog::getSaveFileName( anOldPath, filters, parent, 0, caption, &aUsedFilter );
if ( aName.isNull() )
isOk = true;
else
{
- if ( !getFileFilter().isNull() ) // check extension and add if it is necessary
+ int aEnd = aUsedFilter.findRev( ')' );
+ int aStart = aUsedFilter.findRev( '(', aEnd );
+ QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
+
+ int idx = 0;
+ QStringList extList;
+ QRegExp rx( "[\b\\*]*\\.([\\w]+)" );
+ while ( ( idx = rx.search( wcStr, idx ) ) != -1 )
{
- int aStart = aUsedFilter.find( '*' );
- int aEnd = aUsedFilter.find( ')', aStart + 1 );
- QString aExt = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
- if ( aExt.contains( '*' ) == 0 ) // if it is not *.*
- {
- // Check that there is an extension at the end of the name
- QString aNameTail = aName.right( aExt.length() );
- if ( aNameTail != aExt )
- aName += aExt;
- }
+ extList.append( rx.cap( 1 ) );
+ idx += rx.matchedLength();
}
- if ( QFileInfo( aName ).exists() )
+
+ if ( !extList.isEmpty() && !extList.contains( QFileInfo( aName ).extension() ) )
+ aName += QString( ".%1" ).arg( extList.first() );
+
+ if ( QFileInfo( aName ).exists() )
{
- int aAnswer = SUIT_MessageBox::warn3( desktop(), tr( "TIT_FILE_SAVEAS" ),
- tr( "MSG_FILE_EXISTS" ).arg( aName ),
- tr( "BUT_YES" ), tr( "BUT_NO" ), tr( "BUT_CANCEL" ), 1, 2, 3, 1 );
- if ( aAnswer == 3 ) { // cancelled
+ int aAnswer = SUIT_MessageBox::warn3( desktop(), tr( "TIT_FILE_SAVEAS" ),
+ tr( "MSG_FILE_EXISTS" ).arg( aName ),
+ tr( "BUT_YES" ), tr( "BUT_NO" ), tr( "BUT_CANCEL" ), 1, 2, 3, 1 );
+ if ( aAnswer == 3 )
+ { // cancelled
aName = QString::null;
- isOk = true;
+ isOk = true;
}
- else if ( aAnswer == 2 ) // not save to this file
- anOldPath = aName; // not to return to the same initial dir at each "while" step
- else // overwrite the existing file
- isOk = true;
+ else if ( aAnswer == 2 ) // not save to this file
+ anOldPath = aName; // not to return to the same initial dir at each "while" step
+ else // overwrite the existing file
+ isOk = true;
}
- else
- isOk = true;
+ else
+ isOk = true;
}
}
return aName;
}
}
+/*!\retval QString - return directory name from dialog.*/
QString STD_Application::getDirectory( const QString& initial, const QString& caption, QWidget* parent )
{
if ( !parent )
parent = desktop();
return QFileDialog::getExistingDirectory( initial, parent, 0, caption, true );
}
+
+/*!
+ Changes desktop
+ \param desk - new desktop
+*/
+void STD_Application::setDesktop( SUIT_Desktop* desk )
+{
+ SUIT_Desktop* prev = desktop();
+
+ SUIT_Application::setDesktop( desk );
+
+ if ( prev != desk && desk )
+ connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ),
+ 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()
+{
+}
+
+/*!
+ Custom activity after study is created
+ Updates desktop and actions
+*/
+void STD_Application::studyCreated( SUIT_Study* )
+{
+ updateDesktopTitle();
+ updateCommandsStatus();
+}
+
+/*!
+ Custom activity after study is opened
+ Updates desktop and actions
+*/
+void STD_Application::studyOpened( SUIT_Study* )
+{
+ updateDesktopTitle();
+ updateCommandsStatus();
+}
+
+/*!
+ Custom activity after study is opened
+ Updates desktop and actions
+*/
+void STD_Application::studySaved( SUIT_Study* )
+{
+ updateDesktopTitle();
+ updateCommandsStatus();
+}