Skip to content

Commit

Permalink
refactor: mostly add back tree mode for process
Browse files Browse the repository at this point in the history
Mouse control on collapse is not working yet, need to do some work
internally first.
  • Loading branch information
ClementTsang committed Nov 21, 2021
1 parent 5833cb8 commit cc66f1f
Show file tree
Hide file tree
Showing 26 changed files with 788 additions and 1,038 deletions.
48 changes: 35 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ doc = false
[profile.release]
debug = 0
lto = true
# debug = true
# lto = false
opt-level = 3
codegen-units = 1

Expand All @@ -36,7 +34,7 @@ default = ["fern", "log", "battery"]
[dependencies]
anyhow = "1.0.40"
backtrace = "0.3.59"
crossterm = "0.20.0"
crossterm = "0.22.1"
ctrlc = { version = "3.1.9", features = ["termination"] }
clap = "2.33"
cfg-if = "1.0"
Expand All @@ -45,12 +43,12 @@ enum_dispatch = "0.3.7"
float-ord = "0.3.2"
futures = "0.3.14"
futures-timer = "3.0.2"
fxhash = "0.2.1"
indexmap = "1.6.2"
indextree = "4.3.1"
itertools = "0.10.0"
once_cell = "1.5.2"
regex = "1.5.4"
rustc-hash = "1.1.0"
serde = { version = "1.0.125", features = ["derive"] }
# Sysinfo is still used in Linux for the ProcessStatus
sysinfo = "0.18.2"
Expand Down
2 changes: 0 additions & 2 deletions docs/content/configuration/command-line-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ The following flags can be provided to bottom in the command line to change the
| `-C, --config <CONFIG PATH>` | Sets the location of the config file. |
| `-u, --current_usage` | Sets process CPU% to be based on current CPU%. |
| `-t, --default_time_value <MS>` | Default time value for graphs in ms. |
| `--default_widget_count <INT>` | Sets the n'th selected widget type as the default. |
| `--default_widget_type <WIDGET TYPE>` | Sets the default widget type, use --help for more info. |
| `--disable_advanced_kill` | Hides advanced options to stop a process on Unix-like systems. |
| `--disable_click` | Disables mouse clicks. |
| `-m, --dot_marker` | Uses a dot marker for graphs. |
Expand Down
3 changes: 0 additions & 3 deletions sample_configs/default_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
#time_delta = 15000
# Hides the time scale.
#hide_time = false
# Override layout default widget
#default_widget_type = "proc"
#default_widget_count = 1
# Use basic mode
#basic = false
# Use the old network legend style
Expand Down
2 changes: 0 additions & 2 deletions sample_configs/demo_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ group_processes = false
case_sensitive = false
whole_word = false
regex = true
default_widget_type = "cpu"
default_widget_count = 1
12 changes: 6 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub mod widgets;
use std::time::Instant;

use crossterm::event::{KeyCode, KeyEvent, KeyModifiers, MouseEvent};
use fxhash::FxHashMap;
use indextree::{Arena, NodeId};
use rustc_hash::FxHashMap;

pub use data_farmer::*;
use data_harvester::temperature;
Expand Down Expand Up @@ -474,7 +474,7 @@ impl AppState {
}

#[cfg(target_family = "unix")]
pub fn on_number(&mut self, number_char: char) {
fn on_number(&mut self, number_char: char) {
if self.delete_dialog_state.is_showing_dd {
if self
.delete_dialog_state
Expand Down Expand Up @@ -507,7 +507,7 @@ impl AppState {
}
}

pub fn on_left_key(&mut self) {
fn on_left_key(&mut self) {
// if !self.is_in_dialog() {
// match self.current_widget.widget_type {
// BottomWidgetType::ProcSearch => {
Expand Down Expand Up @@ -566,7 +566,7 @@ impl AppState {
// }
}

pub fn on_right_key(&mut self) {
fn on_right_key(&mut self) {
// if !self.is_in_dialog() {
// match self.current_widget.widget_type {
// BottomWidgetType::ProcSearch => {
Expand Down Expand Up @@ -626,7 +626,7 @@ impl AppState {
// }
}

pub fn start_killing_process(&mut self) {
fn start_killing_process(&mut self) {
todo!()

// if let Some(proc_widget_state) = self
Expand Down Expand Up @@ -666,7 +666,7 @@ impl AppState {
// }
}

pub fn kill_highlighted_process(&mut self) -> Result<()> {
fn kill_highlighted_process(&mut self) -> Result<()> {
// if let BottomWidgetType::Proc = self.current_widget.widget_type {
// if let Some(current_selected_processes) = &self.to_delete_process_list {
// #[cfg(target_family = "unix")]
Expand Down
Loading

0 comments on commit cc66f1f

Please sign in to comment.