Merge branch 'contributors' of https://github.com/MixedMatched/LavaOS into lavaos-dev

This commit is contained in:
Quentin Guidée
2019-08-23 07:41:46 +02:00
10 changed files with 95 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ app_src += $(addprefix apps/settings/,\
sub_menu/language_controller.cpp \
sub_menu/message_table_cell_with_editable_text_with_separator.cpp \
sub_menu/preferences_controller.cpp \
sub_menu/contributors_controller.cpp \
)
i18n_files += $(addprefix apps/settings/,\

View File

@@ -29,3 +29,6 @@ ColorWhite = "Wit "
ColorBlue = "Blauw "
ColorGreen = "Groen "
ColorYellow = "Geel "
Contributors = "Medewerkers"
QuentinGuidee = "Quentin Guidee "
DannySimmons = "Danny Simmons "

View File

@@ -29,3 +29,6 @@ ColorWhite = "White "
ColorBlue = "Blue "
ColorGreen = "Green "
ColorYellow = "Yellow "
Contributors = "Contributors"
QuentinGuidee = "Quentin Guidee "
DannySimmons = "Danny Simmons "

View File

@@ -29,3 +29,6 @@ ColorWhite = "Blanco "
ColorBlue = "Azul "
ColorGreen = "Verde "
ColorYellow = "Amarillo "
Contributors = "Contribuyentes"
QuentinGuidee = "Quentin Guidee "
DannySimmons = "Danny Simmons "

View File

@@ -29,3 +29,6 @@ ColorWhite = "Blanc "
ColorBlue = "Bleu "
ColorGreen = "Vert "
ColorYellow = "Jaune "
Contributors = "Contributeurs"
QuentinGuidee = "Quentin Guidee "
DannySimmons = "Danny Simmons "

View File

@@ -29,3 +29,6 @@ ColorWhite = "Branco "
ColorBlue = "Azul "
ColorGreen = "Verde "
ColorYellow = "Amarelo "
Contributors = "Contribuidores"
QuentinGuidee = "Quentin Guidee "
DannySimmons = "Danny Simmons "

View File

@@ -14,11 +14,12 @@ const SettingsMessageTree complexFormatChildren[3] = {SettingsMessageTree(I18n::
const SettingsMessageTree examChildren[1] = {SettingsMessageTree(I18n::Message::ActivateExamMode)};
const SettingsMessageTree ledColorChildren[4] = {SettingsMessageTree(I18n::Message::ColorWhite), SettingsMessageTree(I18n::Message::ColorGreen), SettingsMessageTree(I18n::Message::ColorBlue), SettingsMessageTree(I18n::Message::ColorYellow)};
const SettingsMessageTree aboutChildren[4] = {SettingsMessageTree(I18n::Message::SoftwareVersion), SettingsMessageTree(I18n::Message::CustomSoftwareVersion), SettingsMessageTree(I18n::Message::SerialNumber), SettingsMessageTree(I18n::Message::FccId)};
const SettingsMessageTree contributorsChildren[2] = {SettingsMessageTree(I18n::Message::QuentinGuidee), SettingsMessageTree(I18n::Message::DannySimmons)};
#ifdef EPSILON_BOOT_PROMPT
const SettingsMessageTree menu[10] =
const SettingsMessageTree menu[11] =
#else
const SettingsMessageTree menu[9] =
const SettingsMessageTree menu[10] =
#endif
{SettingsMessageTree(I18n::Message::AngleUnit, angleChildren, 2),
SettingsMessageTree(I18n::Message::DisplayMode, floatDisplayModeChildren, 3),
@@ -33,11 +34,12 @@ const SettingsMessageTree menu[9] =
#elif EPSILON_BOOT_PROMPT == EPSILON_UPDATE_PROMPT
SettingsMessageTree(I18n::Message::UpdatePopUp),
#endif
SettingsMessageTree(I18n::Message::About, aboutChildren, 4)};
SettingsMessageTree(I18n::Message::About, aboutChildren, 4),
SettingsMessageTree(I18n::Message::Contributors, contributorsChildren, 2)};
#ifdef EPSILON_BOOT_PROMPT
const SettingsMessageTree model = SettingsMessageTree(I18n::Message::SettingsApp, menu, 10);
const SettingsMessageTree model = SettingsMessageTree(I18n::Message::SettingsApp, menu, 11);
#else
const SettingsMessageTree model = SettingsMessageTree(I18n::Message::SettingsApp, menu, 9);
const SettingsMessageTree model = SettingsMessageTree(I18n::Message::SettingsApp, menu, 10);
#endif
MainController::MainController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate) :
@@ -52,7 +54,8 @@ MainController::MainController(Responder * parentResponder, InputEventHandlerDel
m_displayModeController(this, inputEventHandlerDelegate),
m_languageController(this, 13),
m_examModeController(this),
m_aboutController(this)
m_aboutController(this),
m_contributorsController(this)
{
for (int i = 0; i < k_numberOfSimpleChevronCells; i++) {
m_cells[i].setMessageFont(KDFont::LargeFont);
@@ -117,6 +120,13 @@ bool MainController::handleEvent(Ion::Events::Event event) {
case 6:
subController = &m_examModeController;
break;
#ifdef EPSILON_BOOT_PROMPT
case 10:
#else
case 9:
#endif
subController = &m_contributorsController;
break;
#ifdef EPSILON_BOOT_PROMPT
case 9:
#else

View File

@@ -8,6 +8,7 @@
#include "sub_menu/exam_mode_controller.h"
#include "sub_menu/language_controller.h"
#include "sub_menu/preferences_controller.h"
#include "sub_menu/contributors_controller.h"
namespace Settings {
@@ -29,12 +30,12 @@ public:
private:
StackViewController * stackController() const;
#ifdef EPSILON_BOOT_PROMPT
constexpr static int k_totalNumberOfCell = 10;
constexpr static int k_totalNumberOfCell = 11;
MessageTableCellWithSwitch m_popUpCell;
#else
constexpr static int k_totalNumberOfCell = 9;
constexpr static int k_totalNumberOfCell = 10;
#endif
constexpr static int k_numberOfSimpleChevronCells = 8;
constexpr static int k_numberOfSimpleChevronCells = 9;
MessageTableCellWithChevronAndMessage m_cells[k_numberOfSimpleChevronCells];
MessageTableCellWithGauge m_brightnessCell;
SelectableTableView m_selectableTableView;
@@ -44,6 +45,7 @@ private:
LanguageController m_languageController;
ExamModeController m_examModeController;
AboutController m_aboutController;
ContributorsController m_contributorsController;
};

View File

@@ -0,0 +1,35 @@
#include "contributors_controller.h"
#include <assert.h>
namespace Settings {
ContributorsController::ContributorsController(Responder * parentResponder) :
GenericSubController(parentResponder)
{
for (int i = 0; i < k_totalNumberOfCell; i++) {
m_cells[i].setMessageFont(KDFont::LargeFont);
m_cells[i].setAccessoryFont(KDFont::SmallFont);
m_cells[i].setAccessoryTextColor(Palette::GreyDark);
}
}
bool ContributorsController::handleEvent(Ion::Events::Event event) {
return GenericSubController::handleEvent(event);
}
HighlightCell * ContributorsController::reusableCell(int index, int type) {
assert(type == 0);
assert(index >= 0 && index < k_totalNumberOfCell);
return &m_cells[index];
}
int ContributorsController::reusableCellCount(int type) {
assert(type == 0);
return k_totalNumberOfCell;
}
void ContributorsController::willDisplayCellForIndex(HighlightCell * cell, int index) {
GenericSubController::willDisplayCellForIndex(cell, index);
}
}

View File

@@ -0,0 +1,23 @@
#ifndef SETTINGS_CONTRIBUTORS_CONTROLLER_H
#define SETTINGS_CONTRIBUTORS_CONTROLLER_H
#include "generic_sub_controller.h"
#include <escher.h>
namespace Settings {
class ContributorsController : public GenericSubController {
public:
ContributorsController(Responder * parentResponder);
bool handleEvent(Ion::Events::Event event) override;
HighlightCell * reusableCell(int index, int type) override;
int reusableCellCount(int type) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
private:
constexpr static int k_totalNumberOfCell = 2;
MessageTableCellWithBuffer m_cells[k_totalNumberOfCell];
};
}
#endif