feat(engine): implement ShowLogs event
This commit is contained in:
parent
334e99b343
commit
c69544c1e2
|
@ -24,6 +24,7 @@ use log::error;
|
||||||
|
|
||||||
pub trait TextUIHandler {
|
pub trait TextUIHandler {
|
||||||
fn show_text(&self, title: &str, text: &str) -> Result<()>;
|
fn show_text(&self, title: &str, text: &str) -> Result<()>;
|
||||||
|
fn show_logs(&self) -> Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TextUIExecutor<'a> {
|
pub struct TextUIExecutor<'a> {
|
||||||
|
@ -46,6 +47,12 @@ impl<'a> Executor for TextUIExecutor<'a> {
|
||||||
error!("text UI handler reported an error: {:?}", error);
|
error!("text UI handler reported an error: {:?}", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if let EventType::ShowLogs = &event.etype {
|
||||||
|
if let Err(error) = self.handler.show_logs() {
|
||||||
|
error!("text UI handler reported an error: {:?}", error);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ pub enum EventType {
|
||||||
DisplaySecureInputTroubleshoot,
|
DisplaySecureInputTroubleshoot,
|
||||||
ShowSearchBar,
|
ShowSearchBar,
|
||||||
ShowText(ui::ShowTextEvent),
|
ShowText(ui::ShowTextEvent),
|
||||||
|
ShowLogs,
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
LaunchSecureInputAutoFix,
|
LaunchSecureInputAutoFix,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user