Skip to content

Commit b4fcc0f

Browse files
Lbqdsyogh333
authored andcommitted
Add a new function to support an array of validation messages
1 parent e0a815e commit b4fcc0f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ledger_device_sdk/src/ui/gadgets.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,26 @@ fn concatenate(strings: &[&str], output: &mut [u8]) {
852852

853853
impl<'a> MultiFieldReview<'a> {
854854
pub fn new(
855+
fields: &'a [Field<'a>],
856+
review_message: &'a [&'a str],
857+
review_glyph: Option<&'a Glyph<'a>>,
858+
validation_message: &'a str,
859+
validation_glyph: Option<&'a Glyph<'a>>,
860+
cancel_message: &'a str,
861+
cancel_glyph: Option<&'a Glyph<'a>>,
862+
) -> Self {
863+
Self::new_with_validation_messages(
864+
fields,
865+
review_message,
866+
review_glyph,
867+
[validation_message, ""],
868+
validation_glyph,
869+
cancel_message,
870+
cancel_glyph,
871+
)
872+
}
873+
874+
pub fn new_with_validation_messages(
855875
fields: &'a [Field<'a>],
856876
review_message: &'a [&'a str],
857877
review_glyph: Option<&'a Glyph<'a>>,

0 commit comments

Comments
 (0)