From c69544c1e2a8842a09373034be22f5f4b59469a3 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Mon, 15 Nov 2021 22:31:26 +0100 Subject: [PATCH] feat(engine): implement ShowLogs event --- espanso-engine/src/dispatch/executor/text_ui.rs | 7 +++++++ espanso-engine/src/event/mod.rs | 1 + 2 files changed, 8 insertions(+) diff --git a/espanso-engine/src/dispatch/executor/text_ui.rs b/espanso-engine/src/dispatch/executor/text_ui.rs index 4e80900..e08ba86 100644 --- a/espanso-engine/src/dispatch/executor/text_ui.rs +++ b/espanso-engine/src/dispatch/executor/text_ui.rs @@ -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; } diff --git a/espanso-engine/src/event/mod.rs b/espanso-engine/src/event/mod.rs index 7e6551c..2100cba 100644 --- a/espanso-engine/src/event/mod.rs +++ b/espanso-engine/src/event/mod.rs @@ -102,6 +102,7 @@ pub enum EventType { DisplaySecureInputTroubleshoot, ShowSearchBar, ShowText(ui::ShowTextEvent), + ShowLogs, // Other LaunchSecureInputAutoFix,