From: bruneton Date: Fri, 5 Apr 2013 08:29:31 +0000 (+0000) Subject: PyConsole/PyInterp: Synchronizing Makefile.am with CMakeLists.txt X-Git-Tag: V6_main_FINAL~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1032645ae0896eb89438bb84dab65ac8d4488c33;p=modules%2Fgui.git PyConsole/PyInterp: Synchronizing Makefile.am with CMakeLists.txt Also a minor improvement for the postion of the cursor when hiting TAB. --- diff --git a/src/PyConsole/Makefile.am b/src/PyConsole/Makefile.am index 5ae4afbc9..4bba60a39 100755 --- a/src/PyConsole/Makefile.am +++ b/src/PyConsole/Makefile.am @@ -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 diff --git a/src/PyConsole/PyConsole_EnhEditor.cxx b/src/PyConsole/PyConsole_EnhEditor.cxx index de089a805..c3bbbf414 100644 --- a/src/PyConsole/PyConsole_EnhEditor.cxx +++ b/src/PyConsole/PyConsole_EnhEditor.cxx @@ -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(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: diff --git a/src/PyInterp/Makefile.am b/src/PyInterp/Makefile.am index d19ed4e89..4bb400560 100755 --- a/src/PyInterp/Makefile.am +++ b/src/PyInterp/Makefile.am @@ -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 diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile.am b/src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile.am index 08c264dcb..cfa541401 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile.am +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile.am @@ -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 \