feat(engine): implement ShowLogs event
This commit is contained in:
parent
334e99b343
commit
c69544c1e2
|
@ -24,6 +24,7 @@ use log::error;
|
|||
|
||||
pub trait TextUIHandler {
|
||||
fn show_text(&self, title: &str, text: &str) -> Result<()>;
|
||||
fn show_logs(&self) -> Result<()>;
|
||||
}
|
||||
|
||||
pub struct TextUIExecutor<'a> {
|
||||
|
@ -46,6 +47,12 @@ impl<'a> Executor for TextUIExecutor<'a> {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ pub enum EventType {
|
|||
DisplaySecureInputTroubleshoot,
|
||||
ShowSearchBar,
|
||||
ShowText(ui::ShowTextEvent),
|
||||
ShowLogs,
|
||||
|
||||
// Other
|
||||
LaunchSecureInputAutoFix,
|
||||
|
|
Loading…
Reference in New Issue
Block a user