2016-02-29 08:52:15 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-02-29 08:52:15 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDialog>
|
2019-02-01 00:13:50 +00:00
|
|
|
#include <QIcon>
|
2017-08-25 18:32:37 +00:00
|
|
|
#include <memory>
|
2016-02-29 08:52:15 +00:00
|
|
|
|
2017-08-25 18:32:37 +00:00
|
|
|
class QStandardItem;
|
|
|
|
class QStandardItemModel;
|
|
|
|
class QTreeView;
|
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
class FileInfo;
|
2018-05-13 19:55:51 +00:00
|
|
|
class Volume;
|
|
|
|
|
2017-08-25 18:32:37 +00:00
|
|
|
struct Partition;
|
2018-05-13 19:55:51 +00:00
|
|
|
} // namespace DiscIO
|
2017-08-25 18:32:37 +00:00
|
|
|
|
2016-02-29 08:52:15 +00:00
|
|
|
class FilesystemWidget final : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-03-21 22:04:56 +00:00
|
|
|
explicit FilesystemWidget(std::shared_ptr<DiscIO::Volume> volume);
|
2018-05-13 19:55:51 +00:00
|
|
|
~FilesystemWidget() override;
|
2016-02-29 08:52:15 +00:00
|
|
|
|
|
|
|
private:
|
2017-08-25 18:32:37 +00:00
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
void PopulateView();
|
2017-09-15 17:44:23 +00:00
|
|
|
void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::Partition& partition);
|
2017-08-25 18:32:37 +00:00
|
|
|
void PopulateDirectory(int partition_id, QStandardItem* root, const DiscIO::FileInfo& directory);
|
|
|
|
|
2018-07-02 00:24:09 +00:00
|
|
|
QString SelectFolder();
|
|
|
|
|
2017-08-25 18:32:37 +00:00
|
|
|
void ShowContextMenu(const QPoint&);
|
|
|
|
|
|
|
|
void ExtractPartition(const DiscIO::Partition& partition, const QString& out);
|
2018-03-28 01:55:16 +00:00
|
|
|
void ExtractDirectory(const DiscIO::Partition& partition, const QString& path,
|
|
|
|
const QString& out);
|
|
|
|
void ExtractFile(const DiscIO::Partition& partition, const QString& path, const QString& out);
|
2018-05-05 14:59:21 +00:00
|
|
|
bool ExtractSystemData(const DiscIO::Partition& partition, const QString& out);
|
2017-08-25 18:32:37 +00:00
|
|
|
|
|
|
|
DiscIO::Partition GetPartitionFromID(int id);
|
|
|
|
|
|
|
|
QStandardItemModel* m_tree_model;
|
|
|
|
QTreeView* m_tree_view;
|
|
|
|
|
2019-03-21 22:04:56 +00:00
|
|
|
std::shared_ptr<DiscIO::Volume> m_volume;
|
2019-02-01 00:13:50 +00:00
|
|
|
|
|
|
|
QIcon m_folder_icon;
|
|
|
|
QIcon m_file_icon;
|
2016-02-29 08:52:15 +00:00
|
|
|
};
|