# HG changeset patch # User John W. Eaton # Date 1582303928 18000 # Node ID 865f8ddb2c78154f5a5832c6cd31345bea4b5a88 # Parent de2c73ae450fbc01d8fd7ef0d42cf80a33dd920b# Parent a578890b4942eea2aab3817b166b56499e9ec309 maint: merge stable to default. diff -r de2c73ae450f -r 865f8ddb2c78 libgui/qterminal/libqterminal/win32/QTerminalColors.cpp --- a/libgui/qterminal/libqterminal/win32/QTerminalColors.cpp Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/qterminal/libqterminal/win32/QTerminalColors.cpp Fri Feb 21 11:52:08 2020 -0500 @@ -30,14 +30,14 @@ QConsoleColors::QConsoleColors (void) : QMap () { - (*this)[0] = Qt::black; + (*this)[0] = Qt::white; (*this)[1] = Qt::darkBlue; (*this)[2] = Qt::darkGreen; (*this)[3] = Qt::darkCyan; (*this)[4] = Qt::darkRed; (*this)[5] = Qt::darkMagenta; (*this)[6] = Qt::darkYellow; - (*this)[7] = Qt::lightGray; + (*this)[7] = Qt::black; (*this)[8] = Qt::darkGray; (*this)[9] = Qt::blue; (*this)[10] = Qt::green; @@ -45,5 +45,5 @@ (*this)[12] = Qt::red; (*this)[13] = Qt::magenta; (*this)[14] = Qt::yellow; - (*this)[15] = Qt::white; + (*this)[15] = Qt::lightGray; } diff -r de2c73ae450f -r 865f8ddb2c78 libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp --- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp Fri Feb 21 11:52:08 2020 -0500 @@ -390,13 +390,13 @@ SetConsoleOutputCP (65001); } - // Choose 15 (0xF) as index into the Windows console color map for the - // background and 0 (0x0) as the index for the foreground. This + // Choose 0 (0x0) as index into the Windows console color map for the + // background and 7 (0x7) as the index for the foreground. This // selection corresponds to the indices used in the foregroundColor, // setForegroundColor, backgroundColor, and SetBackgroundColor // functions. - SetConsoleTextAttribute (m_stdOut, 0xF0); + SetConsoleTextAttribute (m_stdOut, 0x07); // Defaults. setBackgroundColor (Qt::white); @@ -408,8 +408,6 @@ QPalette palette (backgroundColor ()); m_consoleView->setPalette (palette); - m_consoleView->setAutoFillBackground (true); - m_consoleView->setFont (m_font); parent->setFocusPolicy (Qt::StrongFocus); parent->winId (); @@ -581,12 +579,12 @@ QColor QConsolePrivate::backgroundColor (void) const { - return m_colors[15]; + return m_colors[0]; } QColor QConsolePrivate::foregroundColor (void) const { - return m_colors[0]; + return m_colors[7]; } QColor QConsolePrivate::selectionColor (void) const @@ -601,15 +599,16 @@ void QConsolePrivate::setBackgroundColor (const QColor& color) { - m_colors[15] = color; + m_colors[0] = color; QPalette palette (color); + palette.setColor(QPalette::Base, color); m_consoleView->setPalette (palette); } void QConsolePrivate::setForegroundColor (const QColor& color) { - m_colors[0] = color; + m_colors[7] = color; } void QConsolePrivate::setSelectionColor (const QColor& color) @@ -1557,6 +1556,7 @@ int ch = d->m_charSize.height (); QRect updateRect = event->rect (); + p.fillRect(updateRect, QBrush(d->backgroundColor())); int cx1 = updateRect.left () / cw; int cy1 = updateRect.top () / ch; diff -r de2c73ae450f -r 865f8ddb2c78 libgui/qterminal/qterminal/README --- a/libgui/qterminal/qterminal/README Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/qterminal/qterminal/README Fri Feb 21 11:52:08 2020 -0500 @@ -1,1 +1,1 @@ -here is sample program which uses QTermWidet for displaying a terminal \ No newline at end of file +here is sample program which uses QTermWidet for displaying a terminal diff -r de2c73ae450f -r 865f8ddb2c78 libgui/src/gui-preferences-ed.h --- a/libgui/src/gui-preferences-ed.h Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/src/gui-preferences-ed.h Fri Feb 21 11:52:08 2020 -0500 @@ -31,6 +31,7 @@ #endif #include "gui-preferences.h" +#include "localcharset-wrapper.h" // Editor preferences @@ -232,7 +233,9 @@ const gui_pref ed_default_enc ("editor/default_encoding", - QVariant (QTextCodec::codecForLocale ()->name ().toUpper ().prepend ("SYSTEM (").append (")"))); + QVariant (QString ("SYSTEM (") + + QString (octave_locale_charset_wrapper ()).toUpper () + + QString (")"))); const gui_pref ed_create_new_file ("editor/create_new_file", QVariant (false)); diff -r de2c73ae450f -r 865f8ddb2c78 libgui/src/icons/go-home.svg --- a/libgui/src/icons/go-home.svg Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/src/icons/go-home.svg Fri Feb 21 11:52:08 2020 -0500 @@ -442,4 +442,4 @@ style="opacity:0.39772728;color:#000000;fill:url(#radialGradient2374);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999958;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" d="M 27.107118,34.408261 C 30.725101,34.739438 32.634842,32.962557 35.97527,32.855521 L 36,29.00603 L 27.088388,29 L 27.107118,34.408261 z " id="rect2363" - sodipodi:nodetypes="ccccc" /> \ No newline at end of file + sodipodi:nodetypes="ccccc" /> diff -r de2c73ae450f -r 865f8ddb2c78 libgui/src/icons/icons_license --- a/libgui/src/icons/icons_license Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/src/icons/icons_license Fri Feb 21 11:52:08 2020 -0500 @@ -118,4 +118,4 @@ with elements from the DMZ theme: circle.png -circle.svg \ No newline at end of file +circle.svg diff -r de2c73ae450f -r 865f8ddb2c78 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/src/m-editor/file-editor-tab.cc Fri Feb 21 11:52:08 2020 -0500 @@ -74,6 +74,7 @@ #include "cmd-edit.h" #include "file-ops.h" +#include "localcharset-wrapper.h" #include "uniconv-wrappers.h" #include "bp-table.h" @@ -266,7 +267,8 @@ // encoding, not updated with the settings QString locale_enc_name = - QTextCodec::codecForLocale ()->name ().toUpper ().prepend ("SYSTEM (").append (")"); + QString ("SYSTEM (") + + QString (octave_locale_charset_wrapper ()).toUpper () + QString (")"); m_encoding = settings->value (ed_default_enc.key, locale_enc_name).toString (); m_enc_indicator->setText (m_encoding); // no changes in encoding yet diff -r de2c73ae450f -r 865f8ddb2c78 libgui/src/qt-interpreter-events.cc --- a/libgui/src/qt-interpreter-events.cc Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/src/qt-interpreter-events.cc Fri Feb 21 11:52:08 2020 -0500 @@ -39,6 +39,7 @@ #include "octave-qobject.h" #include "qt-interpreter-events.h" +#include "localcharset-wrapper.h" #include "oct-env.h" #include "str-vec.h" @@ -631,7 +632,9 @@ if (adjusted_value == "SYSTEM") adjusted_value = - QTextCodec::codecForLocale ()->name ().toUpper ().prepend ("SYSTEM (").append (")"); + QString ("SYSTEM (") + + QString (octave_locale_charset_wrapper ()).toUpper () + + QString (")"); else if (re.indexIn (adjusted_value) > -1) { if (codecs.contains ("IBM" + re.cap (1))) diff -r de2c73ae450f -r 865f8ddb2c78 libgui/src/resource-manager.cc --- a/libgui/src/resource-manager.cc Wed Feb 19 18:42:00 2020 -0500 +++ b/libgui/src/resource-manager.cc Fri Feb 21 11:52:08 2020 -0500 @@ -51,6 +51,7 @@ #include "workspace-model.h" #include "file-ops.h" +#include "localcharset-wrapper.h" #include "oct-env.h" #include "defaults.h" @@ -401,8 +402,9 @@ } // Append SYSTEM - codecs->append (QTextCodec::codecForLocale ()->name ().toUpper ().prepend - ("SYSTEM (").append (")")); + codecs->append (QString ("SYSTEM (") + + QString (octave_locale_charset_wrapper ()).toUpper () + + QString (")")); // Clean up and sort list of codecs codecs->removeDuplicates (); @@ -420,7 +422,7 @@ QString enc = current; // Check for valid codec for the default. If this fails, "SYSTEM" (i.e. - // codecForLocale) will be chosen. + // locale_charset) will be chosen. // FIXME: The default is "SYSTEM" on all platforms. So can this fallback // logic be removed completely? bool default_exists = false; @@ -429,8 +431,9 @@ default_exists = true; QString default_enc = - QTextCodec::codecForLocale ()->name ().toUpper ().prepend - ("SYSTEM (").append (")"); + QString ("SYSTEM (") + + QString (octave_locale_charset_wrapper ()).toUpper () + QString (")"); + if (enc.isEmpty ()) { enc = m_settings->value (ed_default_enc).toString (); diff -r de2c73ae450f -r 865f8ddb2c78 scripts/miscellaneous/mkoctfile.m --- a/scripts/miscellaneous/mkoctfile.m Wed Feb 19 18:42:00 2020 -0500 +++ b/scripts/miscellaneous/mkoctfile.m Fri Feb 21 11:52:08 2020 -0500 @@ -219,11 +219,6 @@ endif cmd = ['"' shell_script '"']; - if (ispc () && isguirunning ()) - ## FIXME: Remove this branch when the MS Windows GUI terminal widget can - ## properly handle colors (bug #57658). - cmd = [cmd ' "-fdiagnostics-color=never"']; - endif for i = 1:nargin cmd = [cmd ' "' varargin{i} '"']; endfor diff -r de2c73ae450f -r 865f8ddb2c78 scripts/testfun/__run_test_suite__.m --- a/scripts/testfun/__run_test_suite__.m Wed Feb 19 18:42:00 2020 -0500 +++ b/scripts/testfun/__run_test_suite__.m Fri Feb 21 11:52:08 2020 -0500 @@ -54,6 +54,7 @@ pso = page_screen_output (); orig_wquiet = warning ("query", "quiet"); orig_wstate = warning (); + orig_mfile_encoding = __mfile_encoding__ ("utf-8"); logfile = make_absolute_filename ("fntests.log"); unwind_protect page_screen_output (false); @@ -146,6 +147,7 @@ warning ("off", "all"); warning (orig_wstate); warning (orig_wquiet.state, "quiet"); + __mfile_encoding__ (orig_mfile_encoding); page_screen_output (pso); end_unwind_protect diff -r de2c73ae450f -r 865f8ddb2c78 test/classdef-multiple-inheritance/base_1.m --- a/test/classdef-multiple-inheritance/base_1.m Wed Feb 19 18:42:00 2020 -0500 +++ b/test/classdef-multiple-inheritance/base_1.m Fri Feb 21 11:52:08 2020 -0500 @@ -1,2 +1,2 @@ classdef base_1 -end \ No newline at end of file +end diff -r de2c73ae450f -r 865f8ddb2c78 test/publish/test_script_code_only.m --- a/test/publish/test_script_code_only.m Wed Feb 19 18:42:00 2020 -0500 +++ b/test/publish/test_script_code_only.m Fri Feb 21 11:52:08 2020 -0500 @@ -21,4 +21,4 @@ str = "some % string \" ' with %{"; str2 = 'another % string '' " with %{'; -% \ No newline at end of file +% diff -r de2c73ae450f -r 865f8ddb2c78 test/publish/test_script_head_only.m --- a/test/publish/test_script_head_only.m Wed Feb 19 18:42:00 2020 -0500 +++ b/test/publish/test_script_head_only.m Fri Feb 21 11:52:08 2020 -0500 @@ -1,4 +1,4 @@ %% Headline % Headline description. % about some lines no blanks -%% \ No newline at end of file +%%