[code] Each script has a name, stored in the accordeon buffer.

A script can now be imported in the console.
Moved all the MicroPython functions to python/port files.

Change-Id: I0a23e8cb20005719b800e81470e1c574c702c3b7
This commit is contained in:
Léa Saviot
2017-10-19 13:52:18 +02:00
committed by Romain Goyet
parent f3200fe2e9
commit 5de4b5cd67
34 changed files with 868 additions and 600 deletions

View File

@@ -0,0 +1,43 @@
#ifndef CODE_SCRIPT_PARAMETER_CONTROLLER_H
#define CODE_SCRIPT_PARAMETER_CONTROLLER_H
#include <escher.h>
#include "../i18n.h"
#include "editor_controller.h"
#include "script_store.h"
namespace Code {
class ScriptParameterController : public ViewController, public SimpleListViewDataSource, public SelectableTableViewDataSource {
public:
ScriptParameterController(Responder * parentResponder, I18n::Message title, ScriptStore * scriptStore);
void setScript(int i);
/* ViewController */
View * view() override;
const char * title() override;
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
/* SimpleListViewDataSource */
KDCoordinate cellHeight() override;
HighlightCell * reusableCell(int index) override;
int reusableCellCount() override;
int numberOfRows() override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
private:
constexpr static int k_totalNumberOfCell = 4;
I18n::Message m_pageTitle;
MessageTableCell m_editScript;
MessageTableCell m_renameScript;
MessageTableCellWithSwitch m_autoImportScript;
MessageTableCell m_deleteScript;
SelectableTableView m_selectableTableView;
EditorController m_editorController;
ScriptStore * m_scriptStore;
};
}
#endif