diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 12:06:19 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-02-28 12:06:19 +0100 |
commit | c5a32d139a4ec4c6b153daccac31066ff8e87d0e (patch) | |
tree | bb9016908c9fbe1a59dc03bb352d53fee719069f | |
parent | c09ab7cc40f4d9130d9253c550bb5bd820a14a59 (diff) | |
download | serenity-c5a32d139a4ec4c6b153daccac31066ff8e87d0e.zip |
ProcessManager: Add a "stop" action that sends SIGSTOP to a process.
-rw-r--r-- | Applications/ProcessManager/main.cpp | 9 | ||||
-rw-r--r-- | Base/res/icons/stop16.png | bin | 0 -> 275 bytes | |||
-rw-r--r-- | Base/res/icons/stop16.rgb | bin | 0 -> 1024 bytes |
3 files changed, 9 insertions, 0 deletions
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<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"); diff --git a/Base/res/icons/stop16.png b/Base/res/icons/stop16.png Binary files differnew file mode 100644 index 0000000000..c86551a7f7 --- /dev/null +++ b/Base/res/icons/stop16.png diff --git a/Base/res/icons/stop16.rgb b/Base/res/icons/stop16.rgb Binary files differnew file mode 100644 index 0000000000..256159e86b --- /dev/null +++ b/Base/res/icons/stop16.rgb |