From d93530298568019a940e22291608fcd919c9488e Mon Sep 17 00:00:00 2001 From: Samuel GOUGEON Date: Thu, 22 Apr 2021 20:17:13 +0200 Subject: [PATCH] * Bug 16677 fixed: offline, atomsInstall() was flashing the console http://bugzilla.scilab.org/16677 // Interactive test: om = atomsGetConfig("offline"); atomsSetConfig offline True atomsInstall(WSCI+"\modules\atoms\tests\unit_tests\toolbox_7V6_1.0-1.bin.zip", "user"); // The installation must succeed without flashing the console atomsRemove toolbox_7V6 atomsSetConfig("offline", om); Change-Id: I68e68673bc1919790062aa5fed345ca86698760d --- scilab/CHANGES.md | 1 + .../atoms_internals/atomsDESCRIPTIONread.sci | 8 +++++++- .../atoms_internals/atomsUpdateProgressBar.sci | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index 0b9480d..c20922b 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -465,6 +465,7 @@ Bug Fixes * [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory. * [#16661](https://bugzilla.scilab.org/16661): `x=spzeros(1e10,1e10)` yielded an incorrect error message. * [#16665](https://bugzilla.scilab.org/16665): `help echo` could not redirect to `help mode` when preferred, for new users coming from Octave. +* [#16677](https://bugzilla.scilab.org/16677): In offline mode, `atomsInstall` was flashing many times the console. * [#16679](https://bugzilla.scilab.org/16679): `get_function_path("acosh")` yielded an error (regression from Scilab 6.0.0). diff --git a/scilab/modules/atoms/macros/atoms_internals/atomsDESCRIPTIONread.sci b/scilab/modules/atoms/macros/atoms_internals/atomsDESCRIPTIONread.sci index 08ee4a5..c03a185 100644 --- a/scilab/modules/atoms/macros/atoms_internals/atomsDESCRIPTIONread.sci +++ b/scilab/modules/atoms/macros/atoms_internals/atomsDESCRIPTIONread.sci @@ -116,7 +116,13 @@ function description_out = atomsDESCRIPTIONread(file_in,additional) file_in)); end - winId = atomsOpenProgressBar(_("Updating Atoms modules database..."), %t) + if size(lines_in,1)>1000 then + winId = atomsOpenProgressBar(_("Updating Atoms modules database..."), %t) + else + // No progression bar required when the DESCRIPTION file is so short that + // its processing will be very fast: + winId = [] + end for i=1:(size(lines_in,"*")+1) atomsUpdateProgressBar(winId, i / size(lines_in,"*")); diff --git a/scilab/modules/atoms/macros/atoms_internals/atomsUpdateProgressBar.sci b/scilab/modules/atoms/macros/atoms_internals/atomsUpdateProgressBar.sci index d6a08dc..33bd81b 100644 --- a/scilab/modules/atoms/macros/atoms_internals/atomsUpdateProgressBar.sci +++ b/scilab/modules/atoms/macros/atoms_internals/atomsUpdateProgressBar.sci @@ -14,7 +14,7 @@ // function atomsUpdateProgressBar(winId, value) - if (getscilabmode() <> "NWNI" & winId.type == "Waitbar") + if (getscilabmode() <> "NWNI" & winId <> [] & winId.type == "Waitbar") waitbar(value, winId); end -endfunction \ No newline at end of file +endfunction -- 1.7.9.5