diff --git a/config/config.json5 b/config/config.json5 index 0d54fcf..986126d 100644 --- a/config/config.json5 +++ b/config/config.json5 @@ -100,6 +100,7 @@ "": "KeyUp", "": "KeyDown", "": "Quit", + "": "OpenTerminal", "": "Quit", "": "Quit", "": "Suspend" diff --git a/core/src/action.rs b/core/src/action.rs index 06c937a..604edd7 100644 --- a/core/src/action.rs +++ b/core/src/action.rs @@ -20,7 +20,7 @@ use crate::{components::popup::Type, line::DVLine, state::Mode, system::disk::Di #[derive(Debug, Clone, PartialEq, Eq, Display, Serialize, Deserialize)] pub enum Action { - // App + // App (Clone) Highlight(usize), InstallDriver, Process, @@ -35,6 +35,8 @@ pub enum Action { // 1: For a single choice // 2: For two selections (obviously) UpdateRight(Vec>, usize, Vec>), // (labels, start_index, items) - items before start are always shown + // App (PEMenu) + OpenTerminal, // Screens DismissPopup, DisplayPopup(Type, String), diff --git a/pe_menu/src/app.rs b/pe_menu/src/app.rs index 94fbc28..5f9c060 100644 --- a/pe_menu/src/app.rs +++ b/pe_menu/src/app.rs @@ -190,6 +190,8 @@ impl App { match action { Action::Tick => { self.last_tick_key_events.drain(..); + // Check background task(s) + self.tasks.poll()?; } Action::Quit => self.should_quit = true, Action::Suspend => self.should_suspend = true, @@ -241,11 +243,11 @@ impl App { self.action_tx.send(build_right_items(self))?; self.action_tx.send(Action::Select(None, None))?; } - Action::UpdateFooter(_) - | Action::UpdateLeft(_, _, _, _) - | Action::UpdateRight(_, _, _) - | Action::Highlight(_) => { - info!("Processing Action: {:?}", action); + Action::OpenTerminal => { + self.tasks.add(Task::Command( + PathBuf::from("cmd.exe"), + vec![String::from("-new_console:n")], + )); } _ => {} }