1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

SystemMonitor: Display processes and their threads in a tree :^)

This shows all non-main threads as children of the process they belong
to. We also show the TID as that is important to distinguish the
different threads in one process.

Fixes #65

:skeleyak:
This commit is contained in:
kleines Filmröllchen 2022-04-05 00:32:37 +02:00 committed by Andreas Kling
parent cd5ed44f64
commit 0a61b45b64
4 changed files with 265 additions and 54 deletions

View file

@ -7,8 +7,6 @@
*/
#include "GraphWidget.h"
#include "LibCore/EventLoop.h"
#include "LibCore/Object.h"
#include "MemoryStatsWidget.h"
#include "NetworkStatisticsWidget.h"
#include "ProcessFileDescriptorMapWidget.h"
@ -22,6 +20,8 @@
#include <Applications/SystemMonitor/SystemMonitorGML.h>
#include <LibConfig/Client.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/Object.h>
#include <LibCore/System.h>
#include <LibCore/Timer.h>
#include <LibGUI/Action.h>
@ -43,7 +43,7 @@
#include <LibGUI/StackWidget.h>
#include <LibGUI/Statusbar.h>
#include <LibGUI/TabWidget.h>
#include <LibGUI/TableView.h>
#include <LibGUI/TreeView.h>
#include <LibGUI/Widget.h>
#include <LibGUI/Window.h>
#include <LibGfx/FontDatabase.h>
@ -385,12 +385,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto& performance_widget = *tabwidget.find_descendant_of_type_named<GUI::Widget>("performance");
build_performance_tab(performance_widget);
auto& process_table_view = *process_table_container.find_child_of_type_named<GUI::TableView>("process_table");
auto& process_table_view = *process_table_container.find_child_of_type_named<GUI::TreeView>("process_table");
process_table_view.set_model(TRY(GUI::SortingProxyModel::create(process_model)));
for (auto column = 0; column < ProcessModel::Column::__Count; ++column)
process_table_view.set_column_visible(column, false);
process_table_view.set_column_visible(ProcessModel::Column::Icon, true);
process_table_view.set_column_visible(ProcessModel::Column::PID, true);
process_table_view.set_column_visible(ProcessModel::Column::TID, true);
process_table_view.set_column_visible(ProcessModel::Column::Name, true);
process_table_view.set_column_visible(ProcessModel::Column::CPU, true);
process_table_view.set_column_visible(ProcessModel::Column::User, true);