From c5a32d139a4ec4c6b153daccac31066ff8e87d0e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 28 Feb 2019 12:06:19 +0100 Subject: [PATCH] ProcessManager: Add a "stop" action that sends SIGSTOP to a process. --- Applications/ProcessManager/main.cpp | 9 +++++++++ Base/res/icons/stop16.png | Bin 0 -> 275 bytes Base/res/icons/stop16.rgb | Bin 0 -> 1024 bytes 3 files changed, 9 insertions(+) create mode 100644 Base/res/icons/stop16.png create mode 100644 Base/res/icons/stop16.rgb diff --git a/Applications/ProcessManager/main.cpp b/Applications/ProcessManager/main.cpp index 388e679513..46183ccad8 100644 --- a/Applications/ProcessManager/main.cpp +++ b/Applications/ProcessManager/main.cpp @@ -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(); auto app_menu = make("ProcessManager"); @@ -42,6 +50,7 @@ int main(int argc, char** argv) auto file_menu = make("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("Help"); diff --git a/Base/res/icons/stop16.png b/Base/res/icons/stop16.png new file mode 100644 index 0000000000000000000000000000000000000000..c86551a7f78fb66dc4c7da81f883afa588ed5249 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7*pj^6T^LR>Y-iY-7BkP8 zfq{Xuz$3Dlfk96hgc&QA+LtjfFtC?+`ns||W|HA%6;=4s-on7ZAX(xXQR1ARo127$+xvE zyeWr7f1O~M@2FDAINQi}b-~WTh?}2HoDsT(J^=;jL5~d$S3P_4nq z!>6AZf8f+VciC}}eh|iGIY$QI)JK2W}|2Y033=dtN;K2 literal 0 HcmV?d00001