#ifndef UPLOAD_DIALOG_H
#define UPLOAD_DIALOG_H

#include <QDialog>
#include "ui_upload_dialog.h"
#include "SH_stream_tcp.h"
#include "SH_plugins.h"
#include "SH_assembly.h"
#include "SH_network_types.h"
#include "SH_client_channel.h"


class UploadDialog: public QDialog, protected Ui::UploadDialog, public PIObject {
	Q_OBJECT
	PIOBJECT(UploadDialog)
public:
	explicit UploadDialog(QWidget * parent = 0);
	~UploadDialog();

	void exec(QByteArray baf);

private:
	void timerEvent(QTimerEvent * e) override;
	void setState(QString t);
	EVENT_HANDLER(void, connected);
	EVENT_HANDLER1(void, receiveEvent, PIByteArray, data);

	SHClientChannel channel;
	QByteArray baf;
	uint id;
	int timer_pip;

private slots:
	void on_buttonUpload_clicked();
	void on_treeServers_serverSelected(PacketServerInfo info);

public slots:

};

#endif // UPLOAD_DIALOG_H
