if ( myModule )
{
- if ( !myModule->deactivateModule( activeStudy() ) )
+ if ( myModule->deactivateModule( activeStudy() ) )
{
- // ....
- }
+ logUserEvent( tr( "MODULE_DEACTIVATED" ).arg( myModule->moduleName() ) );
+ }
}
myModule = mod;
if ( myModule ){
// Connect the module to the active study
myModule->connectToStudy( dynamic_cast<CAM_Study*>( activeStudy() ) );
- if ( !myModule->activateModule( activeStudy() ) )
+ if ( myModule->activateModule( activeStudy() ) )
+ {
+ logUserEvent( tr( "MODULE_ACTIVATED" ).arg( myModule->moduleName() ) );
+ }
+ else
{
myModule->setMenuShown( false );
myModule->setToolShown( false );
<source>OPERATION_APPLIED</source>
<translation>operation applied</translation>
</message>
+ <message>
+ <source>MODULE_ACTIVATED</source>
+ <translation>Module %1 activated</translation>
+ </message>
+ <message>
+ <source>MODULE_DEACTIVATED</source>
+ <translation>Module %1 deactivated</translation>
+ </message>
</context>
</TS>
<source>MODULE_ROOT_OBJECT_TOOLTIP</source>
<translation>%1 objet-racine du module</translation>
</message>
+ <message>
+ <source>ACTION_TRIGGERED</source>
+ <translation>l'action est déclenchée</translation>
+ </message>
+ <message>
+ <source>ACTION_TOGGLED</source>
+ <translation>l'action est basculée</translation>
+ </message>
+ <message>
+ <source>ACTION_ON</source>
+ <translation>on</translation>
+ </message>
+ <message>
+ <source>ACTION_OFF</source>
+ <translation>off</translation>
+ </message>
+ <message>
+ <source>OPERATION_APPLIED</source>
+ <translation>opération appliquée</translation>
+ </message>
+ <message>
+ <source>MODULE_ACTIVATED</source>
+ <translation>Module %1 activé</translation>
+ </message>
+ <message>
+ <source>MODULE_DEACTIVATED</source>
+ <translation>Module %1 désactivé</translation>
+ </message>
</context>
</TS>
<source>MODULE_ROOT_OBJECT_TOOLTIP</source>
<translation>%1 module root object</translation>
</message>
+ <message>
+ <source>ACTION_TRIGGERED</source>
+ <translation>action is triggered</translation>
+ </message>
+ <message>
+ <source>ACTION_TOGGLED</source>
+ <translation>action is toggled</translation>
+ </message>
+ <message>
+ <source>ACTION_ON</source>
+ <translation>on</translation>
+ </message>
+ <message>
+ <source>ACTION_OFF</source>
+ <translation>off</translation>
+ </message>
+ <message>
+ <source>OPERATION_APPLIED</source>
+ <translation>operation applied</translation>
+ </message>
+ <message>
+ <source>MODULE_ACTIVATED</source>
+ <translation>Module %1 activated</translation>
+ </message>
+ <message>
+ <source>MODULE_DEACTIVATED</source>
+ <translation>Module %1 deactivated</translation>
+ </message>
</context>
</TS>
};
ProcessVoidEvent( new TEvent( action, moduleName ) );
}
+
+/*!
+ \brief Enable/disable action logging.
+*/
+void SalomePyQt::setActionLoggingEnabled( bool enabled )
+{
+ class TEvent: public SALOME_Event
+ {
+ bool myEnabled;
+ public:
+ TEvent( bool theEnabled ) : myEnabled( theEnabled ) {}
+ virtual void Execute()
+ {
+ LightApp_Module* module = getActiveModule();
+ if ( module )
+ module->setActionLoggingEnabled( myEnabled );
+ }
+ };
+ ProcessVoidEvent( new TEvent( enabled ) );
+}
static void logUserEvent( const QString& );
static void logAction( QAction*, const QString& = QString() );
+ static void setActionLoggingEnabled( bool );
};
#endif // SALOME_PYQT_H
static void logUserEvent( const QString& ) /ReleaseGIL/ ;
static void logAction( QAction*, const QString& = QString() ) /ReleaseGIL/ ;
+ static void setActionLoggingEnabled( bool ) /ReleaseGIL/ ;
};