From bda7b12ccc1551401d98c905258767ff581a7554 Mon Sep 17 00:00:00 2001 From: Charles PIGNEROL <> Date: Fri, 27 Oct 2023 07:28:52 +0200 Subject: [PATCH] Version 6.3.3. Python 2 console fixes: history management with the up/down arrow keys, color management of displays (sometimes blue instead of black). --- cmake/version.cmake | 4 ++-- src/QtPython/QtPythonConsole.cpp | 11 +++++++++-- versions.txt | 8 ++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 26b9ef1..00c899e 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -5,12 +5,12 @@ # Pour la bibliothèque QtPython : set (QT_PYTHON_MAJOR_VERSION "6") set (QT_PYTHON_MINOR_VERSION "3") -set (QT_PYTHON_RELEASE_VERSION "2") +set (QT_PYTHON_RELEASE_VERSION "3") set (QT_PYTHON_VERSION ${QT_PYTHON_MAJOR_VERSION}.${QT_PYTHON_MINOR_VERSION}.${QT_PYTHON_RELEASE_VERSION}) # Pour la bibliothèque QtPython3 : set (QT_PYTHON_3_MAJOR_VERSION "6") set (QT_PYTHON_3_MINOR_VERSION "3") -set (QT_PYTHON_3_RELEASE_VERSION "2") +set (QT_PYTHON_3_RELEASE_VERSION "3") set (QT_PYTHON_3_VERSION ${QT_PYTHON_3_MAJOR_VERSION}.${QT_PYTHON_3_MINOR_VERSION}.${QT_PYTHON_3_RELEASE_VERSION}) diff --git a/src/QtPython/QtPythonConsole.cpp b/src/QtPython/QtPythonConsole.cpp index f166028..91e96a0 100644 --- a/src/QtPython/QtPythonConsole.cpp +++ b/src/QtPython/QtPythonConsole.cpp @@ -313,8 +313,10 @@ bool QtPythonConsole::Instruction::isRunnable (const string& instruction) // LA CLASSE QtPythonConsole::QtScriptTextFormat // ============================================================================ - -const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT); +// v 6.3.3 : on annule commentFormat, la colorisation QtPythonSyntaxHighlighter et il semble qu'il y ait un bogue (les commandes sont bleues dans certains cas +// pour une raison non élucidée), mais où ??? +//const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::COMMENT); // v 6.3.3 +const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::commentFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); // v 6.3.3 const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::emptyLineFormat (QtPythonConsole::QtScriptTextFormat::BLANK); const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::instructionFormat (QtPythonConsole::QtScriptTextFormat::INSTRUCTION); const QtPythonConsole::QtScriptTextFormat QtPythonConsole::QtScriptTextFormat::ranInstructionFormat (QtPythonConsole::QtScriptTextFormat::RAN_INSTRUCTION); @@ -1937,6 +1939,7 @@ void QtPythonConsole::addToHistoric (const UTF8String& command, const UTF8String if (false == scriptingLog.getComment ( ).empty ( )) // v 2.7.0 { const UTF8String comment (PythonLogOutputStream::toComment (scriptingLog.getComment ( )), Charset::UTF_8); + const size_t commentLineNum = lineNumber (comment.utf8 ( )); // v 6.3.3 line += lineNumber (comment.utf8 ( )); // cursor.insertText ("# "); // v 3.5.0 cursor.insertText (UTF8TOQSTRING (comment)); @@ -1945,7 +1948,11 @@ void QtPythonConsole::addToHistoric (const UTF8String& command, const UTF8String block = block.next ( ); cursor.setPosition (block.position ( ), QTextCursor::MoveAnchor); setTextCursor (cursor); + line -= commentLineNum; // v 6.3.3 } // if (false == scriptingLog.getComment ( ).empty ( )) + else + line--; // v 6.3.3 + if (true == statusErr) { // line++; // CP 1.11.0 diff --git a/versions.txt b/versions.txt index 867843a..d6d9dd8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,3 +1,11 @@ +Version 6.3.3 : 27/10/23 +=============== + +Correctifs console python 2 : +- gestion de l'historique avec les touches flèche haut/bas. +- gestion couleur des affichages (parfois en bleu à la place du noir). + + Version 6.3.2 : 24/10/23 ===============