#ifndef WARNING_DIALOG_H
#define WARNING_DIALOG_H

#include <QtGui>
#include "ui_warningDialog.h"
#include <cassert>

///Shows dialog with important game messages. */
class WarningDialog : public QDialog {
	Q_OBJECT

private:
	Ui::WarningDialog ui_;

signals:
	void submitSignal();
private slots:
	void submitButtonClickedSlot(bool checked) {
		emit submitSignal();
	}
public:
	WarningDialog(QWidget * parent) : QDialog(parent) {
		ui_.setupUi(this);

		bool connected = QObject::connect(ui_.submitButton, SIGNAL(clicked(bool)), this, SLOT(submitButtonClickedSlot(bool)));
		assert(connected && "Signals not connected");
	}

	void setTitle(const std::wstring & value) {
		ui_.titleLabel->setText(QString::fromUtf16(value.c_str()));
	} /**<Sets message box title. */

	void setTitle(const std::string & value) {
		ui_.titleLabel->setText(QString::fromUtf8(value.c_str()));
	} /**<Sets message box title. */

	void setMessage(const std::wstring & value) {
		ui_.messageLabel->setText(QString::fromUtf16(value.c_str()));
	} /**<Sets message string. */

	void setReason(const std::wstring & value) {
		ui_.reasonLabel->setText(QString::fromUtf16(value.c_str()));
	} /**<Sets message string. */

	void setMessage(const std::string & value) {
		ui_.messageLabel->setText(QString::fromUtf8(value.c_str()));
	} /**<Sets message string. */
};

#endif