@@ -67,7 +67,7 @@ gui_activity_t* make_search_address_options_activity(
6767 bool show_account , gui_view_node_t * * account_textbox , gui_view_node_t * * change_textbox );
6868
6969gui_activity_t * make_show_qr_activity (const char * message [], size_t message_size , Icon * icons , size_t num_icons ,
70- size_t frames_per_qr_icon , bool show_options_button , bool show_help_btn );
70+ size_t frames_per_qr_icon , bool show_options_button );
7171gui_activity_t * make_qr_options_activity (gui_view_node_t * * density_textbox , gui_view_node_t * * framerate_textbox );
7272
7373bool import_mnemonic (const uint8_t * bytes , size_t bytes_len , char * buf , size_t buf_len , size_t * written );
@@ -905,14 +905,13 @@ static bool handle_qr_options(uint32_t* qr_flags, const char* help_url)
905905
906906// Create activity to display (potentially multi-frame/animated) qr
907907static gui_activity_t * create_display_bcur_qr_activity (const char * message [], const size_t message_size ,
908- const char * bcur_type , const uint8_t * cbor , const size_t cbor_len , const uint32_t qr_flags , const char * help_url )
908+ const char * bcur_type , const uint8_t * cbor , const size_t cbor_len , const uint32_t qr_flags )
909909{
910910 JADE_ASSERT (message );
911911 JADE_ASSERT (message_size );
912912 JADE_ASSERT (bcur_type );
913913 JADE_ASSERT (cbor );
914914 JADE_ASSERT (cbor_len );
915- // help_url is optional
916915
917916 // Map BCUR cbor into a series of QR-code icons
918917 Icon * icons = NULL ;
@@ -923,10 +922,10 @@ static gui_activity_t* create_display_bcur_qr_activity(const char* message[], co
923922 // Create qr activity for those icons
924923 const bool show_options_button = true;
925924 const uint8_t frames_per_qr = qr_framerate_from_flags (qr_flags );
926- return make_show_qr_activity (message , message_size , icons , num_icons , frames_per_qr , show_options_button , help_url );
925+ return make_show_qr_activity (message , message_size , icons , num_icons , frames_per_qr , show_options_button );
927926}
928927
929- // Display a QR code, with access to size_speed options
928+ // Display a QR code, with access to size/speed options
930929static void display_bcur_qr (const char * message [], const size_t message_size , const char * bcur_type ,
931930 const uint8_t * cbor , const size_t cbor_len , const char * help_url )
932931{
@@ -944,8 +943,7 @@ static void display_bcur_qr(const char* message[], const size_t message_size, co
944943 idletimer_set_min_timeout_secs (BCUR_QR_DISPLAY_MIN_TIMEOUT_SECS );
945944
946945 // Create show psbt activity for those icons
947- gui_activity_t * act
948- = create_display_bcur_qr_activity (message , message_size , bcur_type , cbor , cbor_len , qr_flags , help_url );
946+ gui_activity_t * act = create_display_bcur_qr_activity (message , message_size , bcur_type , cbor , cbor_len , qr_flags );
949947
950948 while (true) {
951949 // Show, and await button click
@@ -954,13 +952,13 @@ static void display_bcur_qr(const char* message[], const size_t message_size, co
954952 const int32_t ev_id = gui_activity_wait_button (act , BTN_QR_DISPLAY_EXIT );
955953 if (ev_id == BTN_QR_OPTIONS ) {
956954 if (handle_qr_options (& qr_flags , help_url )) {
957- // Options were updated - re-create psbt qr screen
955+ // Options were updated - re-create bcur qr screen
958956 display_processing_message_activity ();
959- act = create_display_bcur_qr_activity (
960- message , message_size , bcur_type , cbor , cbor_len , qr_flags , help_url );
957+ act = create_display_bcur_qr_activity (message , message_size , bcur_type , cbor , cbor_len , qr_flags );
961958 }
962- } else if (ev_id == BTN_QR_DISPLAY_HELP ) {
963- await_qr_help_activity (help_url );
959+ } else if (ev_id == BTN_QR_BRIGHTNESS ) {
960+ gui_next_qrcode_color ();
961+ gui_repaint (act -> root_node );
964962 } else if (ev_id == BTN_QR_DISPLAY_EXIT ) {
965963 // Done
966964 break ;
@@ -1001,7 +999,7 @@ static bool handle_qr_bytes(const uint8_t* bytes, const size_t bytes_len)
1001999 JADE_ASSERT (sig [written - 1 ] == '\0' );
10021000
10031001 const char * message [] = { "Scan QR" , "signature" };
1004- await_single_qr_activity (message , 2 , sig , written - 1 , NULL );
1002+ await_single_qr_activity (message , 2 , sig , written - 1 );
10051003 return true;
10061004 }
10071005
@@ -1380,23 +1378,20 @@ bool display_bcur_bytes_qr(
13801378 return true;
13811379}
13821380
1383- // Display screen with help url and qr code
1384- // Handles up to v6. codes - ie text up to 134 bytes
1385- // help_url is optional
13861381void await_single_qr_activity (
1387- const char * message [], const size_t message_size , const uint8_t * data , const size_t data_len , const char * help_url )
1382+ const char * message [], const size_t message_size , const uint8_t * data , const size_t data_len )
13881383{
13891384 JADE_ASSERT (message );
13901385 JADE_ASSERT (message_size );
13911386 JADE_ASSERT (data );
13921387 JADE_ASSERT (data_len );
1393- // help_url is optional
13941388
13951389 Icon * const qr_icon = JADE_MALLOC (sizeof (Icon ));
13961390 bytes_to_qr_icon (data , data_len , qr_icon );
13971391
13981392 // Show, and await button click - note gui takes ownership of icon
1399- gui_activity_t * const act = make_show_qr_activity (message , message_size , qr_icon , 1 , 0 , false, help_url );
1393+ const bool show_options_button = false;
1394+ gui_activity_t * const act = make_show_qr_activity (message , message_size , qr_icon , 1 , 0 , show_options_button );
14001395
14011396 while (true) {
14021397 gui_set_current_activity (act );
@@ -1405,8 +1400,9 @@ void await_single_qr_activity(
14051400 if (ev_id == BTN_QR_DISPLAY_EXIT ) {
14061401 // Done
14071402 break ;
1408- } else if (ev_id == BTN_QR_DISPLAY_HELP ) {
1409- await_qr_help_activity (help_url );
1403+ } else if (ev_id == BTN_QR_BRIGHTNESS ) {
1404+ gui_next_qrcode_color ();
1405+ gui_repaint (act -> root_node );
14101406 }
14111407 }
14121408}
0 commit comments