}
-/*!
- * \brief SLOT. Called when number of operations changed
-*
-*
-*/
-void SalomeApp_SwitchOp::onOperation()
-{
-}
-
/*!
* \brief Get module
*
return 0;
}
-/*!
- * \brief Connect signals of operation on the slots of object
- * \param theOp - operation for connection
-*
-* Connect signals of operation on the slots of object. This method is called by module
-* when it creates operation
-*/
-void SalomeApp_SwitchOp::connect( SalomeApp_Operation* theOp )
-{
-// to do: ???
-// void started( SUIT_Operation* );
-// void aborted( SUIT_Operation* );
-// void resumed( SUIT_Operation* );
-// void committed( SUIT_Operation* );
-// void suspended( SUIT_Operation* );
-// void stopped( SUIT_Operation* );
-}
-
/*!
* \brief Event filter
* \param theObj - object
{
if ( theObj->inherits( "QWidget" ) && ( theEv->type() == QEvent::Enter ) )
{
+ QEvent::Type aType = theEv->type();
SalomeApp_Operation* anOp = operation( (QWidget*)theObj );
- if ( anOp && !anOp->isActive() && anOp->isAutoResumed() )
+ if ( anOp )
{
- if ( study() )
+ switch ( aType )
{
- if ( study()->canActivate( anOp ) )
- study()->resume( anOp );
+ case QEvent::Enter:
+ {
+ if ( !anOp->isActive() && anOp->isAutoResumed() &&
+ study() && !study()->blockingOperation( anOp ) )
+ study()->resume( anOp );
+ }
+ break;
+
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseMove:
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ {
+ if ( !anOp->isActive() )
+ return true;
+ }
+ break;
+
}
}
}
* Other dialogs are disabled. This class installs event filter on application. When mouse
* cursor is moved above disabled dialog corresponding event is catched by this class.
* It finds corresponding operation and verify whether operation can be resumed (see
- * SUIT_Study::canActivate( SUIT_Operation* ) method). If yes then current active
+ * SUIT_Study::isDenied( SUIT_Operation* ) method). If yes then current active
* operation is suspended and new operation activated. Module contains this class as a
* field. Then module is created instance of this class created too.
*/
SalomeApp_SwitchOp( SalomeApp_Module* );
virtual ~SalomeApp_SwitchOp();
- void connect( SalomeApp_Operation* );
-
// Redefined from base class
bool eventFilter( QObject*, QEvent* );
-private slots:
-
- void onOperation();
-
private:
SalomeApp_Module* module() const;
SalomeApp_Operation* operation( QWidget* ) const;
SUIT_Study* study() const;
-private:
-
-
};
#endif