Salome HOME
bos #29467 SALOME GUI logger
[modules/gui.git] / src / SALOME_PYQT / SalomePyQt / SalomePyQt.cxx
index 25efe528da1fd8165f57e18b5424be241d771667..9d990cc115408f35253aa7c37000d8445270b936 100644 (file)
@@ -5144,3 +5144,23 @@ void SalomePyQt::logAction( QAction* action, const QString& moduleName )
   };
   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 ) );
+}