[apps/code] Fix variables loading in the console

Scenario: execute a script, open the variable box, select a leaf, reopen
the variable box -> it shows empty
This commit is contained in:
Léa Saviot
2020-06-19 12:08:48 +02:00
parent cf4eaa3d1f
commit 1045f54633
3 changed files with 6 additions and 13 deletions

View File

@@ -173,6 +173,7 @@ const char * ConsoleController::inputText(const char * prompt) {
void ConsoleController::viewWillAppear() {
ViewController::viewWillAppear();
m_scriptStore->clearConsoleFetchInformation();
loadPythonEnvironment();
if (m_importScriptsWhenViewAppears) {
m_importScriptsWhenViewAppears = false;
@@ -195,14 +196,6 @@ void ConsoleController::didBecomeFirstResponder() {
}
}
void ConsoleController::willExitResponderChain(Responder * nextFirstResponder) {
ViewController::willExitResponderChain(nextFirstResponder);
/* We clean when exiting the responder chain and not when entering it,
* otherwise we break an assertion which checks that the script statuses are
* clean in VariableBoxController::loadFunctionsAndVariables. */
m_scriptStore->clearConsoleFetchInformation();
}
bool ConsoleController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
if (m_consoleStore.numberOfLines() > 0 && m_selectableTableView.selectedRow() < m_consoleStore.numberOfLines()) {