diff --git a/deja_vu/config/config.json5 b/deja_vu/config/config.json5 index c2cc437..94e8666 100644 --- a/deja_vu/config/config.json5 +++ b/deja_vu/config/config.json5 @@ -89,30 +89,35 @@ }, // Diagnostic modes "DiagMenu": { + "": "Process", "": "Quit", // Quit the application "": "Quit", // Another way to quit "": "Quit", // Yet another way to quit "": "Suspend" // Suspend the application }, "BootDiags": { + "": "Process", "": "Quit", // Quit the application "": "Quit", // Another way to quit "": "Quit", // Yet another way to quit "": "Suspend" // Suspend the application }, "BootSetup": { + "": "Process", "": "Quit", // Quit the application "": "Quit", // Another way to quit "": "Quit", // Yet another way to quit "": "Suspend" // Suspend the application }, "InjectDrivers": { + "": "Process", "": "Quit", // Quit the application "": "Quit", // Another way to quit "": "Quit", // Yet another way to quit "": "Suspend" // Suspend the application }, "ToggleSafeBoot": { + "": "Process", "": "Quit", // Quit the application "": "Quit", // Another way to quit "": "Quit", // Yet another way to quit diff --git a/deja_vu/src/app.rs b/deja_vu/src/app.rs index dc1eec7..04021f8 100644 --- a/deja_vu/src/app.rs +++ b/deja_vu/src/app.rs @@ -105,7 +105,7 @@ impl App { action_rx, action_tx, components: vec![ - Box::new(Title::new()), + Box::new(Title::new(cli_cmd)), Box::new(FpsCounter::new()), Box::new(Left::new()), Box::new(Right::new()), @@ -158,14 +158,11 @@ impl App { (_, Mode::Failed) => Mode::Failed, // Diagnostic states - ( - _, - Mode::DiagMenu - | Mode::BootDiags - | Mode::BootSetup - | Mode::InjectDrivers - | Mode::ToggleSafeBoot, - ) => Mode::DiagMenu, + (_, Mode::DiagMenu) => Mode::BootDiags, + (_, Mode::BootDiags) => Mode::BootSetup, + (_, Mode::BootSetup) => Mode::InjectDrivers, + (_, Mode::InjectDrivers) => Mode::ToggleSafeBoot, + (_, Mode::ToggleSafeBoot) => Mode::Done, // Invalid states (_, Mode::Confirm) => panic!("This shouldn't happen."), @@ -318,10 +315,7 @@ impl App { action_tx.send(Action::SetMode(Mode::ScanDisks))?; } cli::Command::Diagnose => { - action_tx.send(Action::DisplayPopup( - popup::Type::Info, - String::from("Boot Diagnostics?"), - ))?; + action_tx.send(Action::SetMode(Mode::DiagMenu))?; } } diff --git a/deja_vu/src/components/left.rs b/deja_vu/src/components/left.rs index 7b18095..4a9bbf7 100644 --- a/deja_vu/src/components/left.rs +++ b/deja_vu/src/components/left.rs @@ -163,6 +163,15 @@ impl Component for Left { } } } + Mode::DiagMenu + | Mode::BootDiags + | Mode::BootSetup + | Mode::InjectDrivers + | Mode::ToggleSafeBoot => { + if let Some(command_tx) = self.command_tx.clone() { + command_tx.send(Action::NextScreen)?; + } + } _ => {} }, Action::Select(Some(index), None) => self.selections[0] = Some(index), @@ -219,14 +228,11 @@ impl Component for Left { } (_, Mode::Done | Mode::Failed) => self.title_text = String::from("Done"), // Diagnostic states - ( - _, - Mode::DiagMenu - | Mode::BootDiags - | Mode::BootSetup - | Mode::InjectDrivers - | Mode::ToggleSafeBoot, - ) => self.title_text = String::from("Boot Diagnostics"), + (_, Mode::DiagMenu) => self.title_text = String::from("Main Menu"), + (_, Mode::BootDiags) => self.title_text = String::from("Boot Diagnostics"), + (_, Mode::BootSetup) => self.title_text = String::from("Boot Setup"), + (_, Mode::InjectDrivers) => self.title_text = String::from("Inject Drivers"), + (_, Mode::ToggleSafeBoot) => self.title_text = String::from("Toggle Safe Mode"), // Invalid states (_, Mode::Confirm) => panic!("This shouldn't happen."), @@ -280,10 +286,18 @@ impl Component for Left { // Body match self.mode { + // Clone modes Mode::ScanDisks | Mode::PreClone | Mode::Clone | Mode::PostClone + // Diagnostic modes + | Mode::DiagMenu + | Mode::BootDiags + | Mode::BootSetup + | Mode::InjectDrivers + | Mode::ToggleSafeBoot + // Done | Mode::Done | Mode::Failed => { // Leave blank @@ -391,14 +405,6 @@ impl Component for Left { _ => panic!("This shouldn't happen."), } } - Mode::DiagMenu - | Mode::BootDiags - | Mode::BootSetup - | Mode::InjectDrivers - | Mode::ToggleSafeBoot => { - // Diagnostic modes - return Ok(()); - } } // Done