-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
: QObject( 0 ),
myStudy( 0 ),
myDesktop( 0 ),
- myStatusLabel( 0 )
+ myStatusLabel( 0 ),
+ myPostRoutines( QList<PostRoutine>() )
{
if ( SUIT_Session::session() )
SUIT_Session::session()->insertApplication( this );
delete s;
setDesktop( 0 );
+
+ foreach ( PostRoutine routine, myPostRoutines )
+ routine();
}
/*!
return intId != -1 ? id : -1;
}
+/*!
+ Clears given toolbar.
+ \param title - title of toolbar
+*/
+void SUIT_Application::clearTool( const QString& title )
+{
+ if ( desktop() && desktop()->toolMgr() )
+ desktop()->toolMgr()->clear( title );
+}
+
/*!
Creates new menu item
\return identificator of new action in menu manager
if ( desktop() && desktop()->toolMgr() )
desktop()->toolMgr()->registerAction( a );
- if ( desktop() )
+ if ( desktop() && a->shortcutContext() != Qt::WidgetShortcut &&
+ a->shortcutContext() != Qt::WidgetWithChildrenShortcut )
desktop()->addAction( a );
return ident;
const QString& /*theContext*/ )
{
}
+
+void SUIT_Application::addPostRoutine( PostRoutine theRoutine )
+{
+ if ( !myPostRoutines.contains( theRoutine ) )
+ myPostRoutines << theRoutine;
+}