1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 00:15:08 +00:00

ProcessManager: Add ProcessTableView::on_process_selected() callback.

This will be useful for doing something in response to the user selecting
a different process.
This commit is contained in:
Andreas Kling 2019-07-27 09:37:26 +02:00
parent f1af5f26eb
commit c452528952
2 changed files with 7 additions and 0 deletions

View file

@ -9,6 +9,11 @@ ProcessTableView::ProcessTableView(GraphWidget& graph, GWidget* parent)
set_model(GSortingProxyModel::create(ProcessModel::create(graph)));
model()->set_key_column_and_sort_order(ProcessModel::Column::CPU, GSortOrder::Descending);
refresh();
on_selection = [this](auto&) {
if (on_process_selected)
on_process_selected(selected_pid());
};
}
ProcessTableView::~ProcessTableView()