Salome HOME
0022652: [CEA 1194] Redirect the traces from embedded Python console in a log file
[modules/gui.git] / src / PyConsole / PyConsole_Editor.h
index 994be9db658238f8d1f2fa0add2b1ea9d74ecee9..c939ef1b7da3e9fd78f947738427b11222426a42 100644 (file)
@@ -35,10 +35,6 @@ class PyConsole_Interp;
 class PyInterp_Request;
 class QEventLoop;
 
-typedef struct {
-  QString command, output, prompt;
-} PyCommand;
-
 class PYCONSOLE_EXPORT PyConsole_Editor : public QTextEdit
 {
   Q_OBJECT;
@@ -62,6 +58,8 @@ public:
   bool           isShowBanner() const;
   void           setIsShowBanner( const bool );
 
+  bool           isLogging() const;
+
   virtual QSize  sizeHint() const;
 
 public slots:
@@ -71,7 +69,10 @@ public slots:
     void           handleReturn();
     void           onPyInterpChanged( PyConsole_Interp* );
     void           dump();
-    void           saveLog();
+    bool           startLog( const QString& );
+    void           startLog();
+    void           stopLog();
+    void           putLog( const QString& );
 
 protected:
   virtual void   dropEvent( QDropEvent* event );
@@ -90,7 +91,8 @@ protected:
   QString           myCurrentCommand;   //!< currently being printed command
   QString           myPrompt;           //!< current command line prompt
   int               myCmdInHistory;     //!< current history command index
-  QList<PyCommand>  myHistory;          //!< commands history buffer
+  QString           myLogFile;          //!< current output log
+  QStringList       myHistory;          //!< commands history buffer
   QEventLoop*       myEventLoop;        //!< internal event loop
   QString           myBanner;           //!< current banner
   bool              myShowBanner;       //!< 'show banner' flag