mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 12:05:08 +00:00

This is accomplished by putting a GSortingProxyTableModel between the model and the view. It's pretty simplistic but it works for this use case. :^)
29 lines
660 B
C++
29 lines
660 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GTableView.h>
|
|
#include <AK/Function.h>
|
|
#include <unistd.h>
|
|
|
|
class ProcessTableModel;
|
|
|
|
class ProcessTableView final : public GTableView {
|
|
public:
|
|
explicit ProcessTableView(GWidget* parent);
|
|
virtual ~ProcessTableView() override;
|
|
|
|
pid_t selected_pid() const;
|
|
|
|
Function<void(String)> on_status_message;
|
|
|
|
protected:
|
|
virtual void model_notification(const GModelNotification&) override;
|
|
|
|
private:
|
|
virtual void timer_event(GTimerEvent&) override;
|
|
|
|
ProcessTableModel& model() { return *m_model; }
|
|
const ProcessTableModel& model() const { return *m_model; }
|
|
|
|
ProcessTableModel* m_model { nullptr };
|
|
};
|
|
|