[code] Fixed Execute Script bug.

When disabling a script auto-import parameter, it would not import
itself when executing it from its script parameters menu.

Change-Id: If58f6fe1be4792b551ad3b462f1f43e8b82e8148
This commit is contained in:
Léa Saviot
2017-11-29 17:56:00 +01:00
parent 6ab9a36472
commit dd1fe77832
3 changed files with 4 additions and 4 deletions

View File

@@ -281,13 +281,13 @@ void ConsoleController::printText(const char * text, size_t length) {
}
}
void ConsoleController::autoImportScriptAtIndex(int index) {
void ConsoleController::autoImportScriptAtIndex(int index, bool force) {
const char * importCommand1 = "from ";
const char * importCommand2 = " import *";
int lenImportCommand1 = strlen(importCommand1);
int lenImportCommand2 = strlen(importCommand2);
Script script = m_scriptStore->scriptAtIndex(index);
if (script.autoImport()) {
if (script.autoImport() || force) {
// Remove the name extension ".py" if there is one.
int scriptOriginalNameLength = strlen(script.name());
char scriptNewName[scriptOriginalNameLength];