]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
step8 -> correction of bug on dump slot.
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 23 Feb 2016 14:02:42 +0000 (15:02 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 23 Feb 2016 14:02:42 +0000 (15:02 +0100)
src/PyConsole/PyConsole_Editor.cxx
src/PyConsole/PyConsole_Editor.h
src/PyConsole/PyConsole_EnhEditor.cxx
src/PyConsole/PyConsole_EnhEditor.h
src/PyConsoleBase/PyConsole_EditorBase.cxx
src/PyConsoleBase/PyConsole_EditorBase.h

index 7dbc93f8cb5d53e61bbe4ade13325f70ae824f1d..2371eecae54b961e162795ca7e0d697e85f6e7a9 100644 (file)
@@ -153,37 +153,41 @@ PyConsole_Editor::~PyConsole_Editor()
 {
 }
 
-/*!
-  \brief "Dump commands" operation.
- */
-void PyConsole_Editor::dump()
+
+void PyConsole_Editor::StaticDumpSlot(PyConsole_EditorBase *base)
 {
   QStringList aFilters;
   aFilters.append( tr( "PYTHON_FILES_FILTER" ) );
   
-  QString fileName = SUIT_FileDlg::getFileName( this, QString(),
+  QString fileName = SUIT_FileDlg::getFileName( base, QString(),
                                                aFilters, tr( "TOT_DUMP_PYCOMMANDS" ),
-                                               false, true, new DumpCommandsFileValidator( this ) );
-  dumpImpl(fileName);
+                                               false, true, new DumpCommandsFileValidator( base ) );
+  base->dumpImpl(fileName);
 }
+
 /*!
-  \brief "Start log" operation.
+  \brief "Dump commands" operation.
  */
-void PyConsole_Editor::startLog()
+void PyConsole_Editor::dumpSlot()
+{
+  PyConsole_Editor::StaticDumpSlot(this);
+}
+
+void PyConsole_Editor::StaticStartLogSlot(PyConsole_EditorBase *base)
 {
   QStringList aFilters;
   aFilters.append( tr( "LOG_FILES_FILTER" ) );
 
   while (1) {
-    QString fileName = SUIT_FileDlg::getFileName( this, QString(),
+    QString fileName = SUIT_FileDlg::getFileName( base, QString(),
                                                  aFilters, tr( "TOT_SAVE_PYLOG" ),
                                                  false, true );
     if ( !fileName.isEmpty() ) {
-      if ( startLogImpl( fileName ) ) {
+      if ( base->startLogImpl( fileName ) ) {
        break;
       }
       else {
-       SUIT_MessageBox::critical( this,
+       SUIT_MessageBox::critical( base,
                                   QObject::tr("ERR_ERROR"),
                                   QObject::tr("ERR_FILE_NOT_WRITABLE") );
       }
@@ -193,3 +197,11 @@ void PyConsole_Editor::startLog()
     }
   }
 }
+
+/*!
+  \brief "Start log" operation.
+ */
+void PyConsole_Editor::startLogSlot()
+{
+  StaticStartLogSlot(this);
+}
index 4180589421ba7d45ee69074957b8b5c49f30b4a5..a8821992ed798a913c04238bff092cc830da0676 100644 (file)
@@ -39,13 +39,14 @@ class QEventLoop;
 class PYCONSOLE_EXPORT PyConsole_Editor : public PyConsole_EditorBase
 {
   Q_OBJECT;
-
 public:
   PyConsole_Editor( PyConsole_Interp* theInterp, QWidget *theParent = 0 );
   ~PyConsole_Editor();
-public slots:
-    void           dump();
-    void           startLog();
+  static void StaticDumpSlot(PyConsole_EditorBase *base);
+  static void StaticStartLogSlot(PyConsole_EditorBase *base);
+protected:
+  virtual void dumpSlot();
+  virtual void startLogSlot();
 };
 
 #endif // PYCONSOLE_EDITOR_H
index ffca890aff7cd5a0ba37cee6de173618f25d746e..dd4619b1e419eed400db71c2aa72c1320da92b3c 100644 (file)
@@ -30,6 +30,7 @@
 #include <QMimeData>
 
 #include "PyConsole_EnhEditor.h"
+#include "PyConsole_Editor.h"
 
 /**
  * Constructor.
@@ -40,3 +41,13 @@ PyConsole_EnhEditor::PyConsole_EnhEditor(PyConsole_Interp* interp, QWidget* pare
      PyConsole_EnhEditorBase(interp, parent)
 {
 }
+
+void PyConsole_EnhEditor::dumpSlot()
+{
+  PyConsole_Editor::StaticDumpSlot(this);
+}
+
+void PyConsole_EnhEditor::startLogSlot()
+{
+  PyConsole_Editor::StaticStartLogSlot(this);
+}
index ea20d1b3f03447cbd23a5d9edecc024b18733771..f14402e3be099222d714c705d70e9024e27cc3c1 100644 (file)
@@ -37,6 +37,9 @@ class PYCONSOLE_EXPORT PyConsole_EnhEditor : public PyConsole_EnhEditorBase
 public:
   PyConsole_EnhEditor(PyConsole_Interp* interp, QWidget* parent = 0);
   virtual ~PyConsole_EnhEditor() {}
+protected:
+  virtual void dumpSlot();
+  virtual void startLogSlot();
 };
 
 #endif /* PYCONSOLE_ENHEDITOR_H_ */
index d83452714feb1be12159bab5607d5fe1658ca009..d1f47414eea7b3cf5427ec354362a96aebbf6ea3 100644 (file)
@@ -1158,6 +1158,19 @@ void PyConsole_EditorBase::dump(const QString& fileName)
   dumpImpl(fileName);
 }
 
+/*!
+  \brief "Dump commands" operation.
+ */
+void PyConsole_EditorBase::dump()
+{
+  dumpSlot();
+}
+
+void PyConsole_EditorBase::dumpSlot()
+{
+  //TODO
+}
+
 /*!
   \brief Start python trace logging
   \param fileName the path to the log file
@@ -1188,6 +1201,20 @@ bool PyConsole_EditorBase::startLog( const QString& fileName )
   return startLogImpl(fileName);
 }
 
+/*!
+  \brief Start python trace logging
+  \sa stopLog()
+ */
+void PyConsole_EditorBase::startLog()
+{
+  startLogSlot();
+}
+
+void PyConsole_EditorBase::startLogSlot()
+{
+  //TODO
+}
+
 /*!
   \brief "Stop log" operation.
   \sa startLog()
index 288ad36781666d814b85b3d2a83b5296d9273730..c875e7684c6fe8d1f4189b1226ab4c4bdb8cf049 100644 (file)
@@ -72,6 +72,8 @@ public slots:
     void           handleReturn();
     void           onPyInterpChanged( PyConsole_Interp* );
     void           dump(const QString& fileName);
+    void           dump();
+    void           startLog();
     bool           startLog( const QString& );
     void           stopLog();
     void           putLog( const QString& );
@@ -81,6 +83,8 @@ protected:
   virtual void   mouseReleaseEvent( QMouseEvent* event );
   virtual void   keyPressEvent ( QKeyEvent* event);
   virtual void   customEvent( QEvent* event);
+  virtual void   dumpSlot();
+  virtual void   startLogSlot();
 
   virtual PyInterp_Request* createRequest( const QString& );