#ifndef BLOCKPROPERTIES_H
#define BLOCKPROPERTIES_H

#include <QDialog>
#include <colorbutton.h>
#include "block_editor_dialog.h"
#include "ui_block_properties.h"
#include "core.h"


class BlockProperties: public QDialog, public Ui::BlockProperties {
	Q_OBJECT
public:
	explicit BlockProperties(QWidget * parent = 0);
	~BlockProperties();
	
	QDialog::DialogCode show(BlockItem * b);

	BlockEditorDialog editor_dialog;

private:
	void save();
	void load();
	QString askFile(bool save);
	
	BlockItem * block;
	QList<QWidget*> _widgets;
	SHDesignerCore::Editor * editor;
	QByteArray configuration;
	QString last_file;
	
public slots:
	
private slots:
	void accept();
	void reject();
	void on_buttonBox_clicked(QAbstractButton * button);
	void on_buttonRecreate_clicked();
	void on_buttonEditDB_clicked();
	void on_buttonEdit_clicked();
	void on_buttonExport_clicked();
	void on_buttonImport_clicked();
	void on_properties_resetStorageRequest(PropertyStorage * s);
	void on_actions__executeAction(SHPluginBase::PluginAction action);
	void on_actions__checkRequest(SHPluginBase::PluginAction action, bool * ret);

signals:
	void editDatabaseBlock(int id);
	
};

#endif // BLOCKPROPERTIES_H
