mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps] Move SettingsMessageTree in Shared
It is needed in exam_mode_configuration. This way, we can build one app only
This commit is contained in:
committed by
EmilieNumworks
parent
f5e53e03e3
commit
750f655b2f
@@ -2,13 +2,13 @@
|
||||
#define APPS_EXAM_MODE_CONFIGURATION_H
|
||||
|
||||
#include "global_preferences.h"
|
||||
#include "settings/settings_message_tree.h"
|
||||
#include "shared/settings_message_tree.h"
|
||||
#include <apps/i18n.h>
|
||||
|
||||
namespace ExamModeConfiguration {
|
||||
|
||||
// Settings menu
|
||||
extern const Settings::SettingsMessageTree s_modelExamChildren[2];
|
||||
extern const Shared::SettingsMessageTree s_modelExamChildren[2];
|
||||
int numberOfAvailableExamMode();
|
||||
GlobalPreferences::ExamMode examModeAtIndex(int index);
|
||||
I18n::Message examModeActivationMessage(int index);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "exam_mode_configuration.h"
|
||||
|
||||
constexpr Settings::SettingsMessageTree ExamModeConfiguration::s_modelExamChildren[] = {Settings::SettingsMessageTree(I18n::Message::ActivateExamMode), Settings::SettingsMessageTree(I18n::Message::Default)};
|
||||
constexpr Shared::SettingsMessageTree ExamModeConfiguration::s_modelExamChildren[] = {Shared::SettingsMessageTree(I18n::Message::ActivateExamMode), Shared::SettingsMessageTree(I18n::Message::Default)};
|
||||
|
||||
int ExamModeConfiguration::numberOfAvailableExamMode() {
|
||||
return 1;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "exam_mode_configuration.h"
|
||||
|
||||
constexpr Settings::SettingsMessageTree ExamModeConfiguration::s_modelExamChildren[2] = {Settings::SettingsMessageTree(I18n::Message::ActivateExamMode), Settings::SettingsMessageTree(I18n::Message::ActivateDutchExamMode)};
|
||||
constexpr Shared::SettingsMessageTree ExamModeConfiguration::s_modelExamChildren[2] = {Shared::SettingsMessageTree(I18n::Message::ActivateExamMode), Shared::SettingsMessageTree(I18n::Message::ActivateDutchExamMode)};
|
||||
|
||||
int ExamModeConfiguration::numberOfAvailableExamMode() {
|
||||
if (GlobalPreferences::sharedGlobalPreferences()->language() != I18n::Language::EN || GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) {
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
apps += Settings::App
|
||||
app_headers += apps/settings/app.h
|
||||
|
||||
app_settings_test_src = $(addprefix apps/settings/,\
|
||||
settings_message_tree.cpp \
|
||||
)
|
||||
|
||||
app_settings_src = $(addprefix apps/settings/,\
|
||||
app.cpp \
|
||||
cell_with_separator.cpp \
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
using namespace Shared;
|
||||
|
||||
namespace Settings {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define SETTINGS_MAIN_CONTROLLER_H
|
||||
|
||||
#include <escher.h>
|
||||
#include "settings_message_tree.h"
|
||||
#include <apps/shared/settings_message_tree.h>
|
||||
#include "message_table_cell_with_gauge_with_separator.h"
|
||||
#include "sub_menu/about_controller.h"
|
||||
#include "sub_menu/display_mode_controller.h"
|
||||
@@ -12,14 +12,14 @@
|
||||
|
||||
namespace Settings {
|
||||
|
||||
extern const SettingsMessageTree s_modelAngleChildren[3];
|
||||
extern const SettingsMessageTree s_modelEditionModeChildren[2];
|
||||
extern const SettingsMessageTree s_modelFloatDisplayModeChildren[4];
|
||||
extern const SettingsMessageTree s_modelComplexFormatChildren[3];
|
||||
extern const SettingsMessageTree s_modelFontChildren[2];
|
||||
extern const SettingsMessageTree s_modelExamChildren[2];
|
||||
extern const SettingsMessageTree s_modelAboutChildren[3];
|
||||
extern const SettingsMessageTree s_model;
|
||||
extern const Shared::SettingsMessageTree s_modelAngleChildren[3];
|
||||
extern const Shared::SettingsMessageTree s_modelEditionModeChildren[2];
|
||||
extern const Shared::SettingsMessageTree s_modelFloatDisplayModeChildren[4];
|
||||
extern const Shared::SettingsMessageTree s_modelComplexFormatChildren[3];
|
||||
extern const Shared::SettingsMessageTree s_modelFontChildren[2];
|
||||
extern const Shared::SettingsMessageTree s_modelExamChildren[2];
|
||||
extern const Shared::SettingsMessageTree s_modelAboutChildren[3];
|
||||
extern const Shared::SettingsMessageTree s_model;
|
||||
|
||||
class MainController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource {
|
||||
public:
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
* k_indexOfAboutCell) */
|
||||
constexpr static int k_indexOfPopUpCell = k_indexOfExamModeCell + 1;
|
||||
constexpr static int k_indexOfAboutCell = k_indexOfExamModeCell + 1;
|
||||
static const SettingsMessageTree * model();
|
||||
static const Shared::SettingsMessageTree * model();
|
||||
StackViewController * stackController() const;
|
||||
I18n::Message promptMessage() const;
|
||||
bool hasPrompt() const { return promptMessage() != I18n::Message::Default; }
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "../exam_mode_configuration.h"
|
||||
#include <apps/i18n.h>
|
||||
|
||||
using namespace Shared;
|
||||
|
||||
namespace Settings {
|
||||
|
||||
constexpr SettingsMessageTree s_modelMenu[] =
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "../exam_mode_configuration.h"
|
||||
#include <apps/i18n.h>
|
||||
|
||||
using namespace Shared;
|
||||
|
||||
namespace Settings {
|
||||
|
||||
constexpr SettingsMessageTree s_modelMenu[] =
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
namespace Settings {
|
||||
|
||||
using namespace Shared;
|
||||
|
||||
constexpr SettingsMessageTree s_modelMenu[] =
|
||||
{SettingsMessageTree(I18n::Message::AngleUnit, s_modelAngleChildren),
|
||||
SettingsMessageTree(I18n::Message::DisplayMode, s_modelFloatDisplayModeChildren),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define SETTINGS_GENERIC_SUB_CONTROLLER_H
|
||||
|
||||
#include <escher.h>
|
||||
#include "../settings_message_tree.h"
|
||||
#include <apps/shared/settings_message_tree.h>
|
||||
|
||||
namespace Settings {
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ app_shared_src = $(addprefix apps/shared/,\
|
||||
scrollable_two_expressions_cell.cpp \
|
||||
separable.cpp \
|
||||
separator_even_odd_buffer_text_cell.cpp \
|
||||
settings_message_tree.cpp \
|
||||
simple_interactive_curve_view_controller.cpp \
|
||||
store_cell.cpp \
|
||||
store_controller.cpp \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "settings_message_tree.h"
|
||||
|
||||
namespace Settings {
|
||||
namespace Shared {
|
||||
|
||||
const MessageTree * SettingsMessageTree::children(int index) const {
|
||||
return &m_children[index];
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef SETTINGS_MESSAGE_TREE_H
|
||||
#define SETTINGS_MESSAGE_TREE_H
|
||||
#ifndef SHARED_SETTINGS_MESSAGE_TREE_H
|
||||
#define SHARED_SETTINGS_MESSAGE_TREE_H
|
||||
#include <escher/message_tree.h>
|
||||
#include <apps/i18n.h>
|
||||
|
||||
namespace Settings {
|
||||
namespace Shared {
|
||||
|
||||
class SettingsMessageTree : public MessageTree {
|
||||
public:
|
||||
Reference in New Issue
Block a user