DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent, bool isDeletable) :
	QWidget(parent),
	layout_(new QGridLayout),
	show_hide_button_(QIcon(":/icons/decoder-shown.svg"), QString(), this)
{
	layout_->setContentsMargins(0, 0, 0, 0);
	setLayout(layout_);

	layout_->addWidget(new QLabel(QString("<h3>%1</h3>").arg(title)),
		0, 0);
	layout_->setColumnStretch(0, 1);

	QHBoxLayout *const toolbar = new QHBoxLayout;
	layout_->addLayout(toolbar, 0, 1);

	show_hide_button_.setFlat(true);
	show_hide_button_.setIconSize(QSize(16, 16));
	connect(&show_hide_button_, SIGNAL(clicked()),
		this, SIGNAL(show_hide_decoder()));
	toolbar->addWidget(&show_hide_button_);

	if (isDeletable) {
		QPushButton *const delete_button = new QPushButton(
			QIcon(":/icons/decoder-delete.svg"), QString(), this);
		delete_button->setFlat(true);
		delete_button->setIconSize(QSize(16, 16));
		connect(delete_button, SIGNAL(clicked()),
			this, SIGNAL(delete_decoder()));
		toolbar->addWidget(delete_button);
	}
}
DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent) :
	QWidget(parent),
	_layout(new QGridLayout),
    _show_hide_button(QIcon(":/icons/decoder-shown.png"), QString(), this)
{
    _layout->setContentsMargins(0, 0, 0, 0);
	setLayout(_layout);

	_layout->addWidget(new QLabel(QString("<h3>%1</h3>").arg(title)),
		0, 0);
	_layout->setColumnStretch(0, 1);

	QHBoxLayout *const toolbar = new QHBoxLayout;
	_layout->addLayout(toolbar, 0, 1);

	_show_hide_button.setFlat(true);
    //_show_hide_button.setIconSize(QSize(16, 16));
	connect(&_show_hide_button, SIGNAL(clicked()),
		this, SIGNAL(show_hide_decoder()));
	toolbar->addWidget(&_show_hide_button);
}