mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-09 05:27:41 +00:00
Added type filtering to the resource browser
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
#include "CResourceProxyModel.h"
|
||||
#include "CResourceTableModel.h"
|
||||
#include "CVirtualDirectoryModel.h"
|
||||
#include <QCheckBox>
|
||||
#include <QDialog>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace Ui {
|
||||
class CResourceBrowser;
|
||||
@@ -22,21 +24,39 @@ class CResourceBrowser : public QDialog
|
||||
CVirtualDirectory *mpSelectedDir;
|
||||
CVirtualDirectoryModel *mpDirectoryModel;
|
||||
QTimer mUpdateFilterTimer;
|
||||
bool mAssetListMode;
|
||||
bool mSearching;
|
||||
|
||||
// Type Filter
|
||||
QWidget *mpFilterBoxesContainerWidget;
|
||||
QVBoxLayout *mpFilterBoxesLayout;
|
||||
QCheckBox *mpFilterAllBox;
|
||||
QFont mFilterBoxFont;
|
||||
|
||||
struct SResourceType
|
||||
{
|
||||
CResTypeInfo *pTypeInfo;
|
||||
QCheckBox *pFilterCheckBox;
|
||||
};
|
||||
QList<SResourceType> mTypeList;
|
||||
|
||||
public:
|
||||
explicit CResourceBrowser(QWidget *pParent = 0);
|
||||
~CResourceBrowser();
|
||||
|
||||
void SelectResource(CResourceEntry *pEntry);
|
||||
void SelectDirectory(CVirtualDirectory *pDir);
|
||||
void CreateFilterCheckboxes();
|
||||
|
||||
// Accessors
|
||||
inline CResourceEntry* SelectedEntry() const { return mpSelectedEntry; }
|
||||
inline bool InAssetListMode() const { return mAssetListMode || mSearching; }
|
||||
|
||||
public slots:
|
||||
void RefreshResources();
|
||||
void UpdateDescriptionLabel();
|
||||
void UpdateStore();
|
||||
void OnDisplayModeChanged(int Index);
|
||||
void OnSortModeChanged(int Index);
|
||||
void OnSearchStringChanged();
|
||||
void OnDirectorySelectionChanged(const QModelIndex& rkNewIndex, const QModelIndex& rkPrevIndex);
|
||||
@@ -48,6 +68,9 @@ public slots:
|
||||
void ExportAssetNames();
|
||||
void UpdateFilter();
|
||||
|
||||
void ResetTypeFilter();
|
||||
void OnFilterTypeBoxTicked(bool Checked);
|
||||
|
||||
signals:
|
||||
void SelectedResourceChanged(CResourceEntry *pNewRes);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user