1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #include "STD_Application.h"
21 #include "STD_MDIDesktop.h"
23 #include "STD_CloseDlg.h"
25 #include <SUIT_Tools.h>
26 #include <SUIT_Desktop.h>
27 #include <SUIT_Session.h>
28 #include <SUIT_ViewModel.h>
29 #include <SUIT_Operation.h>
30 #include <SUIT_MessageBox.h>
31 #include <SUIT_ResourceMgr.h>
33 #include <QtxDockAction.h>
34 #include <QtxActionMenuMgr.h>
35 #include <QtxActionToolMgr.h>
36 #include <QtxPopupMenu.h>
40 #include <qpopupmenu.h>
41 #include <qstatusbar.h>
42 #include <qfiledialog.h>
43 #include <qapplication.h>
47 /*!Create and return new instance of STD_Application*/
48 extern "C" STD_EXPORT SUIT_Application* createApplication()
50 return new STD_Application();
54 STD_Application::STD_Application()
56 myEditEnabled( true ),
59 STD_MDIDesktop* desk = new STD_MDIDesktop();
65 STD_Application::~STD_Application()
69 /*! \retval QString "StdApplication"*/
70 QString STD_Application::applicationName() const
72 return QString( "StdApplication" );
75 /*!Start STD_Application*/
76 void STD_Application::start()
81 updateCommandsStatus();
82 setEditEnabled( myEditEnabled );
84 SUIT_Application::start();
87 /*!Event on closing desktop*/
88 void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e )
90 if (SUIT_Session::session()->applications().count() < 2) {
95 if ( !isPossibleToClose() )
101 SUIT_Study* study = activeStudy();
104 study->closeDocument();
114 /*!Create actions, menus and tools*/
115 void STD_Application::createActions()
117 SUIT_Desktop* desk = desktop();
118 SUIT_ResourceMgr* resMgr = resourceMgr();
119 if ( !desk || !resMgr )
124 createAction( FileNewId, tr( "TOT_DESK_FILE_NEW" ),
125 resMgr->loadPixmap( "STD", tr( "ICON_FILE_NEW" ) ),
126 tr( "MEN_DESK_FILE_NEW" ), tr( "PRP_DESK_FILE_NEW" ),
127 CTRL+Key_N, desk, false, this, SLOT( onNewDoc() ) );
129 createAction( FileOpenId, tr( "TOT_DESK_FILE_OPEN" ),
130 resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
131 tr( "MEN_DESK_FILE_OPEN" ), tr( "PRP_DESK_FILE_OPEN" ),
132 CTRL+Key_O, desk, false, this, SLOT( onOpenDoc() ) );
134 createAction( FileCloseId, tr( "TOT_DESK_FILE_CLOSE" ),
135 resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ),
136 tr( "MEN_DESK_FILE_CLOSE" ), tr( "PRP_DESK_FILE_CLOSE" ),
137 CTRL+Key_W, desk, false, this, SLOT( onCloseDoc() ) );
139 createAction( FileExitId, tr( "TOT_DESK_FILE_EXIT" ), QIconSet(),
140 tr( "MEN_DESK_FILE_EXIT" ), tr( "PRP_DESK_FILE_EXIT" ),
141 CTRL+Key_Q, desk, false, this, SLOT( onExit() ) );
143 createAction( FileSaveId, tr( "TOT_DESK_FILE_SAVE" ),
144 resMgr->loadPixmap( "STD", tr( "ICON_FILE_SAVE" ) ),
145 tr( "MEN_DESK_FILE_SAVE" ), tr( "PRP_DESK_FILE_SAVE" ),
146 CTRL+Key_S, desk, false, this, SLOT( onSaveDoc() ) );
148 createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIconSet(),
149 tr( "MEN_DESK_FILE_SAVEAS" ), tr( "PRP_DESK_FILE_SAVEAS" ),
150 0, desk, false, this, SLOT( onSaveAsDoc() ) );
152 createAction( EditCopyId, tr( "TOT_DESK_EDIT_COPY" ),
153 resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ),
154 tr( "MEN_DESK_EDIT_COPY" ), tr( "PRP_DESK_EDIT_COPY" ),
155 CTRL+Key_C, desk, false, this, SLOT( onCopy() ) );
157 createAction( EditPasteId, tr( "TOT_DESK_EDIT_PASTE" ),
158 resMgr->loadPixmap( "STD", tr( "ICON_EDIT_PASTE" ) ),
159 tr( "MEN_DESK_EDIT_PASTE" ), tr( "PRP_DESK_EDIT_PASTE" ),
160 CTRL+Key_V, desk, false, this, SLOT( onPaste() ) );
162 QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ),
163 QIconSet(), tr( "MEN_DESK_VIEW_STATUSBAR" ),
164 tr( "PRP_DESK_VIEW_STATUSBAR" ), 0, desk, true );
165 a->setOn( desk->statusBar()->isVisibleTo( desk ) );
166 connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onViewStatusBar( bool ) ) );
168 createAction( NewWindowId, tr( "TOT_DESK_NEWWINDOW" ), QIconSet(),
169 tr( "MEN_DESK_NEWWINDOW" ), tr( "PRP_DESK_NEWWINDOW" ), 0, desk );
171 createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIconSet(),
172 tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
173 0, desk, false, this, SLOT( onHelpAbout() ) );
175 //SRN: BugID IPAL9021, add an action "Load"
176 createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
177 resMgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
178 tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
179 CTRL+Key_L, desk, false, this, SLOT( onLoadDoc() ) );
180 //SRN: BugID IPAL9021: End
182 QtxDockAction* da = new QtxDockAction( tr( "TOT_DOCK_WINDOWS" ), tr( "MEN_DOCK_WINDOWS" ), desk );
183 registerAction( ViewWindowsId, da );
184 da->setAutoPlace( false );
188 int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1, 0 );
189 int editMenu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1, 10 );
190 int viewMenu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1, 10 );
191 int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
195 createMenu( FileNewId, fileMenu, 0 );
196 createMenu( FileOpenId, fileMenu, 0 );
197 createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load"
198 createMenu( FileCloseId, fileMenu, 0 );
199 createMenu( separator(), fileMenu, -1, 0 );
200 createMenu( FileSaveId, fileMenu, 0 );
201 createMenu( FileSaveAsId, fileMenu, 0 );
202 createMenu( separator(), fileMenu, -1, 0 );
204 createMenu( separator(), fileMenu );
205 createMenu( FileExitId, fileMenu );
207 createMenu( EditCopyId, editMenu );
208 createMenu( EditPasteId, editMenu );
209 createMenu( separator(), editMenu );
211 createMenu( ViewWindowsId, viewMenu );
212 createMenu( ViewStatusBarId, viewMenu );
213 createMenu( separator(), viewMenu );
215 createMenu( HelpAboutId, helpMenu );
216 createMenu( separator(), helpMenu );
220 int stdTBar = createTool( tr( "INF_DESK_TOOLBAR_STANDARD" ) );
224 createTool( FileNewId, stdTBar );
225 createTool( FileOpenId, stdTBar );
226 createTool( FileSaveId, stdTBar );
227 createTool( FileCloseId, stdTBar );
228 createTool( separator(), stdTBar );
229 createTool( EditCopyId, stdTBar );
230 createTool( EditPasteId, stdTBar );
233 /*!Opens new application*/
234 void STD_Application::onNewDoc()
236 QApplication::setOverrideCursor( Qt::waitCursor );
238 if ( !activeStudy() )
241 activeStudy()->createDocument();
242 studyCreated( activeStudy() );
246 SUIT_Application* aApp = startApplication( 0, 0 );
247 if ( aApp->inherits( "STD_Application" ) )
248 ((STD_Application*)aApp)->onNewDoc();
251 aApp->createEmptyStudy();
252 aApp->activeStudy()->createDocument();
256 QApplication::restoreOverrideCursor();
259 /*!Put file name from file dialog to onOpenDoc(const QString&) function*/
260 void STD_Application::onOpenDoc()
262 // It is preferrable to use OS-specific file dialog box here !!!
263 QString aName = getFileName( true, QString::null, getFileFilter(), QString::null, 0 );
264 if ( aName.isNull() )
270 /*! \retval true, if document was opened successful, else false.*/
271 bool STD_Application::onOpenDoc( const QString& aName )
273 QApplication::setOverrideCursor( Qt::waitCursor );
276 if ( !activeStudy() )
278 // if no study - open in current desktop
279 res = useFile( aName );
283 // if study exists - open in new desktop. Check: is the same file is opened?
284 SUIT_Session* aSession = SUIT_Session::session();
285 QPtrList<SUIT_Application> aAppList = aSession->applications();
286 bool isAlreadyOpen = false;
287 SUIT_Application* aApp = 0;
288 for ( QPtrListIterator<SUIT_Application> it( aAppList ); it.current() && !isAlreadyOpen; ++it )
291 if ( aApp->activeStudy()->studyName() == aName )
292 isAlreadyOpen = true;
294 if ( !isAlreadyOpen )
296 aApp = startApplication( 0, 0 );
298 res = aApp->useFile( aName );
300 aApp->closeApplication();
303 aApp->desktop()->setActiveWindow();
306 QApplication::restoreOverrideCursor();
311 /*! called on loading the existent study */
312 void STD_Application::onLoadDoc()
316 /*! \retval true, if document was loaded successful, else false.*/
317 bool STD_Application::onLoadDoc( const QString& aName )
320 if ( !activeStudy() )
322 // if no study - load in current desktop
323 res = useStudy( aName );
327 // if study exists - load in new desktop. Check: is the same file is loaded?
328 SUIT_Session* aSession = SUIT_Session::session();
329 QPtrList<SUIT_Application> aAppList = aSession->applications();
330 bool isAlreadyOpen = false;
331 SUIT_Application* aApp = 0;
332 for ( QPtrListIterator<SUIT_Application> it( aAppList ); it.current() && !isAlreadyOpen; ++it )
335 if ( aApp->activeStudy()->studyName() == aName )
336 isAlreadyOpen = true;
338 if ( !isAlreadyOpen )
340 aApp = startApplication( 0, 0 );
342 res = aApp->useStudy( aName );
345 aApp->desktop()->setActiveWindow();
350 /*!Virtual function. Not implemented here.*/
351 void STD_Application::beforeCloseDoc( SUIT_Study* )
355 /*!Virtual function. Not implemented here.*/
356 void STD_Application::afterCloseDoc()
360 /*!Close document, if it's possible.*/
361 void STD_Application::onCloseDoc( bool ask )
363 if ( ask && !isPossibleToClose() )
366 SUIT_Study* study = activeStudy();
368 beforeCloseDoc( study );
371 study->closeDocument(myClosePermanently);
379 QPtrList<SUIT_Application> apps = SUIT_Session::session()->applications();
380 for ( unsigned i = 0; i < apps.count(); i++ )
381 aNbStudies += apps.at( i )->getNbStudies();
383 // STV: aNbStudies - number of currently existing studies (exclude currently closed)
384 // STV: aNbStudies should be compared with 0.
389 updateDesktopTitle();
390 updateCommandsStatus();
399 /*!Check the application on closing.
400 * \retval true if possible, else false
402 bool STD_Application::isPossibleToClose()
404 myClosePermanently = true; //SRN: BugID: IPAL9021
407 activeStudy()->abortAllOperations();
408 if ( activeStudy()->isModified() )
410 QString sName = activeStudy()->studyName().stripWhiteSpace();
411 QString msg = sName.isEmpty() ? tr( "INF_DOC_MODIFIED" ) : tr ( "INF_DOCUMENT_MODIFIED" ).arg( sName );
413 //SRN: BugID: IPAL9021: Begin
414 STD_CloseDlg dlg(desktop());
418 if ( activeStudy()->isSaved() )
420 else if ( !onSaveAsDoc() )
426 myClosePermanently = false;
432 //SRN: BugID: IPAL9021: End
438 /*!Save document if all ok, else error message.*/
439 void STD_Application::onSaveDoc()
441 if ( !activeStudy() )
445 if ( activeStudy()->isSaved() )
447 putInfo( tr( "INF_DOC_SAVING" ) + activeStudy()->studyName() );
449 QApplication::setOverrideCursor( Qt::waitCursor );
451 isOk = activeStudy()->saveDocument();
453 QApplication::restoreOverrideCursor();
458 SUIT_MessageBox::error1( desktop(), tr( "TIT_FILE_SAVEAS" ),
459 tr( "MSG_CANT_SAVE" ).arg( activeStudy()->studyName() ), tr( "BUT_OK" ) );
462 putInfo( tr( "INF_DOC_SAVED" ).arg( "" ) );
466 studySaved( activeStudy() );
471 /*! \retval TRUE, if doument saved successful, else FALSE.*/
472 bool STD_Application::onSaveAsDoc()
474 SUIT_Study* study = activeStudy();
481 QString aName = getFileName( false, study->studyName(), getFileFilter(), QString::null, 0 );
482 if ( aName.isNull() )
485 QApplication::setOverrideCursor( Qt::waitCursor );
487 putInfo( tr( "INF_DOC_SAVING" ) + aName );
488 isOk = study->saveDocumentAs( aName );
490 putInfo( isOk ? tr( "INF_DOC_SAVED" ).arg( aName ) : "" );
492 QApplication::restoreOverrideCursor();
495 SUIT_MessageBox::error1( desktop(), tr( "ERROR" ),
496 tr( "INF_DOC_SAVING_FAILS" ).arg( aName ), tr( "BUT_OK" ) );
499 studySaved( activeStudy() );
504 /*!Closing session.*/
505 void STD_Application::onExit()
507 int aAnswer = SUIT_MessageBox::info2( desktop(), tr( "INF_DESK_EXIT" ), tr( "QUE_DESK_EXIT" ),
508 tr( "BUT_OK" ), tr( "BUT_CANCEL" ), 1, 2, 2 );
510 SUIT_Session::session()->closeSession();
513 /*!Virtual slot. Not implemented here.*/
514 void STD_Application::onCopy()
518 /*!Virtual slot. Not implemented here.*/
519 void STD_Application::onPaste()
523 /*!Sets \a theEnable for menu manager and for tool manager.*/
524 void STD_Application::setEditEnabled( bool theEnable )
526 myEditEnabled = theEnable;
528 QtxActionMenuMgr* mMgr = desktop()->menuMgr();
529 QtxActionToolMgr* tMgr = desktop()->toolMgr();
531 for ( int i = EditCopyId; i <= EditPasteId; i++ )
533 mMgr->setShown( i, myEditEnabled );
534 tMgr->setShown( i, myEditEnabled );
538 /*!\retval true, if document opened successful, else false.*/
539 bool STD_Application::useFile(const QString& theFileName)
541 bool res = SUIT_Application::useFile( theFileName );
544 studyOpened( activeStudy() );
549 /*!Update desktop title.*/
550 void STD_Application::updateDesktopTitle()
552 QString aTitle = applicationName();
553 QString aVer = applicationVersion();
554 if ( !aVer.isEmpty() )
555 aTitle += QString( " " ) + aVer;
559 QString sName = SUIT_Tools::file( activeStudy()->studyName().stripWhiteSpace(), false );
560 if ( !sName.isEmpty() )
561 aTitle += QString( " - [%1]" ).arg( sName );
564 desktop()->setCaption( aTitle );
567 /*!Update commands status.*/
568 void STD_Application::updateCommandsStatus()
570 bool aHasStudy = activeStudy() != 0;
571 bool aIsNeedToSave = false;
573 aIsNeedToSave = !activeStudy()->isSaved() || activeStudy()->isModified();
575 if ( action( FileSaveId ) )
576 action( FileSaveId )->setEnabled( aIsNeedToSave );
577 if ( action( FileSaveAsId ) )
578 action( FileSaveAsId )->setEnabled( aHasStudy );
579 if ( action( FileCloseId ) )
580 action( FileCloseId )->setEnabled( aHasStudy );
581 if ( action( NewWindowId ) )
582 action( NewWindowId )->setEnabled( aHasStudy );
585 /*!\retval SUIT_ViewManager by viewer manager type name.*/
586 SUIT_ViewManager* STD_Application::viewManager( const QString& vmType ) const
588 SUIT_ViewManager* vm = 0;
589 for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current() && !vm; ++it )
591 if ( it.current()->getType() == vmType )
597 /*! \param vmType - input view manager type name
598 * \param lst - output list of view managers with types \a vmType.
600 void STD_Application::viewManagers( const QString& vmType, ViewManagerList& lst ) const
602 for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
603 if ( it.current()->getType() == vmType )
604 lst.append( it.current() );
607 /*!\param lst - output list of all view managers.*/
608 void STD_Application::viewManagers( ViewManagerList& lst ) const
610 for ( QPtrListIterator<SUIT_ViewManager> it( myViewMgrs ); it.current(); ++it )
611 lst.append( it.current() );
614 /*!\retval ViewManagerList - const list of all view managers.*/
615 ViewManagerList STD_Application::viewManagers() const
622 /*!\retval SUIT_ViewManager - return pointer to active view manager.*/
623 SUIT_ViewManager* STD_Application::activeViewManager() const
625 return myActiveViewMgr;
628 /*!Add view manager to view managers list, if it not already there.*/
629 void STD_Application::addViewManager( SUIT_ViewManager* vm )
634 if ( !containsViewManager( vm ) )
636 myViewMgrs.append( vm );
637 connect( vm, SIGNAL( activated( SUIT_ViewManager* ) ),
638 this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
639 vm->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
641 emit viewManagerAdded( vm );
644 if ( !activeViewManager() && myViewMgrs.count() == 1 )
645 setActiveViewManager( vm );
649 /*!Remove view manager from view managers list.*/
650 void STD_Application::removeViewManager( SUIT_ViewManager* vm )
657 emit viewManagerRemoved( vm );
659 vm->disconnectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
661 myViewMgrs.removeRef( vm );
663 if ( myActiveViewMgr == vm )
667 /*!Remove all view managers from view managers list.*/
668 void STD_Application::clearViewManagers()
673 for ( QPtrListIterator<SUIT_ViewManager> it( lst ); it.current(); ++it )
674 removeViewManager( it.current() );
677 /*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/
678 bool STD_Application::containsViewManager( SUIT_ViewManager* vm ) const
680 return myViewMgrs.contains( vm ) > 0;
683 /*!Private slot, sets active manager to \vm, if \vm in view managers list.*/
684 void STD_Application::onViewManagerActivated( SUIT_ViewManager* vm )
686 setActiveViewManager( vm );
689 /*!Sets status bar show, if \on = true, else status bar hide.*/
690 void STD_Application::onViewStatusBar( bool on )
693 desktop()->statusBar()->show();
695 desktop()->statusBar()->hide();
698 /*!Call SUIT_MessageBox::info1(...) with about information.*/
699 void STD_Application::onHelpAbout()
701 SUIT_MessageBox::info1( desktop(), tr( "About" ), tr( "ABOUT_INFO" ), "&OK" );
704 /*!Create empty study. \n
705 * Create new view manager and adding it to view managers list.
707 void STD_Application::createEmptyStudy()
709 SUIT_Application::createEmptyStudy();
711 SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(), desktop(), new SUIT_ViewModel() );
713 addViewManager( vm );
716 /*!Sets active manager to \vm, if \vm in view managers list.*/
717 void STD_Application::setActiveViewManager( SUIT_ViewManager* vm )
719 if ( !containsViewManager( vm ) )
722 myActiveViewMgr = vm;
723 emit viewManagerActivated( vm );
727 void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextMenuEvent* e )
729 QtxPopupMenu* popup = new QtxPopupMenu();
730 // fill popup by own items
732 contextMenuPopup( client->popupClientType(), popup, title );
733 popup->setTitleText( title );
735 popup->insertSeparator();
736 // add items from popup client
737 client->contextMenuPopup( popup );
739 SUIT_Tools::simplifySeparators( popup );
741 if ( popup->count() )
742 popup->exec( e->globalPos() );
748 /*!\retval QString - return file name from dialog.*/
749 QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters,
750 const QString& caption, QWidget* parent )
756 return QFileDialog::getOpenFileName( initial, filters, parent, 0, caption );
762 QString anOldPath = initial;
767 // It is preferrable to use OS-specific file dialog box here !!!
768 aName = QFileDialog::getSaveFileName( anOldPath, filters, parent, 0, caption, &aUsedFilter );
770 if ( aName.isNull() )
774 int aEnd = aUsedFilter.findRev( ')' );
775 int aStart = aUsedFilter.findRev( '(', aEnd );
776 QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
780 QRegExp rx( "[\b\\*]*\\.([\\w]+)" );
781 while ( ( idx = rx.search( wcStr, idx ) ) != -1 )
783 extList.append( rx.cap( 1 ) );
784 idx += rx.matchedLength();
787 if ( !extList.isEmpty() && !extList.contains( QFileInfo( aName ).extension() ) )
788 aName += QString( ".%1" ).arg( extList.first() );
790 if ( QFileInfo( aName ).exists() )
792 int aAnswer = SUIT_MessageBox::warn3( desktop(), tr( "TIT_FILE_SAVEAS" ),
793 tr( "MSG_FILE_EXISTS" ).arg( aName ),
794 tr( "BUT_YES" ), tr( "BUT_NO" ), tr( "BUT_CANCEL" ), 1, 2, 3, 1 );
797 aName = QString::null;
800 else if ( aAnswer == 2 ) // not save to this file
801 anOldPath = aName; // not to return to the same initial dir at each "while" step
802 else // overwrite the existing file
813 /*!\retval QString - return directory name from dialog.*/
814 QString STD_Application::getDirectory( const QString& initial, const QString& caption, QWidget* parent )
818 return QFileDialog::getExistingDirectory( initial, parent, 0, caption, true );
821 void STD_Application::setDesktop( SUIT_Desktop* desk )
823 SUIT_Desktop* prev = desktop();
825 SUIT_Application::setDesktop( desk );
827 if ( prev != desk && desk )
828 connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ),
829 this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) );
832 void STD_Application::studyCreated( SUIT_Study* )
834 updateDesktopTitle();
835 updateCommandsStatus();
838 void STD_Application::studyOpened( SUIT_Study* )
840 updateDesktopTitle();
841 updateCommandsStatus();
844 void STD_Application::studySaved( SUIT_Study* )
846 updateDesktopTitle();
847 updateCommandsStatus();