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

ProcessManager: Add CPU/memory usage graphs in a separate tab.

Finally we get some real use for the new GTabWidget. :^)
This commit is contained in:
Andreas Kling 2019-05-06 03:21:23 +02:00
parent 6df3df62be
commit 25bb7a59ac
10 changed files with 140 additions and 19 deletions

View file

@ -6,6 +6,8 @@
#include <LibGUI/GModel.h>
#include <unistd.h>
class GraphWidget;
class ProcessModel final : public GModel {
public:
enum Column {
@ -22,7 +24,7 @@ public:
__Count
};
static Retained<ProcessModel> create() { return adopt(*new ProcessModel); }
static Retained<ProcessModel> create(GraphWidget& graph) { return adopt(*new ProcessModel(graph)); }
virtual ~ProcessModel() override;
virtual int row_count(const GModelIndex&) const override;
@ -33,7 +35,9 @@ public:
virtual void update() override;
private:
ProcessModel();
explicit ProcessModel(GraphWidget&);
GraphWidget& m_graph;
struct ProcessState {
pid_t pid;