Blob Blame Raw


#ifndef INSERTFXPOPUP_H
#define INSERTFXPOPUP_H

#include "toonzqt/dvdialog.h"
#include "tfilePath.h"
#include "tstream.h"

// forward declaration
class QTreeWidget;
class QTreeWidgetItem;
class TFx;

#include <QIcon>

using namespace DVGui;
using namespace std;

//=============================================================================
// InsertFxPopup
//-----------------------------------------------------------------------------

class InsertFxPopup : public Dialog
{
	Q_OBJECT

	QTreeWidget *m_fxTree;

	TIStream *m_is;
	TFilePath m_presetFolder;

	QIcon m_folderIcon;
	QIcon m_presetIcon;
	QIcon m_fxIcon;

public:
	InsertFxPopup();

private:
	TFx *createFx();

	void makeItem(QTreeWidgetItem *parent, string fxid);

	void loadFolder(QTreeWidgetItem *parent);
	/*!Return true if preset is loaded.*/
	bool loadPreset(QTreeWidgetItem *item);

	bool loadFx(TFilePath fp);
	void loadMacro();

public slots:
	void onItemDoubleClicked(QTreeWidgetItem *w, int c);
	void onInsert();
	void onReplace();
	void onAdd();

protected:
	void showEvent(QShowEvent *);
	void hideEvent(QHideEvent *);
	void contextMenuEvent(QContextMenuEvent *);

protected slots:
	void updatePresets();
	void removePreset();
};

#endif // INSERTFXPOPUP_H