mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[escher] In app, add an upperName
Change-Id: Iea37749e446c721b5e85af063681e2a98c0e4f37
This commit is contained in:
@@ -56,7 +56,7 @@ bool AppsContainer::handleEvent(Ion::Events::Event event) {
|
||||
}
|
||||
|
||||
void AppsContainer::switchTo(App * app) {
|
||||
m_window.setTitle(app->name());
|
||||
m_window.setTitle(app->upperName());
|
||||
// TODO: Update the battery icon every in a time frame
|
||||
m_window.updateBatteryLevel();
|
||||
Container::switchTo(app);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Calculation {
|
||||
|
||||
App::App(Container * container, Context * context) :
|
||||
TextFieldDelegateApp(container, &m_editExpressionController, "Calcul", ImageStore::CalculationIcon),
|
||||
TextFieldDelegateApp(container, &m_editExpressionController, "Calculs", "CALCULS", ImageStore::CalculationIcon),
|
||||
m_localContext(LocalContext((GlobalContext *)context, &m_calculationStore)),
|
||||
m_calculationStore(CalculationStore()),
|
||||
m_historyController(HistoryController(&m_editExpressionController, &m_calculationStore)),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Graph {
|
||||
|
||||
App::App(Container * container, Context * context) :
|
||||
TextFieldDelegateApp(container, &m_inputViewController, "Graph", ImageStore::GraphIcon),
|
||||
TextFieldDelegateApp(container, &m_inputViewController, "Fonctions", "FONCTIONS", ImageStore::GraphIcon),
|
||||
m_functionStore(FunctionStore()),
|
||||
m_xContext(XContext(context)),
|
||||
m_listController(ListController(&m_listHeader, &m_functionStore, &m_listHeader)),
|
||||
|
||||
@@ -7,7 +7,7 @@ extern "C" {
|
||||
namespace Home {
|
||||
|
||||
App::App(AppsContainer * container) :
|
||||
::App(container, &m_controller, "Applications"),
|
||||
::App(container, &m_controller, "Applications", "APPLICATIONS"),
|
||||
m_controller(Controller(&m_modalViewController, container))
|
||||
{
|
||||
assert(container->appAtIndex(0) == this);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Probability {
|
||||
|
||||
App::App(Container * container) :
|
||||
TextFieldDelegateApp(container, &m_stackViewController, "Probability", ImageStore::ProbabilityIcon),
|
||||
TextFieldDelegateApp(container, &m_stackViewController, "Probabilites", "PROBABILITES", ImageStore::ProbabilityIcon),
|
||||
m_lawController(LawController(nullptr)),
|
||||
m_stackViewController(&m_modalViewController, &m_lawController, true)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Regression {
|
||||
|
||||
App::App(Container * container) :
|
||||
TextFieldDelegateApp(container, &m_tabViewController, "Resgression", ImageStore::RegressionIcon),
|
||||
TextFieldDelegateApp(container, &m_tabViewController, "Regression", "REGRESSION", ImageStore::RegressionIcon),
|
||||
m_store(),
|
||||
m_calculationController(CalculationController(&m_calculationAlternateEmptyViewController, &m_calculationHeader, &m_store)),
|
||||
m_calculationAlternateEmptyViewController(AlternateEmptyViewController(&m_calculationHeader, &m_calculationController, &m_calculationController)),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Statistics {
|
||||
|
||||
App::App(Container * container) :
|
||||
TextFieldDelegateApp(container, &m_tabViewController, "Statistics", ImageStore::StatIcon),
|
||||
TextFieldDelegateApp(container, &m_tabViewController, "Statistiques", "STATISTIQUES", ImageStore::StatIcon),
|
||||
m_store(),
|
||||
m_calculationController(CalculationController(&m_calculationAlternateEmptyViewController, &m_calculationHeader, &m_store)),
|
||||
m_calculationAlternateEmptyViewController(AlternateEmptyViewController(&m_calculationHeader, &m_calculationController, &m_calculationController)),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "text_field_delegate_app.h"
|
||||
#include "apps_container.h"
|
||||
|
||||
TextFieldDelegateApp::TextFieldDelegateApp(Container * container, ViewController * rootViewController, const char * name
|
||||
, const Image * icon) :
|
||||
::App(container, rootViewController, name, icon),
|
||||
TextFieldDelegateApp::TextFieldDelegateApp(Container * container, ViewController * rootViewController, const char * name,
|
||||
const char * upperName, const Image * icon) :
|
||||
::App(container, rootViewController, name, upperName, icon),
|
||||
ExpressionTextFieldDelegate()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
class TextFieldDelegateApp : public ::App, public ExpressionTextFieldDelegate {
|
||||
public:
|
||||
TextFieldDelegateApp(Container * container, ViewController * rootViewController, const char * name = nullptr, const Image * icon = nullptr);
|
||||
TextFieldDelegateApp(Container * container, ViewController * rootViewController, const char * name = nullptr, const char * upperName = nullptr, const Image * icon = nullptr);
|
||||
virtual Context * localContext() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Container;
|
||||
class App : public Responder {
|
||||
public:
|
||||
constexpr static uint8_t Magic = 0xA8;
|
||||
App(Container * container, ViewController * rootViewController, const char * name = nullptr, const Image * icon = nullptr);
|
||||
App(Container * container, ViewController * rootViewController, const char * name = nullptr, const char * upperName = nullptr, const Image * icon = nullptr);
|
||||
void setWindow(Window * window);
|
||||
void setFirstResponder(Responder * responder);
|
||||
Responder * firstResponder();
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
void displayWarning(const char * warningMessage);
|
||||
const Container * container() const;
|
||||
const char * name();
|
||||
const char * upperName();
|
||||
const Image * icon();
|
||||
uint8_t m_magic; // Poor man's RTTI
|
||||
protected:
|
||||
@@ -41,6 +42,7 @@ private:
|
||||
Responder * m_firstResponder;
|
||||
WarningController m_warningController;
|
||||
const char * m_name;
|
||||
const char * m_upperName;
|
||||
const Image * m_icon;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ extern "C" {
|
||||
#include <assert.h>
|
||||
}
|
||||
|
||||
App::App(Container * container, ViewController * rootViewController, const char * name, const Image * icon) :
|
||||
App::App(Container * container, ViewController * rootViewController, const char * name, const char * upperName, const Image * icon) :
|
||||
Responder(nullptr),
|
||||
m_magic(Magic),
|
||||
m_modalViewController(ModalViewController(this, rootViewController)),
|
||||
@@ -12,6 +12,7 @@ App::App(Container * container, ViewController * rootViewController, const char
|
||||
m_firstResponder(nullptr),
|
||||
m_warningController(WarningController(this)),
|
||||
m_name(name),
|
||||
m_upperName(upperName),
|
||||
m_icon(icon)
|
||||
{
|
||||
}
|
||||
@@ -58,6 +59,10 @@ const char * App::name() {
|
||||
return m_name;
|
||||
}
|
||||
|
||||
const char * App::upperName() {
|
||||
return m_upperName;
|
||||
}
|
||||
|
||||
const Image * App::icon() {
|
||||
return m_icon;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user