[apps/code] Hide the sandbox between script importations

This commit is contained in:
Léa Saviot
2019-02-05 16:15:41 +01:00
committed by EmilieNumworks
parent 4a8c0a6bd0
commit a021af46fe
5 changed files with 20 additions and 0 deletions

View File

@@ -332,6 +332,13 @@ void ConsoleController::displaySandbox() {
stackViewController()->push(&m_sandboxController);
}
void ConsoleController::hideSandbox() {
if (!sandboxIsDisplayed()) {
return;
}
m_sandboxController.hide();
}
void ConsoleController::resetSandbox() {
if (!sandboxIsDisplayed()) {
return;
@@ -364,6 +371,12 @@ void ConsoleController::printText(const char * text, size_t length) {
}
void ConsoleController::autoImportScript(Script script, bool force) {
if (sandboxIsDisplayed()) {
/* The sandbox might be displayed, for instance if we are auto-importing
* several scripts that draw at importation. In this case, we want to remove
* the sandbox. */
hideSandbox();
}
if (script.importationStatus() || force) {
// Step 1 - Create the command "from scriptName import *".