This commit is contained in:
bunnie 2022-12-29 00:11:03 +08:00
parent 5370c333da
commit 2f30e1b50a
2 changed files with 37 additions and 0 deletions

View file

@ -6,6 +6,13 @@
"ja": "Shellchat",
"zh": "外壳聊天"
},
"secnote.basis": {
"en": "Basis: ",
"en-tts": "Basis: ",
"fr": "La base: ",
"ja": "基底: ",
"zh": "基: "
},
"backup.confirm": {
"en": "Prepare for PDDB and root key backup?\n\nThe process cannot be aborted once started.",
"en-tts": "Prepare for PDDB and root key backup?\n\nThe process cannot be aborted once started.",

View file

@ -766,6 +766,36 @@ fn wrapped_main() -> ! {
}
});
// this thread handles updating the PDDB basis list
thread::spawn({
let sec_notes = sec_notes.clone();
move || {
let pddb = pddb::Pddb::new();
loop {
// this blocks until there is a change in the basis list
let mut basis_list_vec = pddb.monitor_basis();
// the key may or may not be there, but remove it in case it is
sec_notes.lock().unwrap().remove(&"secnote.basis".to_string());
// only if there are more bases open than just the .System basis, insert a new key
if basis_list_vec.len() > 1 {
let mut new_list_str = t!("secnote.basis", xous::LANG).to_string();
// initially, just concatenate all the basis names...
basis_list_vec.reverse(); // reverse the order so the highest priority basis is on the left.
for basis in basis_list_vec {
new_list_str.push_str(&basis);
if basis != pddb::PDDB_DEFAULT_SYSTEM_BASIS {
new_list_str.push_str(" > ");
}
}
sec_notes.lock().unwrap().insert("secnote.basis".to_string(), new_list_str);
}
}
}
});
// storage for wifi bars
let mut wifi_bars: [PixelColor; 5] = [PixelColor::Light, PixelColor::Light, PixelColor::Light, PixelColor::Light, PixelColor::Light];