mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
A Script object now contains its AutoImport marker, its name and its content. The ScripStore methods have better names and the optimization is cleaner. Change-Id: I1b21af2d23f1c9a34f984309512b0c01b2f1c320
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#include "app.h"
|
|
#include "../apps_container.h"
|
|
#include "code_icon.h"
|
|
#include "../i18n.h"
|
|
|
|
namespace Code {
|
|
|
|
I18n::Message App::Descriptor::name() {
|
|
return I18n::Message::CodeApp;
|
|
}
|
|
|
|
I18n::Message App::Descriptor::upperName() {
|
|
return I18n::Message::CodeAppCapital;
|
|
}
|
|
|
|
const Image * App::Descriptor::icon() {
|
|
return ImageStore::CodeIcon;
|
|
}
|
|
|
|
App::Snapshot::Snapshot() {
|
|
m_scriptStore.addNewScript(ScriptStore::DefaultScript::Factorial);
|
|
}
|
|
|
|
App * App::Snapshot::unpack(Container * container) {
|
|
return new App(container, this);
|
|
}
|
|
|
|
void App::Snapshot::reset() {
|
|
m_scriptStore.deleteAllScripts();
|
|
}
|
|
|
|
App::Descriptor * App::Snapshot::descriptor() {
|
|
static Descriptor descriptor;
|
|
return &descriptor;
|
|
}
|
|
|
|
ScriptStore * App::Snapshot::scriptStore() {
|
|
return &m_scriptStore;
|
|
}
|
|
|
|
App::App(Container * container, Snapshot * snapshot) :
|
|
::App(container, snapshot, &m_codeStackViewController, I18n::Message::Warning),
|
|
m_listFooter(&m_codeStackViewController, &m_menuController, &m_menuController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey),
|
|
m_menuController(&m_listFooter, snapshot->scriptStore(), &m_listFooter),
|
|
m_codeStackViewController(&m_modalViewController, &m_listFooter)
|
|
{
|
|
}
|
|
|
|
}
|