mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 17:57:35 +00:00
ProcessManager: Add a "stop" action that sends SIGSTOP to a process.
This commit is contained in:
parent
c09ab7cc40
commit
c5a32d139a
3 changed files with 9 additions and 0 deletions
|
@ -30,7 +30,15 @@ int main(int argc, char** argv)
|
||||||
if (pid != -1)
|
if (pid != -1)
|
||||||
kill(pid, SIGKILL);
|
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(kill_action.copy_ref());
|
||||||
|
toolbar->add_action(stop_action.copy_ref());
|
||||||
|
|
||||||
auto menubar = make<GMenuBar>();
|
auto menubar = make<GMenuBar>();
|
||||||
auto app_menu = make<GMenu>("ProcessManager");
|
auto app_menu = make<GMenu>("ProcessManager");
|
||||||
|
@ -42,6 +50,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto file_menu = make<GMenu>("Process");
|
auto file_menu = make<GMenu>("Process");
|
||||||
file_menu->add_action(kill_action.copy_ref());
|
file_menu->add_action(kill_action.copy_ref());
|
||||||
|
file_menu->add_action(stop_action.copy_ref());
|
||||||
menubar->add_menu(move(file_menu));
|
menubar->add_menu(move(file_menu));
|
||||||
|
|
||||||
auto help_menu = make<GMenu>("Help");
|
auto help_menu = make<GMenu>("Help");
|
||||||
|
|
BIN
Base/res/icons/stop16.png
Normal file
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
BIN
Base/res/icons/stop16.rgb
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue