Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:stsdc/monitor into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
stsdc committed Jun 22, 2020
2 parents 1b1350b + 3627476 commit dd75d66
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/Managers/ProcessStructs.vala
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ public struct Monitor.ProcessStatus {
// swapped out.
public string comm;

// Should contain one of the following value:
// D uninterruptible sleep (usually IO)
// I Idle kernel thread
// R running or runnable (on run queue)
// S interruptible sleep (waiting for an event to complete)
// T stopped by job control signal
// t stopped by debugger during the tracing
// W paging (not valid since the 2.6.xx kernel)
// X dead (should never be seen)
// Z defunct ("zombie") process, terminated but not reaped by its parent
public string state;

// The PID of the parent of this process.
Expand Down
24 changes: 22 additions & 2 deletions src/Views/ProcessView/ProcessInfoView/ProcessInfoHeader.vala
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ public class Monitor.ProcessInfoHeader : Gtk.Grid {
username.val.get_style_context ().add_class ("username-root");
username.val.get_style_context ().remove_class ("username-other");
username.val.get_style_context ().remove_class ("username-current");


} else if (process.uid == (int)Posix.getuid ()) {
username.val.get_style_context ().add_class ("username-current");
username.val.get_style_context ().remove_class ("username-other");
Expand All @@ -85,6 +83,7 @@ public class Monitor.ProcessInfoHeader : Gtk.Grid {
username.set_text (process.username);
num_threads.set_text (process.stat.num_threads.to_string());
state.set_text (process.stat.state);
state.tooltip_text = set_state_tooltip ();
num_threads.set_text (process.stat.num_threads.to_string());
set_icon (process);
}
Expand All @@ -104,4 +103,25 @@ public class Monitor.ProcessInfoHeader : Gtk.Grid {
}
}
}

private string set_state_tooltip () {
switch (state.label) {
case "D":
return _("The app is waiting in an uninterruptible disk sleep");
case "I":
return _("Idle kernel thread");
case "R":
return _("The process is running or runnable (on run queue)");
case "S":
return _("The process is in an interruptible sleep; waiting for an event to complete");
case "T":
return _("The process is stopped by a job control signal");
case "t":
return _("The process is stopped stopped by a debugger during the tracing");
case "Z":
return _("The app is terminated but not reaped by its parent");
default:
return "";
}
}
}

0 comments on commit dd75d66

Please sign in to comment.