Skip to content

Commit

Permalink
Add about information
Browse files Browse the repository at this point in the history
  • Loading branch information
solosky committed Aug 11, 2024
1 parent ba32281 commit 877a835
Show file tree
Hide file tree
Showing 20 changed files with 1,362 additions and 1,289 deletions.
2 changes: 2 additions & 0 deletions fw/application/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ SRC_FILES += \
$(PROJ_DIR)/app/settings/scene/settings_scene_oled_contrast.c \
$(PROJ_DIR)/app/settings/scene/settings_scene_language.c \
$(PROJ_DIR)/app/settings/scene/settings_scene_storage.c \
$(PROJ_DIR)/app/settings/scene/settings_scene_about.c \
$(PROJ_DIR)/i18n/en_US.c \
$(PROJ_DIR)/i18n/zh_Hans.c \
$(PROJ_DIR)/i18n/zh_TW.c \
Expand Down Expand Up @@ -729,6 +730,7 @@ full: settingsgen
gen:
python3 ../scripts/amiibo_db_gen.py
python3 ../scripts/i18n_gen.py
python3 ../scripts/font_data_gen.py
python3 ../scripts/resource_gen.py

flash_ocd: default
Expand Down
37 changes: 37 additions & 0 deletions fw/application/src/app/settings/scene/settings_scene_about.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "app_settings.h"
#include "i18n/language.h"
#include "mini_app_launcher.h"
#include "nrf_pwr_mgmt.h"
#include "settings.h"
#include "settings_scene.h"
#include "utils2.h"
#include "version2.h"
#include "mui_icons.h"


static void settings_scene_about_list_view_on_selected(mui_list_view_event_t event, mui_list_view_t *p_list_view,
mui_list_item_t *p_item) {
app_settings_t *app = p_list_view->user_data;
if(p_item->icon == ICON_BACK){
mui_scene_dispatcher_previous_scene(app->p_scene_dispatcher);
}
}

void settings_scene_about_on_enter(void *user_data) {

app_settings_t *app = user_data;

mui_list_view_add_item(app->p_list_view, ICON_FILE, _T(APP_SET_ABOUT_OPEN_SOURCE_PROJECT), NULL_USER_DATA);
mui_list_view_add_item(app->p_list_view, ICON_FILE, _T(APP_SET_ABOUT_LGPL_LICENSE), NULL_USER_DATA);
mui_list_view_add_item(app->p_list_view, ICON_FILE, "github.com/solosky/pixl.js", NULL_USER_DATA);
mui_list_view_add_item(app->p_list_view, ICON_BACK, getLangString(_L_BACK), NULL_USER_DATA);

mui_list_view_set_selected_cb(app->p_list_view, settings_scene_about_list_view_on_selected);
mui_view_dispatcher_switch_to_view(app->p_view_dispatcher, SETTINGS_VIEW_ID_MAIN);
}

void settings_scene_about_on_exit(void *user_data) {
app_settings_t *app = user_data;
mui_list_view_clear_items(app->p_list_view);
mui_list_view_set_selected_cb(app->p_list_view, NULL);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ ADD_SCENE(settings, lcd_backlight, LCD_BACKLIGHT)
ADD_SCENE(settings, oled_contrast, OLED_CONTRAST)
#endif
ADD_SCENE(settings, language, LANGUAGE)
ADD_SCENE(settings, storage, STORAGE)
ADD_SCENE(settings, storage, STORAGE)
ADD_SCENE(settings, about, ABOUT)
9 changes: 7 additions & 2 deletions fw/application/src/app/settings/scene/settings_scene_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum settings_main_menu_t {
SETTINGS_MAIN_MENU_DFU,
SETTINGS_MAIN_MENU_REBOOT,
SETTINGS_MAIN_MENU_RESET_DEFAULT,
SETTINGS_MAIN_MENU_ABOUT,
SETTINGS_MAIN_MENU_EXIT
};

Expand Down Expand Up @@ -128,9 +129,11 @@ static void settings_scene_main_list_view_on_selected(mui_list_view_event_t even
mui_msg_box_set_event_cb(app->p_msg_box, settings_scene_main_msg_box_reset_settings_cb);

mui_view_dispatcher_switch_to_view(app->p_view_dispatcher, SETTINGS_VIEW_ID_MSG_BOX);
}
} break;

break;
case SETTINGS_MAIN_MENU_ABOUT: {
mui_scene_dispatcher_next_scene(app->p_scene_dispatcher, SETTINGS_SCENE_ABOUT);
} break;
}
}

Expand Down Expand Up @@ -207,6 +210,8 @@ static void settings_scene_main_reload(void *user_data) {
mui_list_view_add_item(app->p_list_view, 0xe1ce, _T(APP_SET_RESET_DEFAULT),
(void *)SETTINGS_MAIN_MENU_RESET_DEFAULT);

mui_list_view_add_item(app->p_list_view, 0xe1cf, _T(APP_SET_ABOUT), (void *)SETTINGS_MAIN_MENU_ABOUT);

mui_list_view_add_item(app->p_list_view, 0xe069, _T(BACK_TO_MAIN_MENU), (void *)SETTINGS_MAIN_MENU_EXIT);

mui_list_view_set_focus(app->p_list_view, foucs_index);
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/de_DE.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_de_DE[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Standardeinstellungen",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Einstellungen zurückgesetzt!",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "Auf Standardeinstellungen zurücksetzen?",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 Sekunden",
[_L_30S] = "30 Sekunden",
[_L_45S] = "45 Sekunden",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/en_US.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_en_US[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Reset Default Setting",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Reset Success!",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "Confirm Reset Settings?",
[_L_APP_SET_ABOUT] = "About Device",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "Open Source Project",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "LGPL2.0 License",
[_L_15S] = "15 Seconds",
[_L_30S] = "30 Seconds",
[_L_45S] = "45 Seconds",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/es_ES.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_es_ES[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Restablecer config.",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "¡Configuración Restablecida!",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "¿Confirma Restablecer\nConfig.?",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 segundos",
[_L_30S] = "30 segundos",
[_L_45S] = "45 segundos",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/fr_FR.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_fr_FR[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Rétablir les Paramètres par Défaut",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Réinitialiser les Paramètres Par Défaut",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 sec.",
[_L_30S] = "30 sec.",
[_L_45S] = "45 sec.",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/hu_HU.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_hu_HU[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Alapért. Beállítás Visszaállítása",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Alapért. Beállítások Visszaállítása",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 sec.",
[_L_30S] = "30 sec.",
[_L_45S] = "45 sec.",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/it_IT.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_it_IT[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Ripristina impostazioni predefinite",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Ripristino riuscito!",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "Conferma il ripristino delle impostazioni?",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 secondi",
[_L_30S] = "30 secondi",
[_L_45S] = "45 secondi",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/ja_JP.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_ja_JP[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "デフォルト設定に戻す",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "設定を初期化",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15秒",
[_L_30S] = "30秒",
[_L_45S] = "45秒",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/nl_NL.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_nl_NL[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Terugzetten Naar Standaardwaarden",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Standaardinstellingen Herstellen",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 sec.",
[_L_30S] = "30 sec.",
[_L_45S] = "45 sec.",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/pt_BR.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_pt_BR[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Restaurar Configurações Padrão",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Redefinir a Configuração Padrão",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 seg.",
[_L_30S] = "30 seg.",
[_L_45S] = "45 seg.",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/ru_RU.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_ru_RU[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "Сброс настроек",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "Сброс выполнен",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "Выполнить?",
[_L_APP_SET_ABOUT] = "",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "",
[_L_15S] = "15 секунд",
[_L_30S] = "30 секунд",
[_L_45S] = "45 секунд",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/string_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ typedef enum {
_L_APP_SET_RESET_DEFAULT,
_L_APP_SET_RESET_DEFAULT_SUCCESS,
_L_APP_SET_RESET_DEFAULT_CONFIRM,
_L_APP_SET_ABOUT,
_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT,
_L_APP_SET_ABOUT_LGPL_LICENSE,
_L_15S,
_L_30S,
_L_45S,
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/zh_Hans.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_zh_Hans[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "重置默认配置",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "重置成功",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "确认重置默认设置?",
[_L_APP_SET_ABOUT] = "关于设备",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "开源项目",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "LGPL 2.0 授权",
[_L_15S] = "15秒",
[_L_30S] = "30秒",
[_L_45S] = "45秒",
Expand Down
3 changes: 3 additions & 0 deletions fw/application/src/i18n/zh_TW.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const char * const lang_zh_TW[_L_COUNT] = {
[_L_APP_SET_RESET_DEFAULT] = "重置默認配置",
[_L_APP_SET_RESET_DEFAULT_SUCCESS] = "重置成功",
[_L_APP_SET_RESET_DEFAULT_CONFIRM] = "确认重置默认设置?",
[_L_APP_SET_ABOUT] = "關於設俻",
[_L_APP_SET_ABOUT_OPEN_SOURCE_PROJECT] = "開源項目",
[_L_APP_SET_ABOUT_LGPL_LICENSE] = "LGPL 2.0 授權",
[_L_15S] = "15秒",
[_L_30S] = "30秒",
[_L_45S] = "45秒",
Expand Down
Loading

0 comments on commit 877a835

Please sign in to comment.