[code] Load Variable box content before compiling any other python code

to avoid memory exhaustion when displaying variable box
This commit is contained in:
Émilie Feral
2018-10-25 14:44:29 +02:00
parent c7e001a01d
commit a4f7d83805
7 changed files with 56 additions and 37 deletions

View File

@@ -2,13 +2,14 @@
#define CODE_VARIABLE_BOX_CONTROLLER_H
#include <escher.h>
#include "menu_controller.h"
#include "script_node.h"
#include "script_node_cell.h"
#include "script_store.h"
namespace Code {
class App;
class VariableBoxController : public NestedMenuController {
public:
VariableBoxController(App * pythonDelegate, ScriptStore * scriptStore);
@@ -17,15 +18,14 @@ public:
bool handleEvent(Ion::Events::Event event) override;
void didEnterResponderChain(Responder * previousFirstResponder) override;
/* View Controller */
void viewWillAppear() override;
void viewDidDisappear() override;
/* ListViewDataSource */
int numberOfRows() override;
int reusableCellCount(int type) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
int typeAtLocation(int i, int j) override;
/* VariableBoxController */
void loadFunctionsAndVariables();
private:
constexpr static int k_maxScriptObjectNameSize = 100;
constexpr static int k_maxNumberOfDisplayedRows = 6; //240/40