mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code] Load Variable box content before compiling any other python code
to avoid memory exhaustion when displaying variable box
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#include "editor_controller.h"
|
||||
#include "menu_controller.h"
|
||||
#include "script_parameter_controller.h"
|
||||
#include "variable_box_controller.h"
|
||||
#include <apps/code/app.h>
|
||||
#include "app.h"
|
||||
#include <escher/metric.h>
|
||||
#include <ion.h>
|
||||
|
||||
using namespace Shared;
|
||||
|
||||
namespace Code {
|
||||
|
||||
EditorController::EditorController(MenuController * menuController, App * pythonDelegate) :
|
||||
@@ -14,7 +15,7 @@ EditorController::EditorController(MenuController * menuController, App * python
|
||||
m_script(Ion::Storage::Record()),
|
||||
m_menuController(menuController)
|
||||
{
|
||||
m_editorView.setTextAreaDelegates(pythonDelegate, this);
|
||||
m_editorView.setTextAreaDelegates(this, this);
|
||||
}
|
||||
|
||||
void EditorController::setScript(Script script) {
|
||||
@@ -127,6 +128,16 @@ bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events:
|
||||
return false;
|
||||
}
|
||||
|
||||
VariableBoxController * EditorController::variableBoxForInputEventHandler(InputEventHandler * textInput) {
|
||||
VariableBoxController * varBox = static_cast<App *>(app())->variableBoxController();
|
||||
varBox->loadFunctionsAndVariables();
|
||||
return varBox;
|
||||
}
|
||||
|
||||
InputEventHandlerDelegateApp * EditorController::inputEventHandlerDelegateApp() {
|
||||
return static_cast<App *>(app());
|
||||
}
|
||||
|
||||
StackViewController * EditorController::stackController() {
|
||||
return static_cast<StackViewController *>(parentResponder());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user