mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
Applets/ResourceGraph: Open network monitor when clicking network graph
(Previously, it would open the performance monitor tab)
This commit is contained in:
parent
39682d4fbc
commit
623ad4a42a
1 changed files with 2 additions and 8 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Frame.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Process.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibMain/Main.h>
|
||||
|
@ -141,14 +142,7 @@ private:
|
|||
{
|
||||
if (event.button() != GUI::MouseButton::Primary)
|
||||
return;
|
||||
pid_t child_pid;
|
||||
char const* argv[] = { "SystemMonitor", "-t", "graphs", nullptr };
|
||||
if ((errno = posix_spawn(&child_pid, "/bin/SystemMonitor", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(child_pid) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
GUI::Process::spawn_or_show_error(window(), "/bin/SystemMonitor", Array { "-t", m_graph_type == GraphType::Network ? "network" : "graphs" });
|
||||
}
|
||||
|
||||
bool get_cpu_usage(u64& total, u64& idle)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue