mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Editing, renaming, deleting or changing the auto-importation of a script triggers the reloading of the console (the history is cleared, Python restarted and the scripts re-imported). Change-Id: If8b933cc077ecd36cab09214b5e7a181aa3ae030
34 lines
794 B
C++
34 lines
794 B
C++
#include "editor_controller.h"
|
|
#include "script_parameter_controller.h"
|
|
|
|
namespace Code {
|
|
|
|
EditorController::EditorController(ScriptParameterController * scriptParameterController) :
|
|
ViewController(nullptr),
|
|
m_view(this),
|
|
m_scriptParameterController(scriptParameterController)
|
|
{
|
|
}
|
|
|
|
void EditorController::setScript(Script script){
|
|
m_view.setText(script.editableContent(), script.contentBufferSize());
|
|
}
|
|
|
|
bool EditorController::handleEvent(Ion::Events::Event event) {
|
|
if (event == Ion::Events::OK) {
|
|
app()->dismissModalViewController();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void EditorController::didBecomeFirstResponder() {
|
|
app()->setFirstResponder(&m_view);
|
|
}
|
|
|
|
void EditorController::viewDidDisappear() {
|
|
m_scriptParameterController->scriptContentEditionDidFinish();
|
|
}
|
|
|
|
}
|