| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <QDialog> |
| 7 |
#include <QIcon> |
| 8 |
#include <memory> |
| 9 |
|
| 10 |
class QStandardItem; |
| 11 |
class QStandardItemModel; |
| 12 |
class QTreeView; |
| 13 |
|
| 14 |
namespace DiscIO |
| 15 |
{ |
| 16 |
class FileInfo; |
| 17 |
class Volume; |
| 18 |
|
| 19 |
struct Partition; |
| 20 |
} |
| 21 |
|
| 22 |
class FilesystemWidget final : public QWidget |
| 23 |
{ |
| 24 |
Q_OBJECT |
| 25 |
public: |
| 26 |
explicit FilesystemWidget(std::shared_ptr<DiscIO::Volume> volume); |
| 27 |
~FilesystemWidget() override; |
| 28 |
|
| 29 |
private: |
| 30 |
void CreateWidgets(); |
| 31 |
void ConnectWidgets(); |
| 32 |
void PopulateView(); |
| 33 |
void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::Partition& partition); |
| 34 |
void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::FileInfo& directory); |
| 35 |
|
| 36 |
QString SelectFolder(); |
| 37 |
|
| 38 |
void ShowContextMenu(const QPoint&); |
| 39 |
|
| 40 |
void ExtractPartition(const DiscIO::Partition& partition, const QString& out); |
| 41 |
void ExtractDirectory(const DiscIO::Partition& partition, const QString& path, |
| 42 |
const QString& out); |
| 43 |
void ExtractFile(const DiscIO::Partition& partition, const QString& path, const QString& out); |
| 44 |
bool ExtractSystemData(const DiscIO::Partition& partition, const QString& out); |
| 45 |
|
| 46 |
DiscIO::Partition GetPartitionFromID(int id); |
| 47 |
|
| 48 |
QStandardItemModel* m_tree_model; |
| 49 |
QTreeView* m_tree_view; |
| 50 |
|
| 51 |
std::shared_ptr<DiscIO::Volume> m_volume; |
| 52 |
|
| 53 |
QIcon m_folder_icon; |
| 54 |
QIcon m_file_icon; |
| 55 |
}; |