Right now, all this adds is a small dialog to the Widgets frontend showing the user how much space is taken up by their saves, shaders, NAND, and mods. It also gives them the choice to clear these directories (with 2x confirmation), OR open the directory in their system file manager. In the future, a lot more can be done with this concept. Notably, a common import/export (a la android) could be added, the UI can obviously be polished, etc. We could also add this to Android, but I don't think common import/export is needed *for* Android, and should probably be left in qt_common. Signed-off-by: crueter <crueter@eden-emu.dev>
43 lines
871 B
C++
43 lines
871 B
C++
#ifndef DATA_DIALOG_H
|
|
#define DATA_DIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QFutureWatcher>
|
|
#include <QSortFilterProxyModel>
|
|
#include <QTableWidgetItem>
|
|
#include "frontend_common/data_manager.h"
|
|
#include <qnamespace.h>
|
|
|
|
namespace Ui {
|
|
class DataDialog;
|
|
}
|
|
|
|
class DataDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DataDialog(QWidget *parent = nullptr);
|
|
~DataDialog();
|
|
|
|
private:
|
|
std::unique_ptr<Ui::DataDialog> ui;
|
|
};
|
|
|
|
class DataItem : public QTableWidgetItem
|
|
{
|
|
public:
|
|
DataItem(FrontendCommon::DataManager::DataDir data_dir, QWidget *parent);
|
|
enum DataRole { SIZE = Qt::UserRole + 1, DATA_DIR };
|
|
|
|
bool operator<(const QTableWidgetItem &other) const;
|
|
void reset();
|
|
void scan();
|
|
|
|
private:
|
|
QWidget *m_parent;
|
|
QFutureWatcher<u64> *m_watcher = nullptr;
|
|
FrontendCommon::DataManager::DataDir m_dir;
|
|
};
|
|
|
|
#endif // DATA_DIALOG_H
|