From 6f265e84f5ffda4a99fa79839a856f18c348f334 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 24 Oct 2006 13:36:48 +0000 Subject: [PATCH] Implement a method to clear log messages window : clearMessages() --- src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 20 ++++++++++++++++++++ src/SALOME_PYQT/SalomePyQt/SalomePyQt.h | 1 + src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip | 1 + src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip | 1 + 4 files changed, 23 insertions(+) diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 820f12a53..a67c67484 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -1566,3 +1566,23 @@ void SalomePyQt::message( const QString& msg, bool addSeparator ) }; ProcessVoidEvent( new TEvent( msg, addSeparator ) ); } + +/*! + SalomePyQt::clearMessages + Removes all the messages from the Log output window + */ +void SalomePyQt::clearMessages() +{ + class TEvent: public SALOME_Event { + public: + TEvent() {} + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + LogWindow* lw = anApp->logWindow(); + if ( lw ) + lw->clear(); + } + } + }; + ProcessVoidEvent( new TEvent() ); +} diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h index 03e988dcd..6a6a0e8af 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h @@ -177,6 +177,7 @@ public: const QVariant& ); static void message( const QString&, bool = true ); + static void clearMessages(); }; #endif // SALOME_PYQT_H diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index a8d6fdd6e..ecd8886b5 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -163,4 +163,5 @@ public: const QVariant& ); static void message( const QString&, bool = true ); + static void clearMessages(); }; diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip index 77b783746..5bf15f159 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt_v4.sip @@ -163,4 +163,5 @@ public: const QVariant& ) /ReleaseGIL/ ; static void message( const QString&, bool = true ) /ReleaseGIL/ ; + static void clearMessages() /ReleaseGIL/ ; }; -- 2.39.2