mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03: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
Notes:
sideshowbarker
2024-07-17 11:06:06 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/623ad4a42a Pull-request: https://github.com/SerenityOS/serenity/pull/14126
@ -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…
Reference in New Issue
Block a user