#ifndef CDVIEWWIDGET_H
#define CDVIEWWIDGET_H

#include <QWidget>
#include "ui_cdviewwidget.h"


class CDViewWidget : public QWidget, public Ui::CDViewWidget
{
	Q_OBJECT
public:
	explicit CDViewWidget(QWidget *parent = 0);
	~CDViewWidget();

	enum LogIcon {NoIcon, OKIcon, FailIcon, WaitIcon};

	void reset();
	void setType(int t);
	void setFile(const QString & f);

private:
	QString tl_u, tl_l;

private slots:
	void sended()        {addToLog(OKIcon,   tl_u + " " + tr("sended succesfull"));}
	void received()      {addToLog(OKIcon,   tl_u + " " + tr("received succesfull"));}
	void sendFailed()    {addToLog(FailIcon, tl_u + " " + tr("NOT sended"));}
	void receiveFailed() {addToLog(FailIcon, tl_u + " " + tr("NOT received"));}
	void on_buttonSend_clicked();
	void on_buttonReceive_clicked();
	void on_buttonLoad_clicked();
	void on_buttonSave_clicked();
	void on_buttonParse_clicked();
	//void on_buttonCalculate_clicked();

signals:
	void addToLog(CDViewWidget::LogIcon icon, const QString & msg);

};

#endif // CDVIEWWIDGET_H
