class ActionMgrLocker
{
public:
- ActionMgrLocker( QtxActionMgr* m ) : myMgr( m )
+ ActionMgrLocker( QtxActionMgr* m, bool use ) : myMgr( m ), myUseLock( use )
{
- myUpdEnabled = myMgr->isUpdatesEnabled();
- myMgr->setUpdatesEnabled( false );
+ if ( myUseLock ) {
+ myUpdEnabled = myMgr->isUpdatesEnabled();
+ myMgr->setUpdatesEnabled( false );
+ }
}
~ActionMgrLocker()
{
- myMgr->setUpdatesEnabled( myUpdEnabled );
- //myMgr->update();
+ if ( myUseLock ) {
+ myMgr->setUpdatesEnabled( myUpdEnabled );
+ //myMgr->update();
+ }
}
QtxActionMgr* myMgr;
- bool myUpdEnabled;
+ bool myUseLock;
+ bool myUpdEnabled;
};
/*!
if ( !toolMgr() )
return -1;
- ActionMgrLocker lock( toolMgr() );
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
return toolMgr()->createToolBar( name, myToolShown );
}
if ( !toolMgr() )
return -1;
- ActionMgrLocker lock( toolMgr() );
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
if ( !toolMgr() )
return -1;
- ActionMgrLocker lock( toolMgr() );
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
if ( !toolMgr() )
return -1;
- ActionMgrLocker lock( toolMgr() );
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
int intId = toolMgr()->insert( action( id ), tBar, idx );
if ( !toolMgr() )
return -1;
- ActionMgrLocker lock( toolMgr() );
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
int intId = toolMgr()->insert( action( id ), tBar, idx );
if ( !a || !menuMgr() )
return -1;
- ActionMgrLocker lock( menuMgr() );
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
if ( !a || !menuMgr() )
return -1;
- ActionMgrLocker lock( menuMgr() );
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
if ( !menuMgr() )
return -1;
- ActionMgrLocker lock( menuMgr() );
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
int intId = menuMgr()->insert( action( id ), menu, group, idx );
if ( !menuMgr() )
return -1;
- ActionMgrLocker lock( menuMgr() );
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
int intId = menuMgr()->insert( action( id ), menu, group, idx );