2019-03-01 13:54:28 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibGUI/GTableView.h>
|
|
|
|
#include <sys/stat.h>
|
2019-03-23 01:42:49 +01:00
|
|
|
#include "DirectoryModel.h"
|
2019-03-01 13:54:28 +01:00
|
|
|
|
|
|
|
class DirectoryTableView final : public GTableView {
|
|
|
|
public:
|
|
|
|
explicit DirectoryTableView(GWidget* parent);
|
|
|
|
virtual ~DirectoryTableView() override;
|
|
|
|
|
|
|
|
void open(const String& path);
|
|
|
|
String path() const { return model().path(); }
|
2019-03-02 09:16:57 +01:00
|
|
|
void open_parent_directory();
|
2019-03-01 13:54:28 +01:00
|
|
|
|
2019-03-20 22:31:21 +01:00
|
|
|
void refresh();
|
|
|
|
|
2019-03-01 13:54:28 +01:00
|
|
|
Function<void(const String&)> on_path_change;
|
|
|
|
Function<void(String)> on_status_message;
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void model_notification(const GModelNotification&) override;
|
|
|
|
|
2019-03-23 01:42:49 +01:00
|
|
|
DirectoryModel& model() { return *m_model; }
|
|
|
|
const DirectoryModel& model() const { return *m_model; }
|
2019-03-01 13:54:28 +01:00
|
|
|
|
|
|
|
void set_status_message(const String&);
|
2019-03-09 14:52:25 +01:00
|
|
|
|
2019-03-23 01:42:49 +01:00
|
|
|
Retained<DirectoryModel> m_model;
|
2019-03-01 13:54:28 +01:00
|
|
|
};
|