WIP: IRL WinPE testing
This commit is contained in:
parent
1c9ed12d49
commit
1fab68500b
3 changed files with 33 additions and 0 deletions
|
|
@ -146,6 +146,8 @@
|
|||
"<Up>": "KeyUp",
|
||||
"<Down>": "KeyDown",
|
||||
"<q>": "Quit",
|
||||
"<r>": "Restart",
|
||||
"<p>": "Shutdown",
|
||||
"<t>": "OpenTerminal",
|
||||
"<Ctrl-d>": "Quit",
|
||||
"<Ctrl-c>": "Quit",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
// App (PE-Menu)
|
||||
OpenTerminal,
|
||||
Restart,
|
||||
Shutdown,
|
||||
// Screens
|
||||
DismissPopup,
|
||||
DisplayPopup(Type, String),
|
||||
|
|
|
|||
|
|
@ -249,6 +249,35 @@ impl App {
|
|||
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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue