summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-28 12:06:19 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-28 12:06:19 +0100
commitc5a32d139a4ec4c6b153daccac31066ff8e87d0e (patch)
treebb9016908c9fbe1a59dc03bb352d53fee719069f /Applications
parentc09ab7cc40f4d9130d9253c550bb5bd820a14a59 (diff)
downloadserenity-c5a32d139a4ec4c6b153daccac31066ff8e87d0e.zip
ProcessManager: Add a "stop" action that sends SIGSTOP to a process.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/ProcessManager/main.cpp9
1 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");