Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
stsdc committed Jun 22, 2020
2 parents 5b11c95 + 73fea9e commit f25b3eb
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
builddir
.atom-dbg.cson
.vscode
*~
Expand Down
8 changes: 3 additions & 5 deletions data/com.github.stsdc.monitor.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@
<url type="help">https://github.com/stsdc/monitor/issues</url>

<releases>
<release version="0.7.0" date="2020-04-15">
<release version="0.7.3" date="2020-06-22">
​ <description>
​ <ul>
<li>Detailed process info in sidebar</li>
<li>CPU frequency in tooltip (Ryo Nakano)</li>
<li>Removed tree view . This fixes high CPU usage, indicator hangs, and app crashes</li>
<li>Special thanks to gavr, Ryo Nakano, Adam Bieńkowski and Daniele Cocca</li>
<li>Small bugfix</li>
<li>Added tooltips (Ryo Nakano)</li>
</ul>
​ </description>
​ </release>
Expand Down
11 changes: 10 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
com.github.stsdc.monitor (0.7.3) bionic; urgency=low

* Added tooltips to process state label (Ryo Nakano)
* Small bugfix

-- Stanisław Dac <[email protected]> Mon, 22 Jun 2020 20:21:37 +0200

com.github.stsdc.monitor (0.7.2) bionic; urgency=low

* Fix sorting arrows
* Update Russian translation (camellan)
* Add Turkish translation (Harun Yasar)
* Use newest version of live-chart (Laurent Callarec) ← Check his lib for creating charts, it's amazing!

com.github.stsdc.monitor (0.7.1) bionic; urgency=low
-- Stanisław Dac <[email protected]> Sat, 11 Apr 2020 21:01:15 +0200

com.github.stsdc.monitor (0.7.0) bionic; urgency=low

* Detailed process info in sidebar
* CPU frequency in tooltip (Ryo Nakano)
Expand Down
3 changes: 1 addition & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

project('com.github.stsdc.monitor', 'vala', 'c', version: '0.7.2')
project('com.github.stsdc.monitor', 'vala', 'c', version: '0.7.3')

# these are Meson modules
gnome = import('gnome')
Expand Down
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
4 changes: 3 additions & 1 deletion src/Managers/ProcessUtils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class Monitor.ProcessUtils {
return false;
}

public static string sanitize_commandline (string commandline) {
public static string sanitize_commandline (string? commandline) {
if (commandline == null) return Path.get_basename ("");

// splitting command; might include many options
var splitted_commandline = commandline.split (" ");

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 "";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public class Monitor.CPUProcessTreeView : Gtk.TreeView {
tree_model.get (iter, Column.PID, out pid);
Process process = model.process_manager.get_process (pid);
process_selected (process);
debug ("cursor changed");
// debug ("cursor changed");
}
}
}
4 changes: 4 additions & 0 deletions src/Widgets/Headerbar/Search.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ namespace Monitor {
int pid_haystack;
bool found = false;
var needle = this.text;

// should help with assertation errors, donno
// if (needle == null) return true;

if ( needle.length == 0 ) {
return true;
}
Expand Down

0 comments on commit f25b3eb

Please sign in to comment.