add a screen to indicate when databases are reloading

since the operation can take quite a while
This commit is contained in:
bunnie 2023-06-06 19:31:26 +08:00
parent 567d9db2cd
commit 6bb5569c9f
3 changed files with 10 additions and 1 deletions

View file

@ -447,6 +447,13 @@
"ja": "USB機能を切り替え中...",
"zh": "切换 USB 功能..."
},
"vault.reloading_database": {
"en": "Reloading database...",
"en-tts": "Reloading database...",
"fr": "Rechargement de la base de données...*MT*",
"ja": "データベースをリロードしています...",
"zh": "正在重新加载数据库..."
},
"vault.select_font": {
"en": "Select a font style",
"en-tts": "Select a font style",

View file

@ -872,6 +872,7 @@ impl<'a> ActionManager<'a> {
/// - `format!()` is very slow, so we use `push_str()` where possible
/// - allocations are slow, so we try to avoid them at all costs
pub(crate) fn retrieve_db(&mut self) {
self.modals.dynamic_notification(Some(t!("vault.reloading_database", xous::LANG)), None).ok();
#[cfg(feature="vaultperf")]
self.pm.stop_and_reset();
#[cfg(feature="vaultperf")]
@ -1153,6 +1154,7 @@ impl<'a> ActionManager<'a> {
}
self.item_lists.lock().unwrap().filter_reset(self.mode_cache);
log::debug!("heap usage B: {}", heap_usage());
self.modals.dynamic_notification_close().ok();
#[cfg(feature="vaultperf")]
{
self.perfentry(&self.pm, PERFMETA_ENDBLOCK, 0, std::line!());

View file

@ -113,7 +113,7 @@ const ERR_TIMEOUT_MS: usize = 5000;
fn main() -> ! {
log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Debug);
log::set_max_level(log::LevelFilter::Info);
log::info!("my PID is {}", xous::process::id());
let xns = xous_names::XousNames::new().unwrap();