WIP: IRL WinPE testing

This commit is contained in:
2Shirt 2025-02-09 22:31:36 -08:00
parent 1c9ed12d49
commit 1fab68500b
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
3 changed files with 33 additions and 0 deletions

View file

@ -146,6 +146,8 @@
"<Up>": "KeyUp", "<Up>": "KeyUp",
"<Down>": "KeyDown", "<Down>": "KeyDown",
"<q>": "Quit", "<q>": "Quit",
"<r>": "Restart",
"<p>": "Shutdown",
"<t>": "OpenTerminal", "<t>": "OpenTerminal",
"<Ctrl-d>": "Quit", "<Ctrl-d>": "Quit",
"<Ctrl-c>": "Quit", "<Ctrl-c>": "Quit",

View file

@ -39,6 +39,8 @@ pub enum Action {
UpdateRight(Vec<Vec<DVLine>>, usize, Vec<Vec<DVLine>>), // (labels, start_index, items) - items before start are always shown UpdateRight(Vec<Vec<DVLine>>, usize, Vec<Vec<DVLine>>), // (labels, start_index, items) - items before start are always shown
// App (PE-Menu) // App (PE-Menu)
OpenTerminal, OpenTerminal,
Restart,
Shutdown,
// Screens // Screens
DismissPopup, DismissPopup,
DisplayPopup(Type, String), DisplayPopup(Type, String),

View file

@ -249,6 +249,35 @@ impl App {
vec![String::from("-new_console:n")], vec![String::from("-new_console:n")],
)); ));
} }
Action::Restart => {
self.action_tx.send(Action::DisplayPopup(
popup::Type::Info,
String::from("Restarting..."),
))?;
self.tasks.add(Task::Command(
PathBuf::from("X:/Windows/System32/sync64.exe"),
vec![String::from("-r")],
));
self.tasks.add(Task::Command(
PathBuf::from("X:/Windows/System32/wpeutil.exe"),
vec![String::from("reboot")],
));
}
Action::Shutdown => {
// NOTE: Using 'Powering off' to match the key pressed
self.action_tx.send(Action::DisplayPopup(
popup::Type::Info,
String::from("Powering off..."),
))?;
self.tasks.add(Task::Command(
PathBuf::from("X:/Windows/System32/sync64.exe"),
vec![String::from("-r")],
));
self.tasks.add(Task::Command(
PathBuf::from("X:/Windows/System32/wpeutil.exe"),
vec![String::from("shutdown")],
));
}
_ => {} _ => {}
} }
for component in &mut self.components { for component in &mut self.components {