New implementation

This commit is contained in:
Alexandre Paillier
2022-09-02 14:22:11 +02:00
parent a58d2ababb
commit 493ce85c3b
6 changed files with 312 additions and 186 deletions

View File

@@ -1,9 +1,11 @@
#include "shared_context.h"
#include "ui_callbacks.h"
#include "sign_message.h"
// clang-format off
UX_STEP_NOCB(
ux_sign_flow_1_step,
ux_191_step_review,
pnn,
{
&C_icon_certificate,
@@ -11,14 +13,36 @@ UX_STEP_NOCB(
"message",
});
UX_STEP_NOCB(
ux_sign_flow_2_step,
ux_191_step_message,
bnnn_paging,
{
.title = "Message",
.text = strings.tmp.tmp,
});
UX_STEP_INIT(
ux_191_step_dummy_pre,
NULL,
NULL,
{
dummy_pre_cb();
});
UX_STEP_CB(
ux_sign_flow_3_step,
ux_191_step_theres_more,
bn,
theres_more_click_cb(),
{
"There's more!",
"Click to skip"
});
UX_STEP_INIT(
ux_191_step_dummy_post,
NULL,
NULL,
{
dummy_post_cb();
});
UX_STEP_CB(
ux_191_step_sign,
pbb,
io_seproxyhal_touch_signMessage_ok(),
{
@@ -27,7 +51,7 @@ UX_STEP_CB(
"message",
});
UX_STEP_CB(
ux_sign_flow_4_step,
ux_191_step_cancel,
pbb,
io_seproxyhal_touch_signMessage_cancel(),
{
@@ -38,7 +62,32 @@ UX_STEP_CB(
// clang-format on
UX_FLOW(ux_sign_flow,
&ux_sign_flow_1_step,
&ux_sign_flow_2_step,
&ux_sign_flow_3_step,
&ux_sign_flow_4_step);
&ux_191_step_review,
&ux_191_step_message,
&ux_191_step_dummy_pre,
&ux_191_step_theres_more,
&ux_191_step_dummy_post,
&ux_191_step_sign,
&ux_191_step_cancel);
void ui_191_switch_to_message(void)
{
ux_flow_init(0, ux_sign_flow, &ux_191_step_message);
}
void ui_191_switch_to_message_end(void)
{
ux_flow_init(0, ux_sign_flow, &ux_191_step_dummy_pre);
// with pos != REVIEW, automatically goes back to previous step
}
void ui_191_switch_to_sign(void)
{
ux_flow_init(0, ux_sign_flow, &ux_191_step_sign);
}
void ui_191_switch_to_question(void)
{
ux_flow_init(0, ux_sign_flow, &ux_191_step_theres_more);
}

View File

@@ -0,0 +1,9 @@
#ifndef UI_FLOW_SIGNMESSAGE_H_
#define UI_FLOW_SIGNMESSAGE_H_
void ui_191_switch_to_message(void);
void ui_191_switch_to_message_end(void);
void ui_191_switch_to_sign(void);
void ui_191_switch_to_question(void);
#endif // UI_FLOW_SIGNMESSAGE_H_