resolve issue #202 add a bail option to the BIP39 dialog

This commit is contained in:
bunnie 2022-07-07 00:46:58 +08:00
parent d1c3ebce97
commit 6fc83d363b
2 changed files with 18 additions and 4 deletions

View file

@ -66,10 +66,16 @@
"en-tts": "Start typing..."
},
"bip39.invalid_phrase": {
"en": "Phrase is not valid",
"ja": "フレーズが無効です",
"zh": "短语无效",
"en-tts": "Phrase is not valid"
"en": "\tPhrase is not valid",
"ja": "\tフレーズが無効です",
"zh": "\t短语无效",
"en-tts": "\tPhrase is not valid"
},
"bip39.abort_help": {
"en": "Press F4 to abort entry",
"ja": "F4を押して入力を中止します",
"zh": "按 F4 中止输入",
"en-tts": "Press F4 to abort entry"
},
"bip39.valid_phrase": {
"en": "Valid input:",

View file

@ -280,6 +280,8 @@ impl ActionApi for Bip39Entry {
status.push_str(t!("bip39.waiting", xous::LANG));
} else {
status.push_str(t!("bip39.invalid_phrase", xous::LANG));
status.push_str("\n");
status.push_str(t!("bip39.abort_help", xous::LANG));
}
}
let mut tv = TextView::new(
@ -342,6 +344,12 @@ impl ActionApi for Bip39Entry {
'\u{0}' => {
// ignore null messages
}
'\u{14}' => { // F4
let ret = Bip39EntryPayload::default(); // return a 0-length entry
let buf = Buffer::into_buf(ret).expect("couldn't convert message to payload");
buf.send(self.action_conn, self.action_opcode).map(|_| ()).expect("couldn't send action message");
return (None, true)
}
'\u{8}' => { // backspace
#[cfg(feature="tts")]
{