Salome HOME
projects
/
modules
/
gui.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support both 5.5 and 5.6 version of ParaView
[modules/gui.git]
/
src
/
SUIT
/
SUIT_Application.cxx
diff --git
a/src/SUIT/SUIT_Application.cxx
b/src/SUIT/SUIT_Application.cxx
old mode 100755
(executable)
new mode 100644
(file)
index
e978085
..
06d9180
--- a/
src/SUIT/SUIT_Application.cxx
+++ b/
src/SUIT/SUIT_Application.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
5
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
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
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-58,7
+58,8
@@
SUIT_Application::SUIT_Application()
: QObject( 0 ),
myStudy( 0 ),
myDesktop( 0 ),
: QObject( 0 ),
myStudy( 0 ),
myDesktop( 0 ),
- myStatusLabel( 0 )
+ myStatusLabel( 0 ),
+ myPostRoutines( QList<PostRoutine>() )
{
if ( SUIT_Session::session() )
SUIT_Session::session()->insertApplication( this );
{
if ( SUIT_Session::session() )
SUIT_Session::session()->insertApplication( this );
@@
-74,6
+75,9
@@
SUIT_Application::~SUIT_Application()
delete s;
setDesktop( 0 );
delete s;
setDesktop( 0 );
+
+ foreach ( PostRoutine routine, myPostRoutines )
+ routine();
}
/*!
}
/*!
@@
-85,8
+89,8
@@
SUIT_Desktop* SUIT_Application::desktop()
}
/*!
}
/*!
- \return
FALSE
if application can not be closed (because of non saved data for example).
- This method called by SUIT_Session wh
i
n closing of application was requested.
+ \return
\c false
if application can not be closed (because of non saved data for example).
+ This method called by SUIT_Session wh
e
n closing of application was requested.
*/
bool SUIT_Application::isPossibleToClose( bool& )
{
*/
bool SUIT_Application::isPossibleToClose( bool& )
{
@@
-506,7
+510,7
@@
int SUIT_Application::createMenu( const int id, const QString& menu, const int g
/*!
Show/hide menu item corresponding to action
\param a - action
/*!
Show/hide menu item corresponding to action
\param a - action
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is
\c
true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setMenuShown( QAction* a, const bool on )
{
*/
void SUIT_Application::setMenuShown( QAction* a, const bool on )
{
@@
-521,7
+525,7
@@
void SUIT_Application::setMenuShown( QAction* a, const bool on )
/*!
Show/hide menu item corresponding to action
\param id - identificator of action in menu manager
/*!
Show/hide menu item corresponding to action
\param id - identificator of action in menu manager
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is
\c
true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setMenuShown( const int id, const bool on )
{
*/
void SUIT_Application::setMenuShown( const int id, const bool on )
{
@@
-531,7
+535,7
@@
void SUIT_Application::setMenuShown( const int id, const bool on )
/*!
Show/hide tool button corresponding to action
\param a - action
/*!
Show/hide tool button corresponding to action
\param a - action
- \param on - if it is true, the button will be shown, otherwise it will be hidden
+ \param on - if it is
\c
true, the button will be shown, otherwise it will be hidden
*/
void SUIT_Application::setToolShown( QAction* a, const bool on )
{
*/
void SUIT_Application::setToolShown( QAction* a, const bool on )
{
@@
-546,7
+550,7
@@
void SUIT_Application::setToolShown( QAction* a, const bool on )
/*!
Show/hide menu item corresponding to action
\param id - identificator of action in tool manager
/*!
Show/hide menu item corresponding to action
\param id - identificator of action in tool manager
- \param on - if it is true, the button will be shown, otherwise it will be hidden
+ \param on - if it is
\c
true, the button will be shown, otherwise it will be hidden
*/
void SUIT_Application::setToolShown( const int id, const bool on )
{
*/
void SUIT_Application::setToolShown( const int id, const bool on )
{
@@
-556,7
+560,7
@@
void SUIT_Application::setToolShown( const int id, const bool on )
/*!
Show/hide both menu item and tool button corresponding to action
\param a - action
/*!
Show/hide both menu item and tool button corresponding to action
\param a - action
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is
\c
true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setActionShown( QAction* a, const bool on )
{
*/
void SUIT_Application::setActionShown( QAction* a, const bool on )
{
@@
-567,7
+571,7
@@
void SUIT_Application::setActionShown( QAction* a, const bool on )
/*!
Show/hide both menu item and tool button corresponding to action
\param id - identificator in both menu manager and tool manager
/*!
Show/hide both menu item and tool button corresponding to action
\param id - identificator in both menu manager and tool manager
- \param on - if it is true, the item will be shown, otherwise it will be hidden
+ \param on - if it is
\c
true, the item will be shown, otherwise it will be hidden
*/
void SUIT_Application::setActionShown( const int id, const bool on )
{
*/
void SUIT_Application::setActionShown( const int id, const bool on )
{
@@
-622,7
+626,7
@@
QList<int> SUIT_Application::actionIds() const
\param tip - tool tip
\param key - shortcut
\param parent - parent object
\param tip - tool tip
\param key - shortcut
\param parent - parent object
- \param toggle - if it is
TRUE
the action will be a toggle action, otherwise it will be a command action
+ \param toggle - if it is
\c true
the action will be a toggle action, otherwise it will be a command action
\param reciever - object that contains slot
\param member - slot to be called when action is activated
*/
\param reciever - object that contains slot
\param member - slot to be called when action is activated
*/
@@
-689,7
+693,8
@@
int SUIT_Application::registerAction( const int id, QAction* a )
if ( desktop() && desktop()->toolMgr() )
desktop()->toolMgr()->registerAction( a );
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;
desktop()->addAction( a );
return ident;
@@
-727,3
+732,9
@@
void SUIT_Application::onHelpContextModule( const QString& /*theComponentName*/,
const QString& /*theContext*/ )
{
}
const QString& /*theContext*/ )
{
}
+
+void SUIT_Application::addPostRoutine( PostRoutine theRoutine )
+{
+ if ( !myPostRoutines.contains( theRoutine ) )
+ myPostRoutines << theRoutine;
+}