mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 05:48:12 +00:00
SystemMonitor: Use icon for 'Profile' action
This commit is contained in:
parent
45632986a4
commit
b1f7632610
1 changed files with 11 additions and 10 deletions
|
@ -208,17 +208,18 @@ int main(int argc, char** argv)
|
||||||
kill(pid, SIGCONT);
|
kill(pid, SIGCONT);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto profile_action = GUI::Action::create("Profile process", { Mod_Ctrl, Key_P }, [&process_table_view](auto&) {
|
auto profile_action = GUI::Action::create("Profile process", { Mod_Ctrl, Key_P },
|
||||||
pid_t pid = process_table_view.selected_pid();
|
Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"), [&process_table_view](auto&) {
|
||||||
if (pid != -1) {
|
pid_t pid = process_table_view.selected_pid();
|
||||||
auto pid_string = String::format("%d", pid);
|
if (pid != -1) {
|
||||||
pid_t child;
|
auto pid_string = String::format("%d", pid);
|
||||||
const char* argv[] = { "/bin/Profiler", "--pid", pid_string.characters(), nullptr };
|
pid_t child;
|
||||||
if ((errno = posix_spawn(&child, "/bin/Profiler", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
const char* argv[] = { "/bin/Profiler", "--pid", pid_string.characters(), nullptr };
|
||||||
perror("posix_spawn");
|
if ((errno = posix_spawn(&child, "/bin/Profiler", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||||
|
perror("posix_spawn");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
auto menubar = GUI::MenuBar::construct();
|
auto menubar = GUI::MenuBar::construct();
|
||||||
auto& app_menu = menubar->add_menu("System Monitor");
|
auto& app_menu = menubar->add_menu("System Monitor");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue