ProcessManager: Add a "stop" action that sends SIGSTOP to a process.

This commit is contained in:
Andreas Kling 2019-02-28 12:06:19 +01:00
parent c09ab7cc40
commit c5a32d139a
Notes: sideshowbarker 2024-07-19 15:35:56 +09:00
3 changed files with 9 additions and 0 deletions

View file

@ -30,7 +30,15 @@ int main(int argc, char** argv)
if (pid != -1)
kill(pid, SIGKILL);
});
auto stop_action = GAction::create("Stop process", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/stop16.rgb", { 16, 16 }), [process_table_view] (const GAction&) {
pid_t pid = process_table_view->selected_pid();
if (pid != -1)
kill(pid, SIGSTOP);
});
toolbar->add_action(kill_action.copy_ref());
toolbar->add_action(stop_action.copy_ref());
auto menubar = make<GMenuBar>();
auto app_menu = make<GMenu>("ProcessManager");
@ -42,6 +50,7 @@ int main(int argc, char** argv)
auto file_menu = make<GMenu>("Process");
file_menu->add_action(kill_action.copy_ref());
file_menu->add_action(stop_action.copy_ref());
menubar->add_menu(move(file_menu));
auto help_menu = make<GMenu>("Help");

BIN
Base/res/icons/stop16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
Base/res/icons/stop16.rgb Normal file

Binary file not shown.