Settings renaming & reordering
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
|
||||
// Reuse the strings.common.fullAmount buffer for settings displaying.
|
||||
// No risk of collision as this buffer is unused in the settings menu
|
||||
#define SETTING_DISPLAY_DATA_STATE (strings.common.fullAmount + (BUF_INCREMENT * 0))
|
||||
#define SETTING_DISPLAY_NONCE_STATE (strings.common.fullAmount + (BUF_INCREMENT * 1))
|
||||
#define SETTING_VERBOSE_EIP712_STATE (strings.common.fullAmount + (BUF_INCREMENT * 2))
|
||||
#define SETTING_VERBOSE_DOMAIN_NAME_STATE (strings.common.fullAmount + (BUF_INCREMENT * 3))
|
||||
#define SETTING_VERBOSE_DOMAIN_NAME_STATE (strings.common.fullAmount + (BUF_INCREMENT * 0))
|
||||
#define SETTING_VERBOSE_EIP712_STATE (strings.common.fullAmount + (BUF_INCREMENT * 1))
|
||||
#define SETTING_DISPLAY_NONCE_STATE (strings.common.fullAmount + (BUF_INCREMENT * 2))
|
||||
#define SETTING_DISPLAY_DATA_STATE (strings.common.fullAmount + (BUF_INCREMENT * 3))
|
||||
|
||||
#define BOOL_TO_STATE_STR(b) (b ? ENABLED_STR : DISABLED_STR)
|
||||
|
||||
@@ -70,25 +70,31 @@ UX_FLOW(ux_idle_flow,
|
||||
FLOW_LOOP);
|
||||
|
||||
// clang-format off
|
||||
#ifdef HAVE_DOMAIN_NAME
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_display_data_step,
|
||||
#ifdef TARGET_NANOS
|
||||
bnnn_paging,
|
||||
#else
|
||||
ux_settings_flow_verbose_domain_name_step,
|
||||
bnnn,
|
||||
#endif
|
||||
switch_settings_display_data(),
|
||||
switch_settings_verbose_domain_name(),
|
||||
{
|
||||
#ifdef TARGET_NANOS
|
||||
.title = "Debug data",
|
||||
.text =
|
||||
#else
|
||||
"Debug data",
|
||||
"Show contract data",
|
||||
"details",
|
||||
#endif
|
||||
SETTING_DISPLAY_DATA_STATE
|
||||
"ENS addresses",
|
||||
"Displays resolved",
|
||||
"addresses from ENS",
|
||||
SETTING_VERBOSE_DOMAIN_NAME_STATE
|
||||
});
|
||||
#endif // HAVE_DOMAIN_NAME
|
||||
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_verbose_eip712_step,
|
||||
bnnn,
|
||||
switch_settings_verbose_eip712(),
|
||||
{
|
||||
"Raw messages",
|
||||
"Displays raw content",
|
||||
"from EIP712 messages",
|
||||
SETTING_VERBOSE_EIP712_STATE
|
||||
});
|
||||
#endif // HAVE_EIP712_FULL_SUPPORT
|
||||
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_display_nonce_step,
|
||||
@@ -104,38 +110,31 @@ UX_STEP_CB(
|
||||
.text =
|
||||
#else
|
||||
"Nonce",
|
||||
"Show account nonce",
|
||||
"Displays nonce",
|
||||
"in transactions",
|
||||
#endif
|
||||
SETTING_DISPLAY_NONCE_STATE
|
||||
});
|
||||
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_verbose_eip712_step,
|
||||
ux_settings_flow_display_data_step,
|
||||
#ifdef TARGET_NANOS
|
||||
bnnn_paging,
|
||||
#else
|
||||
bnnn,
|
||||
switch_settings_verbose_eip712(),
|
||||
#endif
|
||||
switch_settings_display_data(),
|
||||
{
|
||||
"Verbose EIP-712",
|
||||
"Ignore filtering &",
|
||||
"display raw content",
|
||||
SETTING_VERBOSE_EIP712_STATE
|
||||
#ifdef TARGET_NANOS
|
||||
.title = "Debug data",
|
||||
.text =
|
||||
#else
|
||||
"Debug contracts",
|
||||
"Displays contract",
|
||||
"data details",
|
||||
#endif
|
||||
SETTING_DISPLAY_DATA_STATE
|
||||
});
|
||||
#endif // HAVE_EIP712_FULL_SUPPORT
|
||||
|
||||
#ifdef HAVE_DOMAIN_NAME
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_verbose_domain_name_step,
|
||||
bnnn,
|
||||
switch_settings_verbose_domain_name(),
|
||||
{
|
||||
"Verbose domains",
|
||||
"Show",
|
||||
"resolved address",
|
||||
SETTING_VERBOSE_DOMAIN_NAME_STATE
|
||||
});
|
||||
#endif // HAVE_DOMAIN_NAME
|
||||
|
||||
|
||||
UX_STEP_CB(
|
||||
ux_settings_flow_back_step,
|
||||
@@ -148,14 +147,14 @@ UX_STEP_CB(
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_settings_flow,
|
||||
&ux_settings_flow_display_data_step,
|
||||
&ux_settings_flow_display_nonce_step,
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
&ux_settings_flow_verbose_eip712_step,
|
||||
#endif // HAVE_EIP712_FULL_SUPPORT
|
||||
#ifdef HAVE_DOMAIN_NAME
|
||||
&ux_settings_flow_verbose_domain_name_step,
|
||||
#endif // HAVE_DOMAIN_NAME
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
&ux_settings_flow_verbose_eip712_step,
|
||||
#endif // HAVE_EIP712_FULL_SUPPORT
|
||||
&ux_settings_flow_display_nonce_step,
|
||||
&ux_settings_flow_display_data_step,
|
||||
&ux_settings_flow_back_step);
|
||||
|
||||
static void display_settings(const ux_flow_step_t* const start_step) {
|
||||
|
||||
@@ -20,22 +20,22 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
DEBUG_ID = 0,
|
||||
NONCE_ID,
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
EIP712_VERBOSE_ID,
|
||||
#endif
|
||||
#ifdef HAVE_DOMAIN_NAME
|
||||
DOMAIN_NAME_VERBOSE_ID,
|
||||
#endif
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
EIP712_VERBOSE_ID,
|
||||
#endif
|
||||
NONCE_ID,
|
||||
DEBUG_ID,
|
||||
SETTINGS_SWITCHES_NB
|
||||
};
|
||||
|
||||
static uint8_t initSettingPage;
|
||||
|
||||
// settings definition
|
||||
static const char* const infoTypes[SETTING_INFO_NB] = {"Version", APPNAME " App"};
|
||||
static const char* const infoContents[SETTING_INFO_NB] = {APPVERSION, "(c) " BUILD_YEAR " Ledger"};
|
||||
static const char* const infoTypes[SETTING_INFO_NB] = {"Version", "Developer"};
|
||||
static const char* const infoContents[SETTING_INFO_NB] = {APPVERSION, "Ledger"};
|
||||
|
||||
static nbgl_contentInfoList_t infoList = {0};
|
||||
static nbgl_contentSwitch_t switches[SETTINGS_SWITCHES_NB] = {0};
|
||||
@@ -77,34 +77,34 @@ static void controlsCallback(int token, uint8_t index, int page) {
|
||||
}
|
||||
|
||||
void ui_menu_settings(void) {
|
||||
switches[DEBUG_ID].initState = N_storage.contractDetails ? ON_STATE : OFF_STATE;
|
||||
switches[DEBUG_ID].text = "Debug";
|
||||
switches[DEBUG_ID].subText = "Display contract data\ndetails";
|
||||
switches[DEBUG_ID].token = DEBUG_TOKEN;
|
||||
switches[DEBUG_ID].tuneId = TUNE_TAP_CASUAL;
|
||||
|
||||
switches[NONCE_ID].initState = N_storage.displayNonce ? ON_STATE : OFF_STATE;
|
||||
switches[NONCE_ID].text = "Nonce";
|
||||
switches[NONCE_ID].subText = "Display account nonce\nin transaction";
|
||||
switches[NONCE_ID].token = NONCE_TOKEN;
|
||||
switches[NONCE_ID].tuneId = TUNE_TAP_CASUAL;
|
||||
#ifdef HAVE_DOMAIN_NAME
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].initState =
|
||||
N_storage.verbose_domain_name ? ON_STATE : OFF_STATE;
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].text = "ENS addresses";
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].subText = "Displays the resolved address of ENS domains.";
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].token = DOMAIN_NAME_VERBOSE_TOKEN;
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].tuneId = TUNE_TAP_CASUAL;
|
||||
#endif // HAVE_DOMAIN_NAME
|
||||
|
||||
#ifdef HAVE_EIP712_FULL_SUPPORT
|
||||
switches[EIP712_VERBOSE_ID].initState = N_storage.verbose_eip712 ? ON_STATE : OFF_STATE;
|
||||
switches[EIP712_VERBOSE_ID].text = "Verbose EIP712";
|
||||
switches[EIP712_VERBOSE_ID].subText = "Ignore filtering and\ndisplay raw content";
|
||||
switches[EIP712_VERBOSE_ID].text = "Raw messages";
|
||||
switches[EIP712_VERBOSE_ID].subText = "Displays raw content from EIP712 messages.";
|
||||
switches[EIP712_VERBOSE_ID].token = EIP712_VERBOSE_TOKEN;
|
||||
switches[EIP712_VERBOSE_ID].tuneId = TUNE_TAP_CASUAL;
|
||||
#endif // HAVE_EIP712_FULL_SUPPORT
|
||||
|
||||
#ifdef HAVE_DOMAIN_NAME
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].initState =
|
||||
N_storage.verbose_domain_name ? ON_STATE : OFF_STATE;
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].text = "Verbose domains";
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].subText = "Show resolved address";
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].token = DOMAIN_NAME_VERBOSE_TOKEN;
|
||||
switches[DOMAIN_NAME_VERBOSE_ID].tuneId = TUNE_TAP_CASUAL;
|
||||
#endif // HAVE_DOMAIN_NAME
|
||||
switches[NONCE_ID].initState = N_storage.displayNonce ? ON_STATE : OFF_STATE;
|
||||
switches[NONCE_ID].text = "Nonce";
|
||||
switches[NONCE_ID].subText = "Displays nonce information in transactions.";
|
||||
switches[NONCE_ID].token = NONCE_TOKEN;
|
||||
switches[NONCE_ID].tuneId = TUNE_TAP_CASUAL;
|
||||
|
||||
switches[DEBUG_ID].initState = N_storage.contractDetails ? ON_STATE : OFF_STATE;
|
||||
switches[DEBUG_ID].text = "Debug smart contracts";
|
||||
switches[DEBUG_ID].subText = "Displays contract data details.";
|
||||
switches[DEBUG_ID].token = DEBUG_TOKEN;
|
||||
switches[DEBUG_ID].tuneId = TUNE_TAP_CASUAL;
|
||||
|
||||
contents[0].type = SWITCHES_LIST;
|
||||
contents[0].content.switchesList.nbSwitches = SETTINGS_SWITCHES_NB;
|
||||
|
||||
Reference in New Issue
Block a user