]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
PyConsole/PyInterp: Synchronizing Makefile.am with CMakeLists.txt
authorbruneton <bruneton>
Fri, 5 Apr 2013 08:29:31 +0000 (08:29 +0000)
committerbruneton <bruneton>
Fri, 5 Apr 2013 08:29:31 +0000 (08:29 +0000)
Also a minor improvement for the postion of the cursor when hiting TAB.

src/PyConsole/Makefile.am
src/PyConsole/PyConsole_EnhEditor.cxx
src/PyInterp/Makefile.am
src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile.am

index 5ae4afbc91706fd061cedc5d14ced39025f67f61..4bba60a39690560d64d79880547ede33228a3d04 100755 (executable)
@@ -29,15 +29,24 @@ salomeinclude_HEADERS =             \
        PyConsole.h             \
        PyConsole_Console.h     \
        PyConsole_Editor.h      \
-       PyConsole_Interp.h
+       PyConsole_EnhEditor.h   \
+       PyConsole_EnhInterp.h   \
+       PyConsole_Event.h       \
+       PyConsole_Request.h     \
+       PyConsole_Interp.h  
 
 dist_libPyConsole_la_SOURCES = \
        PyConsole_Console.cxx   \
        PyConsole_Editor.cxx    \
-       PyConsole_Interp.cxx            
+       PyConsole_EnhEditor.cxx \
+       PyConsole_Event.cxx     \
+       PyConsole_Request.cxx   \
+       PyConsole_Interp.cxx    \
+       PyConsole_EnhInterp.cxx
 
 MOC_FILES =                            \
        PyConsole_Editor_moc.cxx        \
+       PyConsole_EnhEditor_moc.cxx     \
        PyConsole_Console_moc.cxx
 
 nodist_libPyConsole_la_SOURCES = $(MOC_FILES)
@@ -47,7 +56,7 @@ nodist_salomeres_DATA = \
        PyConsole_msg_fr.qm
 
 libPyConsole_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) \
-       -I$(srcdir)/../PyInterp -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+       -I$(srcdir)/../PyInterp -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../Event
 
 libPyConsole_la_LDFLAGS  = $(PYTHON_LIBS) $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSALOMELocalTrace
-libPyConsole_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../PyInterp/libPyInterp.la
+libPyConsole_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../Event/libEvent.la ../PyInterp/libPyInterp.la 
index de089a8058bdd65f82a01fe42a4cfed5d4095716..c3bbbf414ab95ff7c5e3e94239c63c86ea163ce9 100644 (file)
@@ -84,7 +84,9 @@ void PyConsole_EnhEditor::keyPressEvent ( QKeyEvent* event)
           clearCompletion();
           _cursor_pos = -1;
         }
-      PyConsole_Editor::keyPressEvent(event);
+      // Discard ctrl pressed alone:
+      if (event->key() != Qt::Key_Control)
+        PyConsole_Editor::keyPressEvent(event);
     }
 }
 
@@ -259,6 +261,7 @@ void PyConsole_EnhEditor::customEvent( QEvent* event )
   QTextBlockFormat bf;
   QTextCharFormat cf;
   PyConsole_EnhInterp * interp = static_cast<PyConsole_EnhInterp *>(myInterp);
+  int cursorPos;
 
   switch( event->type() )
   {
@@ -303,6 +306,7 @@ void PyConsole_EnhEditor::customEvent( QEvent* event )
             }
 
           // Print all matching completion in a "undo-able" block
+          cursorPos = cursor.position();
           cursor.insertBlock();
           cursor.beginEditBlock();
 
@@ -313,6 +317,10 @@ void PyConsole_EnhEditor::customEvent( QEvent* event )
           formatCompletion(matches, comple_text);
           cursor.insertText(comple_text);
           cursor.endEditBlock();
+
+          // Position cursor where it was before inserting the completion list:
+          cursor.setPosition(cursorPos);
+          setTextCursor(cursor);
         }
       break;
     case PyInterp_Event::ES_TAB_COMPLETE_ERR:
index d19ed4e891092d407762a63dca80b6cdf586ce44..4bb400560f9b172bb196f4e671c1d11a3b43174f 100755 (executable)
@@ -31,10 +31,14 @@ lib_LTLIBRARIES = libPyInterp.la
 salomeinclude_HEADERS =                \
        PyInterp.h              \
        PyInterp_Interp.h       \
+       PyInterp_Event.h        \
+       PyInterp_Request.h      \
        PyInterp_Dispatcher.h
 
 dist_libPyInterp_la_SOURCES =  \
        PyInterp_Interp.cxx     \
+       PyInterp_Event.cxx      \
+       PyInterp_Request.cxx    \
        PyInterp_Dispatcher.cxx
 
 MOC_FILES = PyInterp_Watcher_moc.cxx
index 08c264dcbb9fe2475a23f2d444d0d9a994875e31..cfa541401171868bc6af9950e1f775f72b0789c1 100644 (file)
@@ -74,7 +74,7 @@ libSalomePyQtGUILight_la_CPPFLAGS =  $(QT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INC
        -I$(srcdir)/../../Plot2d -I$(srcdir)/../../OCCViewer                            \
        -I$(srcdir)/../../CAM -I$(srcdir)/../../STD                                     \
        -I$(srcdir)/../../SUITApp                                                       \
-       -I$(srcdir)/../../CAM -I$(srcdir)/../../STD
+       -I$(srcdir)/../../CAM -I$(srcdir)/../../STD -I$(srcdir)/../../Event
 
 if GUI_ENABLE_CORBA
 libSalomePyQtGUILight_la_CPPFLAGS += -I$(srcdir)/../../SalomeApp \