mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-09 05:27:41 +00:00
Added support for dragging/dropping resources; you can use drag/drop to rearrange resources/folders in the resource browser now, and you can drag/drop resources onto resource selector widgets
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "CVirtualDirectoryModel.h"
|
||||
#include <QCheckBox>
|
||||
#include <QTimer>
|
||||
#include <QUndoStack>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace Ui {
|
||||
@@ -41,6 +42,12 @@ class CResourceBrowser : public QWidget
|
||||
};
|
||||
QList<SResourceType> mTypeList;
|
||||
|
||||
// Undo/Redo
|
||||
QUndoStack mUndoStack;
|
||||
QAction *mpUndoAction;
|
||||
QAction *mpRedoAction;
|
||||
QWidget *mpActionContainerWidget;
|
||||
|
||||
public:
|
||||
explicit CResourceBrowser(QWidget *pParent = 0);
|
||||
~CResourceBrowser();
|
||||
@@ -49,6 +56,11 @@ public:
|
||||
void SelectDirectory(CVirtualDirectory *pDir);
|
||||
void CreateFilterCheckboxes();
|
||||
|
||||
bool MoveResources(const QList<CResourceEntry*>& rkResources, const QList<CVirtualDirectory*>& rkDirectories, CVirtualDirectory *pNewDir);
|
||||
|
||||
// Interface
|
||||
bool eventFilter(QObject *pWatched, QEvent *pEvent);
|
||||
|
||||
// Accessors
|
||||
inline CResourceStore* CurrentStore() const { return mpStore; }
|
||||
inline CResourceEntry* SelectedEntry() const { return mpSelectedEntry; }
|
||||
@@ -80,6 +92,10 @@ public slots:
|
||||
void ResetTypeFilter();
|
||||
void OnFilterTypeBoxTicked(bool Checked);
|
||||
|
||||
void UpdateUndoActionStates();
|
||||
void Undo();
|
||||
void Redo();
|
||||
|
||||
signals:
|
||||
void SelectedResourceChanged(CResourceEntry *pNewRes);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user