[skip travis] Add check to prevent improper dd while on another panel
This commit is contained in:
parent
11a6d25d4a
commit
7208908413
20
src/app.rs
20
src/app.rs
|
@ -116,13 +116,15 @@ impl App {
|
|||
|
||||
match caught_char {
|
||||
'd' => {
|
||||
if self.awaiting_second_char && self.second_char == 'd' {
|
||||
self.awaiting_second_char = false;
|
||||
self.second_char = ' ';
|
||||
self.kill_highlighted_process().unwrap_or(()); // TODO: Return error to user? We have a dialog box...
|
||||
} else {
|
||||
self.awaiting_second_char = true;
|
||||
self.second_char = 'd';
|
||||
if let ApplicationPosition::Process = self.current_application_position {
|
||||
if self.awaiting_second_char && self.second_char == 'd' {
|
||||
self.awaiting_second_char = false;
|
||||
self.second_char = ' ';
|
||||
self.kill_highlighted_process().unwrap_or(()); // TODO: Return error to user? We have a dialog box...
|
||||
} else {
|
||||
self.awaiting_second_char = true;
|
||||
self.second_char = 'd';
|
||||
}
|
||||
}
|
||||
}
|
||||
'g' => {
|
||||
|
@ -278,7 +280,7 @@ impl App {
|
|||
ApplicationPosition::Process => self.change_process_position(-1),
|
||||
ApplicationPosition::Temp => self.change_temp_position(-1),
|
||||
ApplicationPosition::Disk => self.change_disk_position(-1),
|
||||
ApplicationPosition::Cpu => self.change_cpu_table_position(-1), // TODO: Temporary
|
||||
ApplicationPosition::Cpu => self.change_cpu_table_position(-1), // TODO: Temporary, may change if we add scaling
|
||||
_ => {}
|
||||
}
|
||||
self.scroll_direction = ScrollDirection::UP;
|
||||
|
@ -290,7 +292,7 @@ impl App {
|
|||
ApplicationPosition::Process => self.change_process_position(1),
|
||||
ApplicationPosition::Temp => self.change_temp_position(1),
|
||||
ApplicationPosition::Disk => self.change_disk_position(1),
|
||||
ApplicationPosition::Cpu => self.change_cpu_table_position(1), // TODO: Temporary
|
||||
ApplicationPosition::Cpu => self.change_cpu_table_position(1), // TODO: Temporary, may change if we add scaling
|
||||
_ => {}
|
||||
}
|
||||
self.scroll_direction = ScrollDirection::DOWN;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// This file is meant to house (OS specific) implementations on how to kill processes.
|
||||
use std::process::Command;
|
||||
|
||||
// TODO: Redo this, also make it update process list on freeze.
|
||||
// TODO: Make it update process list on freeze.
|
||||
|
||||
// Copied from SO: https://stackoverflow.com/a/55231715
|
||||
#[cfg(target_os = "windows")]
|
||||
|
|
Loading…
Reference in New Issue